Examples of DifferenceListener


Examples of org.custommonkey.xmlunit.DifferenceListener

  public static List<Difference> getDifferences(String controlDom, String testDom,
          final List<String> ignoreAttributes) {
    try {
      Diff d = new Diff(Helper.getDocument(controlDom), Helper.getDocument(testDom));
      DetailedDiff dd = new DetailedDiff(d);
      dd.overrideDifferenceListener(new DifferenceListener() {

        @Override
        public void skippedComparison(Node control, Node test) {
        }
View Full Code Here

Examples of org.custommonkey.xmlunit.DifferenceListener

        return type + " matches content for [" + path + "]";
    }

    private void compareValues(String expandedContent, String expandedValue) throws Exception {
        Diff diff = new Diff(expandedContent, expandedValue);
        diff.overrideDifferenceListener(new DifferenceListener() {

            public int differenceFound(Difference diff) {
                if (allowWildcards
                        && (diff.getId() == DifferenceEngine.TEXT_VALUE.getId() || diff.getId() == DifferenceEngine.ATTR_VALUE
                        .getId())) {
View Full Code Here

Examples of org.custommonkey.xmlunit.DifferenceListener

               Diff diff = XMLUnit.compareXML(Strings2.toString(a.getPayload()), Strings2
                        .toString(b.getPayload()));

               // Ignoring whitespace in elements that have other children, xsi:schemaLocation and
               // differences in namespace prefixes
               diff.overrideDifferenceListener(new DifferenceListener() {
                  @Override
                  public int differenceFound(Difference diff) {
                     if (diff.getId() == DifferenceConstants.SCHEMA_LOCATION_ID
                              || diff.getId() == DifferenceConstants.NAMESPACE_PREFIX_ID) {
                        return RETURN_IGNORE_DIFFERENCE_NODES_IDENTICAL;
View Full Code Here

Examples of org.custommonkey.xmlunit.DifferenceListener

  public static List<Difference> getDifferences(String controlDom, String testDom,
          final List<String> ignoreAttributes) {
    try {
      Diff d = new Diff(Helper.getDocument(controlDom), Helper.getDocument(testDom));
      DetailedDiff dd = new DetailedDiff(d);
      dd.overrideDifferenceListener(new DifferenceListener() {

        @Override
        public void skippedComparison(Node control, Node test) {
        }
View Full Code Here

Examples of org.custommonkey.xmlunit.DifferenceListener

    private void compareDocument(String original, Document converted) throws Exception {
        compareRootNodes(converted, getMessageDocument(original));
    }

    private void compareRootNodes(Document doc1, Document doc2) throws Exception {
        DifferenceListener myDifferenceListener = new DifferenceListener() {
            public int differenceFound(Difference difference) {
                if(difference.getDescription().contains("namespace")) {
                    // we are converting the name spaces, so those should be different.
                    return RETURN_IGNORE_DIFFERENCE_NODES_IDENTICAL;
                }
View Full Code Here

Examples of org.custommonkey.xmlunit.DifferenceListener

        try {
            XMLUnit.setIgnoreAttributeOrder(true);
            XMLUnit.setIgnoreComments(true);
            XMLUnit.setIgnoreWhitespace(true);
            difference = new Diff(xmlDocument,expectedXML);
            difference.overrideDifferenceListener(new DifferenceListener() {
                @Override
                public int differenceFound(Difference difference) {
                    if (excludedNodes.contains(difference.getControlNodeDetail().getNode().getLocalName()))
                        return 1;
                    else {
View Full Code Here

Examples of org.custommonkey.xmlunit.DifferenceListener

  public static List<Difference> getDifferences(String controlDom, String testDom,
          final List<String> ignoreAttributes) {
    try {
      Diff d = new Diff(Helper.getDocument(controlDom), Helper.getDocument(testDom));
      DetailedDiff dd = new DetailedDiff(d);
      dd.overrideDifferenceListener(new DifferenceListener() {

        @Override
        public void skippedComparison(Node control, Node test) {
        }
View Full Code Here

Examples of org.custommonkey.xmlunit.DifferenceListener

        String result = JaxbOpenejbJar2.marshal(GeronimoEjbJarType.class, root);
        String expected = readContent(getInputStream("geronimo-openejb-converted.xml"));

        Diff myDiff = new DetailedDiff(new Diff(expected, result));
        final AtomicInteger differenceNumber = new AtomicInteger(0); // just to get an int wrapper for the test
        myDiff.overrideDifferenceListener(new DifferenceListener() {
            @Override
            public int differenceFound(Difference difference) {
                if (!difference.isRecoverable()) {
                    differenceNumber.incrementAndGet();
                    System.err.println(">>> " + difference.toString());
View Full Code Here

Examples of org.custommonkey.xmlunit.DifferenceListener

               Diff diff = XMLUnit.compareXML(Strings2.toStringAndClose(a.getPayload().openStream()),
                        Strings2.toStringAndClose(b.getPayload().openStream()));

               // Ignoring whitespace in elements that have other children, xsi:schemaLocation and
               // differences in namespace prefixes
               diff.overrideDifferenceListener(new DifferenceListener() {
                  @Override
                  public int differenceFound(Difference diff) {
                     if (diff.getId() == DifferenceConstants.SCHEMA_LOCATION_ID
                              || diff.getId() == DifferenceConstants.NAMESPACE_PREFIX_ID) {
                        return RETURN_IGNORE_DIFFERENCE_NODES_IDENTICAL;
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.