Example #1
0
  public void testMergeWithEquivalentRemovePresent() throws Exception {
    Remove expectedRemove = Remove.create(ssb);
    delta.addChange(expectedRemove);

    remove.setChild(ssb);
    remove.mergeInto(delta, NOW);

    assertEquals("Duplicate remove should not have been added", 1, delta.getChanges().size());
    assertEquals(expectedRemove, delta.getChanges().get(0));
  }
Example #2
0
 public void testEqualsWhenRemoveHasDifferentChild() throws Exception {
   Remove remove1 = Remove.create(createNamedInstance("Epoch1", Epoch.class));
   Remove remove2 = Remove.create(createNamedInstance("Segment2", StudySegment.class));
   assertNotEquals("Removes are equals", remove1, remove2);
 }
Example #3
0
  public void testDeepEqualsWhenRemoveHasDifferentChild() throws Exception {
    Remove remove1 = Remove.create(setGridId("e1", Epoch.create("E1")));
    Remove remove2 = Remove.create(setGridId("e2", Epoch.create("E2")));

    assertDifferences(remove1.deepEquals(remove2), "for different child");
  }
Example #4
0
 public void testEqualsWhenRemoveHasSameChild() throws Exception {
   Remove remove1 = Remove.create(createNamedInstance("Segment1", StudySegment.class));
   Remove remove2 = Remove.create(createNamedInstance("Segment1", StudySegment.class));
   assertEquals("Removes are not equals", remove1, remove2);
 }