@Test
public final void testEquality() {
ParallelTask task1 = new ReferenceTask();
VMWrapper wrapper1Task1 = new VMWrapper(task1);
VMWrapper wrapper2Task1 = new VMWrapper(task1);
VMWrapper wrapper1Task2 = new VMWrapper(new ParallelTask() {
@Override
public AbstractReturnType<?> call() {
return null; // Don't do anything.
}
});
/* Test various equality comparisons to ensure equals() works. */
assertTrue("Same wrapper objects different.",
wrapper1Task1.equals(wrapper1Task1));
assertTrue("Same task wrappers different.",
wrapper1Task1.equals(wrapper2Task1));
assertTrue("Same task wrappers different reveresed.",
wrapper2Task1.equals(wrapper1Task1));
assertFalse("Different task wrappers equal.",
wrapper1Task2.equals(wrapper1Task1));
assertFalse("Different task wrappers equal reveresed.",
wrapper1Task1.equals(wrapper1Task2));
}