コード例 #1
0
  @Test
  public void testNullNull() throws Exception {
    Zentity lhs = null;
    Zentity rhs = null;

    assertFalse(comparator.isDifferent(lhs, rhs));
  }
コード例 #2
0
  @Test
  public void testNullRhs() throws Exception {
    Zentity lhs = new Zentity();
    Zentity rhs = null;

    assertTrue(comparator.isDifferent(lhs, rhs));
  }
コード例 #3
0
  @Test
  public void testTimestampDiffersLhsNull() throws Exception {
    Zentity lhs = new Zentity();
    Zentity rhs = new Zentity();

    lhs.setSqlTimestamp(null);
    rhs.setSqlTimestamp(new Timestamp(123123124L));

    assertTrue(comparator.isDifferent(lhs, rhs));
  }
コード例 #4
0
  @Test
  public void testBoxedIntegerDiffersRhsNull() throws Exception {
    Zentity lhs = new Zentity();
    Zentity rhs = new Zentity();

    lhs.setBoxedInt(4433);
    rhs.setBoxedInt(null);

    assertTrue(comparator.isDifferent(lhs, rhs));
  }
コード例 #5
0
  @Test
  public void testBoxedIntegerDiffers() throws Exception {
    Zentity lhs = new Zentity();
    Zentity rhs = new Zentity();

    lhs.setBoxedInt(1234);
    rhs.setBoxedInt(4321);

    assertTrue(comparator.isDifferent(lhs, rhs));
  }
コード例 #6
0
  @Test
  public void testPrimitiveBooleanDiffers() throws Exception {
    Zentity lhs = new Zentity();
    Zentity rhs = new Zentity();

    lhs.setPrimitiveBool(true);
    rhs.setPrimitiveBool(false);

    assertTrue(comparator.isDifferent(lhs, rhs));
  }
コード例 #7
0
  @Test
  public void testCompareNestedEntitiesChildCountsDiffer() throws Exception {
    ParentEntity lhs = new ParentEntity();
    ParentEntity rhs = new ParentEntity();

    lhs.getChildren().add(new ChildEntity("a string", 43));
    lhs.getChildren().add(new ChildEntity("another string", 42));

    rhs.getChildren().add(new ChildEntity("a string", 43));

    assertTrue(comparator.isDifferent(lhs, rhs));
  }