@Test public void testToString() { Mapping c = new DefaultMapping(); c.addOnlineNode(ns.get(0)); c.addRunningVM(vms.get(0), ns.get(0)); c.addRunningVM(vms.get(1), ns.get(0)); c.addSleepingVM(vms.get(2), ns.get(0)); c.addOnlineNode(ns.get(1)); c.addSleepingVM(vms.get(3), ns.get(1)); c.addSleepingVM(vms.get(4), ns.get(1)); c.addOnlineNode(ns.get(2)); c.addOfflineNode(ns.get(3)); c.addReadyVM(vms.get(5)); c.addReadyVM(vms.get(6)); Assert.assertNotNull(c.toString()); }
@Override public String toString() { StringBuilder buf = new StringBuilder(); for (Node n : nodeState[ONLINE_STATE]) { buf.append(n); buf.append(':'); if (this.getRunningVMs(n).isEmpty() && this.getSleepingVMs(n).isEmpty()) { buf.append(" - "); } for (VM vm : this.getRunningVMs(n)) { buf.append(' ').append(vm); } for (VM vm : this.getSleepingVMs(n)) { buf.append(" (").append(vm).append(')'); } buf.append('\n'); } for (Node n : nodeState[OFFLINE_STATE]) { buf.append('(').append(n).append(")\n"); } buf.append("READY"); for (VM vm : this.getReadyVMs()) { buf.append(' ').append(vm); } return buf.append('\n').toString(); }
DefaultMapping extends AbstractMapping { @Override public String toString() { StringBuilder buf = new StringBuilder(); for (Node n : nodeState[ONLINE_STATE]) { buf.append(n); buf.append(':'); if (this.getRunningVMs(n).isEmpty() && this.getSleepingVMs(n).isEmpty()) { buf.append(" - "); } for (VM vm : this.getRunningVMs(n)) { buf.append(' ').append(vm); } for (VM vm : this.getSleepingVMs(n)) { buf.append(" (").append(vm).append(')'); } buf.append('\n'); } for (Node n : nodeState[OFFLINE_STATE]) { buf.append('(').append(n).append(")\n"); } buf.append("READY"); for (VM vm : this.getReadyVMs()) { buf.append(' ').append(vm); } return buf.append('\n').toString(); } }
DefaultMapping extends AbstractMapping { @Override public String toString() { StringBuilder buf = new StringBuilder(); for (Node n : nodeState[ONLINE_STATE]) { buf.append(n); buf.append(':'); if (this.getRunningVMs(n).isEmpty() && this.getSleepingVMs(n).isEmpty()) { buf.append(" - "); } for (VM vm : this.getRunningVMs(n)) { buf.append(' ').append(vm); } for (VM vm : this.getSleepingVMs(n)) { buf.append(" (").append(vm).append(')'); } buf.append('\n'); } for (Node n : nodeState[OFFLINE_STATE]) { buf.append('(').append(n).append(")\n"); } buf.append("READY"); for (VM vm : this.getReadyVMs()) { buf.append(' ').append(vm); } return buf.append('\n').toString(); } @SuppressWarnings("unchecked")  DefaultMapping();  DefaultMapping(Mapping m); }
DefaultMapping extends AbstractMapping { @Override public String toString() { StringBuilder buf = new StringBuilder(); for (Node n : nodeState[ONLINE_STATE]) { buf.append(n); buf.append(':'); if (this.getRunningVMs(n).isEmpty() && this.getSleepingVMs(n).isEmpty()) { buf.append(" - "); } for (VM vm : this.getRunningVMs(n)) { buf.append(' ').append(vm); } for (VM vm : this.getSleepingVMs(n)) { buf.append(" (").append(vm).append(')'); } buf.append('\n'); } for (Node n : nodeState[OFFLINE_STATE]) { buf.append('(').append(n).append(")\n"); } buf.append("READY"); for (VM vm : this.getReadyVMs()) { buf.append(' ').append(vm); } return buf.append('\n').toString(); } @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 String toString() { StringBuilder buf = new StringBuilder(); for (Node n : nodeState[ONLINE_STATE]) { buf.append(n); buf.append(':'); if (this.getRunningVMs(n).isEmpty() && this.getSleepingVMs(n).isEmpty()) { buf.append(" - "); } for (VM vm : this.getRunningVMs(n)) { buf.append(' ').append(vm); } for (VM vm : this.getSleepingVMs(n)) { buf.append(" (").append(vm).append(')'); } buf.append('\n'); } for (Node n : nodeState[OFFLINE_STATE]) { buf.append('(').append(n).append(")\n"); } buf.append("READY"); for (VM vm : this.getReadyVMs()) { buf.append(' ').append(vm); } return buf.append('\n').toString(); } @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();  }