@Test public void testEquals() { Model mo = new DefaultModel(); VM v = mo.newVM(); Node n1 = mo.newNode(); Node n2 = mo.newNode(); mo.getMapping().addOnlineNode(n1); mo.getMapping().addOnlineNode(n2); mo.getMapping().addRunningVM(v, n1); ReconfigurationPlan p1 = new DefaultReconfigurationPlan(mo); p1.add(new ShutdownNode(n1, 1, 2)); p1.add(new ShutdownNode(n2, 1, 2)); ReconfigurationPlan p2 = new DefaultReconfigurationPlan(mo.copy()); p2.add(new ShutdownNode(n1, 1, 2)); p2.add(new ShutdownNode(n2, 1, 2)); Assert.assertEquals(p1, p2); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ReconfigurationPlan op = (ReconfigurationPlan) o; return actions.equals(op.getActions()) && src.equals(op.getOrigin()); }
DefaultReconfigurationPlan implements ReconfigurationPlan { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ReconfigurationPlan op = (ReconfigurationPlan) o; return actions.equals(op.getActions()) && src.equals(op.getOrigin()); } }
DefaultReconfigurationPlan implements ReconfigurationPlan { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ReconfigurationPlan op = (ReconfigurationPlan) o; return actions.equals(op.getActions()) && src.equals(op.getOrigin()); } DefaultReconfigurationPlan(Model m); }
DefaultReconfigurationPlan implements ReconfigurationPlan { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ReconfigurationPlan op = (ReconfigurationPlan) o; return actions.equals(op.getActions()) && src.equals(op.getOrigin()); } 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 boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ReconfigurationPlan op = (ReconfigurationPlan) o; return actions.equals(op.getActions()) && src.equals(op.getOrigin()); } 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);  }