Exemplo n.º 1
0
  @Test
  public void test() throws FileNotFoundException, ProActiveException, InterruptedException {
    Thread.sleep(8000);

    GCMVirtualNode vn1 = gcmad.getVirtualNode("vn1");
    GCMVirtualNode vn2 = gcmad.getVirtualNode("vn2");

    boolean fairness = true;
    int diff = vn1.getCurrentNodes().size() - vn2.getCurrentNodes().size();
    if ((diff < -1) || (diff > 1)) {
      fairness = false;
    }

    Assert.assertTrue("Allocation is not fair between greedy VNs", fairness);
  }
 public GCMVirtualNodeSnapshot(final GCMVirtualNode vn) {
   this.name = vn.getName();
   this.isGreedy = vn.isGreedy();
   this.isReady = vn.isReady();
   this.nbRequiredNodes = vn.getNbRequiredNodes();
   this.nbCurrentNodes = vn.getNbCurrentNodes();
   this.currentNodes = vn.getCurrentNodes();
   this.currentTopology = vn.getCurrentTopology();
   this.uniqueId = vn.getUniqueID();
 }