@Test public void testToString() { Model mo = new DefaultModel(); VM v1 = mo.newVM(); VM v2 = mo.newVM(); Node n1 = mo.newNode(); Node n2 = mo.newNode(); mo.getMapping().addOnlineNode(n1); mo.getMapping().addOnlineNode(n2); mo.getMapping().addRunningVM(v1, n1); mo.getMapping().addRunningVM(v2, n1); ReconfigurationPlan p1 = new DefaultReconfigurationPlan(mo); p1.add(new MigrateVM(v1, n1, n2, 1, 2)); p1.add(new MigrateVM(v2, n1, n2, 1, 2)); String s = p1.toString(); Assert.assertNotEquals(s.indexOf("migrate("), s.lastIndexOf("migrate(")); System.err.println(p1.toString()); System.err.flush(); }
@Override public String toString() { List<Action> l = new ArrayList<>(actions); l.sort(sorter); StringJoiner joiner = new StringJoiner("\n"); for (Action a : l) { joiner.add(String.format("%d:%d %s", a.getStart(), a.getEnd(), a.toString())); } return joiner.toString(); }
DefaultReconfigurationPlan implements ReconfigurationPlan { @Override public String toString() { List<Action> l = new ArrayList<>(actions); l.sort(sorter); StringJoiner joiner = new StringJoiner("\n"); for (Action a : l) { joiner.add(String.format("%d:%d %s", a.getStart(), a.getEnd(), a.toString())); } return joiner.toString(); } }
DefaultReconfigurationPlan implements ReconfigurationPlan { @Override public String toString() { List<Action> l = new ArrayList<>(actions); l.sort(sorter); StringJoiner joiner = new StringJoiner("\n"); for (Action a : l) { joiner.add(String.format("%d:%d %s", a.getStart(), a.getEnd(), a.toString())); } return joiner.toString(); } DefaultReconfigurationPlan(Model m); }
DefaultReconfigurationPlan implements ReconfigurationPlan { @Override public String toString() { List<Action> l = new ArrayList<>(actions); l.sort(sorter); StringJoiner joiner = new StringJoiner("\n"); for (Action a : l) { joiner.add(String.format("%d:%d %s", a.getStart(), a.getEnd(), a.toString())); } return joiner.toString(); } DefaultReconfigurationPlan(Model m); @Override Model getOrigin(); @Override boolean add(Action a); @Override int getSize(); @Override int getDuration(); @Override Set<Action> getActions(); @Override Iterator<Action> iterator(); @Override Model getResult(); @Override String toString(); @Override boolean isApplyable(); @Override boolean equals(Object o); @Override int hashCode(); @Override Set<Action> getDirectDependencies(Action a); @Override ReconfigurationPlanApplier getReconfigurationApplier(); @Override void setReconfigurationApplier(ReconfigurationPlanApplier ra); }
DefaultReconfigurationPlan implements ReconfigurationPlan { @Override public String toString() { List<Action> l = new ArrayList<>(actions); l.sort(sorter); StringJoiner joiner = new StringJoiner("\n"); for (Action a : l) { joiner.add(String.format("%d:%d %s", a.getStart(), a.getEnd(), a.toString())); } return joiner.toString(); } DefaultReconfigurationPlan(Model m); @Override Model getOrigin(); @Override boolean add(Action a); @Override int getSize(); @Override int getDuration(); @Override Set<Action> getActions(); @Override Iterator<Action> iterator(); @Override Model getResult(); @Override String toString(); @Override boolean isApplyable(); @Override boolean equals(Object o); @Override int hashCode(); @Override Set<Action> getDirectDependencies(Action a); @Override ReconfigurationPlanApplier getReconfigurationApplier(); @Override void setReconfigurationApplier(ReconfigurationPlanApplier ra);  }