Package de.danielbechler.diff.mock

Examples of de.danielbechler.diff.mock.ObjectWithNestedObject


  }

  @Test(groups = TestGroups.INTEGRATION)
  public void testThatObjectGraphForAddedObjectsGetsReturned()
  {
    final ObjectWithNestedObject base = new ObjectWithNestedObject("1");
    final ObjectWithNestedObject working = new ObjectWithNestedObject("1", new ObjectWithNestedObject("2", new ObjectWithNestedObject("foo")));
    final ObjectDifferBuilder objectDifferBuilder = ObjectDifferBuilder.startBuilding();
    // final Configuration2 objectDifferBuilder = new Configuration2().withChildrenOfAddedNodes();

    final DiffNode node = objectDifferBuilder.build().compare(working, base);
View Full Code Here


        .hasState(DiffNode.State.CHANGED);
  }

  public void testCompareBeanWithEqualsOnlyValueProviderMethodOnGetObjectPropertyNoChangeInMethodResult()
  {
    final ObjectWithNestedObject forWorking = new ObjectWithNestedObject("childid");
    forWorking.setObject(new ObjectWithNestedObject("grandchildid"));
    final ObjectWithNestedObject forBase = new ObjectWithNestedObject("childid");
    forBase.setObject(new ObjectWithNestedObject("differentgrandchildid"));
    final ObjectWithMethodEqualsOnlyValueProviderMethodOnGetNestedObject working = new ObjectWithMethodEqualsOnlyValueProviderMethodOnGetNestedObject("id", forWorking);
    final ObjectWithMethodEqualsOnlyValueProviderMethodOnGetNestedObject base = new ObjectWithMethodEqualsOnlyValueProviderMethodOnGetNestedObject("id", forBase);

    final DiffNode node = objectDiffer.compare(working, base);
View Full Code Here

    NodeAssertions.assertThat(node).self().hasNoChildren();
  }

  public void testCompareBeanWithEqualsOnlyValueProviderMethodOnGetObjectPropertyWithChangeInMethodResult()
  {
    final ObjectWithNestedObject forWorking = new ObjectWithNestedObject("childid");
    forWorking.setObject(new ObjectWithNestedObject("grandchildid"));
    final ObjectWithNestedObject forBase = new ObjectWithNestedObject("differentchildid");
    forBase.setObject(new ObjectWithNestedObject("differentgrandchildid"));
    final ObjectWithMethodEqualsOnlyValueProviderMethodOnGetNestedObject working = new ObjectWithMethodEqualsOnlyValueProviderMethodOnGetNestedObject("id", forWorking);
    final ObjectWithMethodEqualsOnlyValueProviderMethodOnGetNestedObject base = new ObjectWithMethodEqualsOnlyValueProviderMethodOnGetNestedObject("id", forBase);

    final DiffNode node = objectDiffer.compare(working, base);
View Full Code Here

  }

  @Test
  public void detectsCircularReference_whenEncounteringSameObjectTwice() throws Exception
  {
    final ObjectWithNestedObject object = new ObjectWithNestedObject("foo");
    object.setObject(object);
    final DiffNode node = objectDiffer.compare(object, null);
    NodeAssertions.assertThat(node).child("object").isCircular();
  }
View Full Code Here

  }

  @Test
  public void detectsCircularReference_whenEncounteringDifferentButEqualObjectsTwice() throws Exception
  {
    final ObjectWithNestedObject object = new ObjectWithNestedObject("foo", new ObjectWithNestedObject("foo"));
    final DiffNode node = objectDiffer.compare(object, null);
    NodeAssertions.assertThat(node).child("object").isCircular();
  }
View Full Code Here

  }

  @Test
  public void detectsCircularReference_whenEncounteringSameObjectTwice() throws Exception
  {
    final ObjectWithNestedObject object = new ObjectWithNestedObject("foo");
    object.setObject(object);
    final DiffNode node = objectDiffer.compare(object, null);
    NodeAssertions.assertThat(node).child("object").isCircular();
  }
View Full Code Here

  }

  @Test
  public void detectsNoCircularReference_whenEncounteringDifferentButEqualObjectsTwice() throws Exception
  {
    final ObjectWithNestedObject object = new ObjectWithNestedObject("foo", new ObjectWithNestedObject("foo"));
    final DiffNode node = objectDiffer.compare(object, null);
    NodeAssertions.assertThat(node).child("object").hasState(DiffNode.State.ADDED);
  }
View Full Code Here

TOP

Related Classes of de.danielbechler.diff.mock.ObjectWithNestedObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.