@Test(dependsOnMethods = {"testInstantiate"}) public void testEquals() { MigrateVM a = new MigrateVM(vms.get(0), ns.get(0), ns.get(1), 3, 5); MigrateVM b = new MigrateVM(vms.get(0), ns.get(0), ns.get(1), 3, 5); Assert.assertFalse(a.equals(new Object())); Assert.assertTrue(a.equals(a)); Assert.assertEquals(a, b); Assert.assertEquals(a.hashCode(), b.hashCode()); b.setBandwidth(200); Assert.assertNotEquals(a, b); Assert.assertNotEquals(a, new MigrateVM(vms.get(0), ns.get(0), ns.get(1), 4, 5)); Assert.assertNotEquals(a, new MigrateVM(vms.get(0), ns.get(0), ns.get(1), 3, 4)); Assert.assertNotEquals(a, new MigrateVM(vms.get(1), ns.get(0), ns.get(1), 3, 5)); Assert.assertNotEquals(a, new MigrateVM(vms.get(0), ns.get(2), ns.get(1), 3, 5)); Assert.assertNotEquals(a, new MigrateVM(vms.get(0), ns.get(0), ns.get(2), 3, 5)); }
@Override public boolean equals(Object o) { if (!super.equals(o)) { return false; } MigrateVM that = (MigrateVM) o; return this.vm.equals(that.vm) && this.src.equals(that.src) && this.dst.equals(that.dst) && this.bw == that.bw; }
MigrateVM extends Action implements RunningVMPlacement { @Override public boolean equals(Object o) { if (!super.equals(o)) { return false; } MigrateVM that = (MigrateVM) o; return this.vm.equals(that.vm) && this.src.equals(that.src) && this.dst.equals(that.dst) && this.bw == that.bw; } }
MigrateVM extends Action implements RunningVMPlacement { @Override public boolean equals(Object o) { if (!super.equals(o)) { return false; } MigrateVM that = (MigrateVM) o; return this.vm.equals(that.vm) && this.src.equals(that.src) && this.dst.equals(that.dst) && this.bw == that.bw; } MigrateVM(VM v, Node from, Node to, int start, int end, int bandwidth);  MigrateVM(VM v, Node from, Node to, int start, int end); }
MigrateVM extends Action implements RunningVMPlacement { @Override public boolean equals(Object o) { if (!super.equals(o)) { return false; } MigrateVM that = (MigrateVM) o; return this.vm.equals(that.vm) && this.src.equals(that.src) && this.dst.equals(that.dst) && this.bw == that.bw; } MigrateVM(VM v, Node from, Node to, int start, int end, int bandwidth);  MigrateVM(VM v, Node from, Node to, int start, int end); Node getSourceNode(); int getBandwidth(); @Override Node getDestinationNode(); @Override VM getVM(); @Override boolean applyAction(Model i); @Override boolean equals(Object o); @Override int hashCode(); @Override String pretty(); @Override Object visit(ActionVisitor v); boolean setBandwidth(int bandwidth); }
MigrateVM extends Action implements RunningVMPlacement { @Override public boolean equals(Object o) { if (!super.equals(o)) { return false; } MigrateVM that = (MigrateVM) o; return this.vm.equals(that.vm) && this.src.equals(that.src) && this.dst.equals(that.dst) && this.bw == that.bw; } MigrateVM(VM v, Node from, Node to, int start, int end, int bandwidth);  MigrateVM(VM v, Node from, Node to, int start, int end); Node getSourceNode(); int getBandwidth(); @Override Node getDestinationNode(); @Override VM getVM(); @Override boolean applyAction(Model i); @Override boolean equals(Object o); @Override int hashCode(); @Override String pretty(); @Override Object visit(ActionVisitor v); boolean setBandwidth(int bandwidth);  }