Examples of DiffNode


Examples of de.danielbechler.diff.node.DiffNode

    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);

    NodeAssertions.assertThat(node).self().hasState(DiffNode.State.CHANGED);
    assertThat(node)
        .child(NodePath.with("object"))
        .hasState(DiffNode.State.CHANGED);
View Full Code Here

Examples of de.danielbechler.diff.node.DiffNode

    final Map<String, String> forBase = new HashMap<String, String>();
    forBase.put("keyone", "valone");
    final ObjectWithMethodEqualsOnlyValueProviderMethodOnGetMap working = new ObjectWithMethodEqualsOnlyValueProviderMethodOnGetMap(forWorking);
    final ObjectWithMethodEqualsOnlyValueProviderMethodOnGetMap base = new ObjectWithMethodEqualsOnlyValueProviderMethodOnGetMap(forBase);

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

    NodeAssertions.assertThat(node).self().hasState(DiffNode.State.UNTOUCHED);
    NodeAssertions.assertThat(node).self().hasNoChildren();
  }
View Full Code Here

Examples of de.danielbechler.diff.node.DiffNode

    final Map<String, String> forBase = new HashMap<String, String>();
    forBase.put("keyone", "valone");
    final ObjectWithMethodEqualsOnlyValueProviderMethodOnGetMap working = new ObjectWithMethodEqualsOnlyValueProviderMethodOnGetMap(forWorking);
    final ObjectWithMethodEqualsOnlyValueProviderMethodOnGetMap base = new ObjectWithMethodEqualsOnlyValueProviderMethodOnGetMap(forBase);

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

    NodeAssertions.assertThat(node).self().hasState(DiffNode.State.CHANGED);
    assertThat(node)
        .child(NodePath.with("map"))
        .hasState(DiffNode.State.CHANGED);
View Full Code Here

Examples of de.danielbechler.diff.node.DiffNode

    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

Examples of de.danielbechler.diff.node.DiffNode

    final Map<String, ObjectWithString> working = Collections.singletonMap("foo", new ObjectWithString("bar"));

    final ObjectDifferBuilder objectDifferBuilder = ObjectDifferBuilder.startBuilding();
    final ObjectDiffer differ = objectDifferBuilder.build();

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

    node.visit(new NodeHierarchyVisitor());

    assertThat(node).child(NodePath.startBuilding()
        .mapKey("foo")).hasState(DiffNode.State.ADDED);

    assertThat(node).child(NodePath.startBuilding()
View Full Code Here

Examples of de.danielbechler.diff.node.DiffNode

  public void detects_change_from_null_to_object_referenct_as_addition() throws Exception
  {
    final ObjectWithString base = new ObjectWithString();
    final ObjectWithString working = new ObjectWithString("foo");

    final DiffNode node = ObjectDifferBuilder.buildDefault().compare(working, base);

    assertThat(node).child("value").hasState(DiffNode.State.ADDED);
  }
View Full Code Here

Examples of org.broadinstitute.gatk.engine.walkers.diffengine.DiffNode

        Assert.assertNotNull(diff);

        Assert.assertEquals(diff.getName(), vcfFile.getName());
        Assert.assertSame(diff.getParent(), DiffElement.ROOT);

        DiffNode node = diff.getValueAsNode();
        Assert.assertEquals(node.getElements().size(), 11);

        // chr1    2646    rs62635284      G       A       0.15    PASS    AC=2;AF=1.00;AN=2       GT:AD:DP:GL:GQ  1/1:53,75:3:-12.40,-0.90,-0.00:9.03
        DiffNode rec1 = node.getElement("chr1:2646").getValueAsNode();
        testLeaf(rec1, "CHROM", "chr1");
        testLeaf(rec1, "POS", 2646);
        testLeaf(rec1, "ID", "rs62635284");
        testLeaf(rec1, "REF", Allele.create("G", true));
        testLeaf(rec1, "ALT", Arrays.asList(Allele.create("A")));
View Full Code Here

Examples of org.broadinstitute.gatk.engine.walkers.diffengine.DiffNode

        Assert.assertNotNull(diff);

        Assert.assertEquals(diff.getName(), bamFile.getName());
        Assert.assertSame(diff.getParent(), DiffElement.ROOT);

        DiffNode node = diff.getValueAsNode();
        Assert.assertEquals(node.getElements().size(), 33);

        // 30PPJAAXX090125:1:42:512:1817#0 99      chr1    200     0       76M     =
        // 255     -130    ACCCTAACCCTAACCCTAACCCTAACCATAACCCTAAGACTAACCCTAAACCTAACCCTCATAATCGAAATACAAC
        // BBBBC@C?AABCBB<63>=B@>+B9-9+)2B8,+@327B5A>90((>-+''3?(/'''A)(''19('7.,**%)3:
        // PG:Z:0  RG:Z:exampleBAM.bam     SM:Z:exampleBAM.bam

        DiffNode rec1 = node.getElement("30PPJAAXX090125:1:42:512:1817#0_1").getValueAsNode();
        testLeaf(rec1, "NAME", "30PPJAAXX090125:1:42:512:1817#0");
        testLeaf(rec1, "FLAGS", 99);
        testLeaf(rec1, "RNAME", "chr1");
        testLeaf(rec1, "POS", 200);
        testLeaf(rec1, "MAPQ", 0);
View Full Code Here

Examples of org.eclipse.compare.structuremergeviewer.DiffNode

            return super.compare(viewer, e1, e2);
        }

        private ErlNode getErlNode(final Object e) {
            if (e instanceof DiffNode) {
                final DiffNode d = (DiffNode) e;
                final ITypedElement left = d.getLeft();
                if (left instanceof ErlNode) {
                    return (ErlNode) left;
                }
                final ITypedElement right = d.getRight();
                if (right instanceof ErlNode) {
                    return (ErlNode) right;
                }
            }
            return null;
View Full Code Here

Examples of org.eclipse.compare.structuremergeviewer.DiffNode

          throw new InvocationTargetException(
              new IllegalStateException(
                  UIText.GitCompareEditorInput_ResourcesInDifferentReposMessagge));
        String repoRelativePath = map.getRepoRelativePath(resource);
        filterPathStrings.add(repoRelativePath);
        DiffNode node = new DiffNode(Differencer.NO_CHANGE) {
          @Override
          public Image getImage() {
            return FOLDER_IMAGE;
          }
        };
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.