@Test(dependsOnMethods = {"testInstantiate"}) public void testEquals() { KillVM a = new KillVM(vms.get(0), ns.get(0), 3, 5); KillVM b = new KillVM(vms.get(0), ns.get(0), 3, 5); Assert.assertFalse(a.equals(new Object())); Assert.assertTrue(a.equals(a)); Assert.assertTrue(a.equals(b)); Assert.assertEquals(a.hashCode(), b.hashCode()); Assert.assertNotSame(a, new KillVM(vms.get(0), ns.get(0), 4, 5)); Assert.assertNotSame(a, new KillVM(vms.get(0), ns.get(0), 3, 4)); Assert.assertNotSame(a, new KillVM(vms.get(0), ns.get(1), 3, 5)); Assert.assertNotSame(a, new KillVM(vms.get(1), ns.get(0), 4, 5)); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } KillVM killVM = (KillVM) o; return Objects.equals(id, killVM.id) && Objects.equals(host, killVM.host); }
KillVM extends Action implements VMStateTransition { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } KillVM killVM = (KillVM) o; return Objects.equals(id, killVM.id) && Objects.equals(host, killVM.host); } }
KillVM extends Action implements VMStateTransition { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } KillVM killVM = (KillVM) o; return Objects.equals(id, killVM.id) && Objects.equals(host, killVM.host); } KillVM(VM vm, Node on, int start, int end); }
KillVM extends Action implements VMStateTransition { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } KillVM killVM = (KillVM) o; return Objects.equals(id, killVM.id) && Objects.equals(host, killVM.host); } KillVM(VM vm, Node on, int start, int end); Node getNode(); @Override VM getVM(); @Override boolean applyAction(Model i); @Override boolean equals(Object o); @Override int hashCode(); @Override String pretty(); @Override VMState getCurrentState(); @Override VMState getNextState(); @Override Object visit(ActionVisitor v); }
KillVM extends Action implements VMStateTransition { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } KillVM killVM = (KillVM) o; return Objects.equals(id, killVM.id) && Objects.equals(host, killVM.host); } KillVM(VM vm, Node on, int start, int end); Node getNode(); @Override VM getVM(); @Override boolean applyAction(Model i); @Override boolean equals(Object o); @Override int hashCode(); @Override String pretty(); @Override VMState getCurrentState(); @Override VMState getNextState(); @Override Object visit(ActionVisitor v);  }