@Test(dependsOnMethods = {"testInstantiation", "testOnlineNode", "testOfflineNode", "testRunningVM", "testWaiting", "testSleeping"}) public void testClearAllVMs() { Mapping c = new DefaultMapping(); c.addOfflineNode(ns.get(0)); c.addOnlineNode(ns.get(1)); c.addRunningVM(vms.get(0), ns.get(1)); c.addRunningVM(vms.get(1), ns.get(1)); c.addSleepingVM(vms.get(2), ns.get(1)); c.addReadyVM(vms.get(3)); c.clearAllVMs(); Assert.assertEquals(c.getAllNodes().size(), 2); Assert.assertTrue(c.getAllVMs().isEmpty()); Assert.assertTrue(c.getRunningVMs().isEmpty()); Assert.assertTrue(c.getSleepingVMs().isEmpty()); Assert.assertTrue(c.getReadyVMs().isEmpty()); Assert.assertEquals(c.getOnlineNodes().size(), 1); Assert.assertEquals(c.getOfflineNodes().size(), 1); Assert.assertTrue(c.getRunningVMs(ns.get(1)).isEmpty()); Assert.assertTrue(c.getSleepingVMs(ns.get(1)).isEmpty()); Assert.assertEquals(c.getNbVMs(), 0); }
@Override public void clearAllVMs() { place.clear(); st.clear(); vmReady.clear(); for (TIntObjectHashMap<Set<VM>> h : host) { h.clear(); } }
DefaultMapping extends AbstractMapping { @Override public void clearAllVMs() { place.clear(); st.clear(); vmReady.clear(); for (TIntObjectHashMap<Set<VM>> h : host) { h.clear(); } } }
DefaultMapping extends AbstractMapping { @Override public void clearAllVMs() { place.clear(); st.clear(); vmReady.clear(); for (TIntObjectHashMap<Set<VM>> h : host) { h.clear(); } } @SuppressWarnings("unchecked")  DefaultMapping();  DefaultMapping(Mapping m); }
DefaultMapping extends AbstractMapping { @Override public void clearAllVMs() { place.clear(); st.clear(); vmReady.clear(); for (TIntObjectHashMap<Set<VM>> h : host) { h.clear(); } } @SuppressWarnings("unchecked")  DefaultMapping();  DefaultMapping(Mapping m); @Override boolean isRunning(VM v); @Override boolean isSleeping(VM v); @Override boolean isReady(VM v); @Override boolean isOnline(Node n); @Override boolean isOffline(Node n); @Override boolean addRunningVM(VM vm, Node n); @Override boolean addSleepingVM(VM vm, Node n); @Override boolean addReadyVM(VM vm); @Override boolean remove(VM vm); @Override boolean remove(Node n); @Override boolean addOnlineNode(Node n); @Override boolean addOfflineNode(Node n); @Override Set<Node> getOnlineNodes(); @Override Set<Node> getOfflineNodes(); @Override Set<VM> getRunningVMs(); @Override Set<VM> getSleepingVMs(); @Override Set<VM> getSleepingVMs(Node n); @Override Set<VM> getRunningVMs(Node n); @Override Set<VM> getReadyVMs(); @Override Set<VM> getAllVMs(); @Override Set<Node> getAllNodes(); @Override Node getVMLocation(VM vm); @Override Set<VM> getRunningVMs(Collection<Node> ns); @Override Set<VM> getSleepingVMs(Collection<Node> ns); @Override Mapping copy(); @Override boolean contains(Node n); @Override boolean contains(VM vm); @Override void clear(); @Override void clearNode(Node u); @Override void clearAllVMs(); @Override String toString(); @Override int getNbNodes(); @Override int getNbVMs(); }
DefaultMapping extends AbstractMapping { @Override public void clearAllVMs() { place.clear(); st.clear(); vmReady.clear(); for (TIntObjectHashMap<Set<VM>> h : host) { h.clear(); } } @SuppressWarnings("unchecked")  DefaultMapping();  DefaultMapping(Mapping m); @Override boolean isRunning(VM v); @Override boolean isSleeping(VM v); @Override boolean isReady(VM v); @Override boolean isOnline(Node n); @Override boolean isOffline(Node n); @Override boolean addRunningVM(VM vm, Node n); @Override boolean addSleepingVM(VM vm, Node n); @Override boolean addReadyVM(VM vm); @Override boolean remove(VM vm); @Override boolean remove(Node n); @Override boolean addOnlineNode(Node n); @Override boolean addOfflineNode(Node n); @Override Set<Node> getOnlineNodes(); @Override Set<Node> getOfflineNodes(); @Override Set<VM> getRunningVMs(); @Override Set<VM> getSleepingVMs(); @Override Set<VM> getSleepingVMs(Node n); @Override Set<VM> getRunningVMs(Node n); @Override Set<VM> getReadyVMs(); @Override Set<VM> getAllVMs(); @Override Set<Node> getAllNodes(); @Override Node getVMLocation(VM vm); @Override Set<VM> getRunningVMs(Collection<Node> ns); @Override Set<VM> getSleepingVMs(Collection<Node> ns); @Override Mapping copy(); @Override boolean contains(Node n); @Override boolean contains(VM vm); @Override void clear(); @Override void clearNode(Node u); @Override void clearAllVMs(); @Override String toString(); @Override int getNbNodes(); @Override int getNbVMs();  }