@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 void setCallback() {
   try {
     vn.subscribeNodeAttachment(_this, "callback", true);
   } catch (Throwable e) {
     e.printStackTrace();
   }
   System.out.println("SUBSCRIBED");
 }
 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();
 }