public void testDeepEqualsForDifferentPeriodSets() throws Exception { Period p1 = setGridId("G-P1", createPeriod("P1", 4, 7, 1)); Period p2_0 = setGridId("G-P2", createPeriod("P2", 4, 7, 1)); Period p2_1 = setGridId("G-P2", createPeriod("P2", 4, 11, 1)); StudySegment s1 = createNamedInstance("S1", StudySegment.class); StudySegment s2 = createNamedInstance("S1", StudySegment.class); s1.addPeriod(p1); s1.addPeriod(p2_0); s2.addPeriod(p2_1); Differences actual = s1.deepEquals(s2); assertDifferences(actual, "missing period G-P1"); assertChildDifferences( actual, new String[] {"period G-P2", "duration"}, "quantity does not match: 7 != 11"); }
public void testDeepEqualsForDifferentName() throws Exception { StudySegment s1 = createNamedInstance("S1", StudySegment.class); StudySegment s2 = createNamedInstance("S2", StudySegment.class); assertDifferences(s1.deepEquals(s2), "name \"S1\" does not match \"S2\""); }