@Test(dependsOnMethods = {"testInstantiation", "testDefinition"}) public void testUnset() { ShareableResource rc = new ShareableResource("foo"); rc.setConsumption(vms.get(0), 3); rc.unset(vms.get(0)); Assert.assertFalse(rc.consumptionDefined(vms.get(0))); rc.setCapacity(nodes.get(0), 3); rc.unset(nodes.get(0)); Assert.assertFalse(rc.capacityDefined(nodes.get(0))); rc.unset(nodes.get(0)); rc.unset(nodes.toArray(new Node[0])); rc.unset(vms.toArray(new VM[0])); Assert.assertTrue(rc.getDefinedVMs().isEmpty()); Assert.assertTrue(rc.getDefinedNodes().isEmpty()); }
public void unset(VM vm) { vmsConsumption.remove(vm); }
ShareableResource implements ModelView { public void unset(VM vm) { vmsConsumption.remove(vm); } }
ShareableResource implements ModelView { public void unset(VM vm) { vmsConsumption.remove(vm); } ShareableResource(String r);  ShareableResource(String id, int defCapacity, int defConsumption); }
ShareableResource implements ModelView { public void unset(VM vm) { vmsConsumption.remove(vm); } ShareableResource(String r);  ShareableResource(String id, int defCapacity, int defConsumption); int getConsumption(VM vm); int getCapacity(Node n); Set<VM> getDefinedVMs(); Set<Node> getDefinedNodes(); ShareableResource setConsumption(VM vm, int val); ShareableResource setConsumption(int val, VM... vms); ShareableResource setCapacity(Node n, int val); ShareableResource setCapacity(int val, Node... nodes); void unset(VM vm); void unset(Node n); void unset(VM... vms); void unset(Node... nodes); boolean consumptionDefined(VM vm); boolean capacityDefined(Node n); @Override String getIdentifier(); static String getIdentifier(String rcId); String getResourceIdentifier(); int getDefaultConsumption(); int getDefaultCapacity(); @Override boolean equals(Object o); @Override int hashCode(); @Override ShareableResource copy(); @Override String toString(); @Override boolean substituteVM(VM oldRef, VM newRef); int sumConsumptions(Collection<VM> ids, boolean undef); int sumCapacities(Collection<Node> ids, boolean undef); static ShareableResource get(Model mo, String id); }
ShareableResource implements ModelView { public void unset(VM vm) { vmsConsumption.remove(vm); } ShareableResource(String r);  ShareableResource(String id, int defCapacity, int defConsumption); int getConsumption(VM vm); int getCapacity(Node n); Set<VM> getDefinedVMs(); Set<Node> getDefinedNodes(); ShareableResource setConsumption(VM vm, int val); ShareableResource setConsumption(int val, VM... vms); ShareableResource setCapacity(Node n, int val); ShareableResource setCapacity(int val, Node... nodes); void unset(VM vm); void unset(Node n); void unset(VM... vms); void unset(Node... nodes); boolean consumptionDefined(VM vm); boolean capacityDefined(Node n); @Override String getIdentifier(); static String getIdentifier(String rcId); String getResourceIdentifier(); int getDefaultConsumption(); int getDefaultCapacity(); @Override boolean equals(Object o); @Override int hashCode(); @Override ShareableResource copy(); @Override String toString(); @Override boolean substituteVM(VM oldRef, VM newRef); int sumConsumptions(Collection<VM> ids, boolean undef); int sumCapacities(Collection<Node> ids, boolean undef); static ShareableResource get(Model mo, String id); static final String VIEW_ID_BASE; static final int DEFAULT_NO_VALUE; }