Package org.custommonkey.xmlunit

Examples of org.custommonkey.xmlunit.Diff.overrideDifferenceListener()


        SwitchYardModel fragment_switchyard = _puller.pull(FRAGMENT_XML, getClass());
        SwitchYardModel merged_switchyard = Models.merge(fragment_switchyard, incomplete_switchyard);
        XMLUnit.setIgnoreWhitespace(true);
        SwitchYardModel complete_switchyard = _puller.pull(COMPLETE_XML, getClass());
        Diff diff = XMLUnit.compareXML(complete_switchyard.toString(), merged_switchyard.toString());
        diff.overrideDifferenceListener(new SchemaLocationDifferenceListener());
        Assert.assertTrue(diff.toString(), diff.identical());
    }

    @Test
    public void testReadComplete() throws Exception {
View Full Code Here


    String strExpected = getString(expectedRspElm);
    String strResult = getString(result);
    XMLUnit.setIgnoreComments(true);
    Diff diff = new Diff(strExpected, strResult);
    if (differenceListener != null) {
      diff.overrideDifferenceListener(differenceListener);
    }
    assertXMLEqual("comparing test xml to control xml", diff, true);
  }

  /**
 
View Full Code Here

               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

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

        final 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(final Difference difference) {
                if (!difference.isRecoverable()) {
                    differenceNumber.incrementAndGet();
                    System.err.println(">>> " + difference.toString());
View Full Code Here

        final Diff diff = new Diff(expected.trim(), result.trim());
        final Diff myDiff = new DetailedDiff(diff);

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

        // Elment and attributes in the xcas could be in different
        // Ordering
        // Match on the id attribute are the same
        // myDiff.overrideElementQualifier(new
        // ElementNameAndAttributeQualifier("id"));
        myDiff.overrideDifferenceListener(new IgnoreTextAndAttributeValuesDifferenceListener());
        assertTrue("Verifying Test Output: " + file.getName() + myDiff,
            myDiff.similar());
      }
    }
  }
View Full Code Here

        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

               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

        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

      marshaller.marshal(unmarshaller.unmarshal(xmlTestFile), writer);

      Diff xmlDiff = new Diff(IOUtils.toString(xmlTestFile), writer.toString());

      // This listener ignores text nodes that differ only by leading/trailing whitespace:
      xmlDiff.overrideDifferenceListener(new DifferenceListener() {

        public int differenceFound(Difference difference) {
          if (difference.getId() == DifferenceConstants.TEXT_VALUE_ID
                      && difference.getControlNodeDetail().getValue().trim()
                                  .equals(difference.getTestNodeDetail().getValue().trim())) {
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.