@Test(dependsOnMethods = {"testInstantiation"}) public void testEquals() { Allocate a = new Allocate(vms.get(0), ns.get(0), "foo", 5, 3, 5); Allocate b = new Allocate(vms.get(0), ns.get(0), "foo", 5, 3, 5); Assert.assertFalse(a.equals(new Object())); Assert.assertTrue(a.equals(a)); Assert.assertEquals(a, b); Assert.assertEquals(a.hashCode(), b.hashCode()); Assert.assertNotSame(a, new Allocate(vms.get(2), ns.get(0), "foo", 5, 3, 5)); Assert.assertNotSame(a, new Allocate(vms.get(0), ns.get(1), "foo", 5, 3, 5)); Assert.assertNotSame(a, new Allocate(vms.get(0), ns.get(0), "bar", 5, 3, 5)); Assert.assertNotSame(a, new Allocate(vms.get(0), ns.get(0), "foo", 6, 3, 5)); Assert.assertNotSame(a, new Allocate(vms.get(0), ns.get(0), "foo", 5, 4, 5)); Assert.assertNotSame(a, new Allocate(vms.get(0), ns.get(0), "foo", 5, 3, 7)); }
@Override public boolean equals(Object o) { if (!super.equals(o)) { return false; } Allocate that = (Allocate) o; return this.getVM().equals(that.getVM()) && this.node.equals(that.node) && this.getResourceId().equals(that.getResourceId()) && this.getAmount() == that.getAmount(); }
Allocate extends Action implements VMEvent { @Override public boolean equals(Object o) { if (!super.equals(o)) { return false; } Allocate that = (Allocate) o; return this.getVM().equals(that.getVM()) && this.node.equals(that.node) && this.getResourceId().equals(that.getResourceId()) && this.getAmount() == that.getAmount(); } }
Allocate extends Action implements VMEvent { @Override public boolean equals(Object o) { if (!super.equals(o)) { return false; } Allocate that = (Allocate) o; return this.getVM().equals(that.getVM()) && this.node.equals(that.node) && this.getResourceId().equals(that.getResourceId()) && this.getAmount() == that.getAmount(); } Allocate(VM vm, Node on, String rc, int amount, int start, int end); }
Allocate extends Action implements VMEvent { @Override public boolean equals(Object o) { if (!super.equals(o)) { return false; } Allocate that = (Allocate) o; return this.getVM().equals(that.getVM()) && this.node.equals(that.node) && this.getResourceId().equals(that.getResourceId()) && this.getAmount() == that.getAmount(); } Allocate(VM vm, Node on, String rc, int amount, int start, int end); Node getHost(); @Override VM getVM(); String getResourceId(); int getAmount(); @Override boolean applyAction(Model i); @Override String pretty(); @Override boolean equals(Object o); @Override int hashCode(); @Override Object visit(ActionVisitor v); }
Allocate extends Action implements VMEvent { @Override public boolean equals(Object o) { if (!super.equals(o)) { return false; } Allocate that = (Allocate) o; return this.getVM().equals(that.getVM()) && this.node.equals(that.node) && this.getResourceId().equals(that.getResourceId()) && this.getAmount() == that.getAmount(); } Allocate(VM vm, Node on, String rc, int amount, int start, int end); Node getHost(); @Override VM getVM(); String getResourceId(); int getAmount(); @Override boolean applyAction(Model i); @Override String pretty(); @Override boolean equals(Object o); @Override int hashCode(); @Override Object visit(ActionVisitor v);  }