Package de.danielbechler.diff.node

Examples of de.danielbechler.diff.node.PrintingVisitor


  {
    final Person bruceWayne = new Person("Bruce", "Wayne");
    final Person batman = new Person("Batman", null);
    final DiffNode rootNode = ObjectDifferBuilder.buildDefault().compare(batman, bruceWayne);
    rootNode.visit(new NodeHierarchyVisitor(10));
    rootNode.visit(new PrintingVisitor(batman, bruceWayne)
    {
      @Override
      protected boolean filter(final DiffNode node)
      {
        return true;
View Full Code Here


    // (Option 1) Causes the ObjectDiffer to ignore the 'password' property of the root object
    builder.inclusion().exclude().node(NodePath.with("password"));

    final DiffNode node = builder.build().compare(working, base);

    node.visit(new PrintingVisitor(working, base));

    // Output with ignore: Property at path '/' has not changed
    // Output without ignore: Property at path '/password' has changed from [ 1234 ] to [ 9876 ]
  }
View Full Code Here

        .ofNode(NodePath.with("prop"))
        .toUseEqualsMethodOfValueProvidedByMethod("getProp1");

    final DiffNode node = builder.build().compare(working, base);

    node.visit(new PrintingVisitor(working, base));

    // Output with ignore:
    //  Property at path '/' has not changed
    // Output without ignore:
    // Property at path '/prop/prop2' has changed from [ 2 ] to [ 3 ]
View Full Code Here

    final NodePath nodePath = NodePath.with("reference", "reference");

    // verify that the node can be found when it's not excluded
    ObjectDiffer objectDiffer = ObjectDifferBuilder.startBuilding().build();
    final DiffNode verification = objectDiffer.compare(obj1, modifiedObj1);
    verification.visit(new PrintingVisitor(obj1, modifiedObj1));
    assertThat(verification).child(nodePath).hasState(DiffNode.State.CHANGED).hasChildren(1);

    // verify that the node can't be found, when it's excluded
    final ObjectDifferBuilder objectDifferBuilder = ObjectDifferBuilder.startBuilding();
    objectDifferBuilder.inclusion().exclude().node(nodePath);
    objectDiffer = objectDifferBuilder.build();
    final DiffNode node = objectDiffer.compare(obj1, modifiedObj1);
    node.visit(new PrintingVisitor(obj1, modifiedObj1));
    assertThat(node).child(nodePath).doesNotExist();
  }
View Full Code Here

    baseC.setReference(baseA);

    final ObjectDiffer objectDiffer = ObjectDifferBuilder.buildDefault();
//    objectDiffer.getConfiguration().withoutCircularNodes();
    final DiffNode root = objectDiffer.compare(workingA, baseA);
    root.visit(new PrintingVisitor(workingA, baseA));
    assertThat(root).child("reference", "reference", "reference").isCircular();
  }
View Full Code Here

    final String working = "Hello";
    final String base = "World";
    final DiffNode root = objectDiffer.compare(working, base);

    root.visit(new PrintingVisitor(working, base));
  }
View Full Code Here

    modifiedPhoneBook.getContact("Jesse", "Pinkman").setMiddleName("Bruce");
    modifiedPhoneBook.getContact("Walter", "White").setMiddleName("Hartwell");

    final ObjectDiffer objectDiffer = ObjectDifferBuilder.buildDefault();
    final DiffNode root = objectDiffer.compare(modifiedPhoneBook, phoneBook);
    final DiffNode.Visitor visitor = new PrintingVisitor(modifiedPhoneBook, phoneBook);
    root.visit(visitor);
  }
View Full Code Here

    final ObjectDifferBuilder builder = ObjectDifferBuilder.startBuilding();
    builder.inclusion().include().node(NodePath.with("aliases"));
    final ObjectDiffer differ = builder.build();

    final DiffNode root = differ.compare(b, a);
    root.visit(new PrintingVisitor(b, a));

    NodeAssertions.assertThat(root).root().hasChanges();
  }
View Full Code Here

    base.setValue(1);

    ObjectDiffer differ = ObjectDifferBuilder.buildDefault();
    final DiffNode root = differ.compare(working, base);

    root.visit(new PrintingVisitor(working, base));
  }
View Full Code Here

    base.setValue(1);

    ObjectDiffer differ = ObjectDifferBuilder.buildDefault();
    final DiffNode root = differ.compare(working, base);

    root.visit(new PrintingVisitor(working, base));
  }
View Full Code Here

TOP

Related Classes of de.danielbechler.diff.node.PrintingVisitor

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.