Examples of Diff


Examples of org.custommonkey.xmlunit.Diff

  public final void assertEqual(Document expected, Document actual)
  {
    expected.getDocumentElement().normalize();
    actual.getDocumentElement().normalize();

    Diff diff = compareXML(expected, actual);

    if (!diff.similar())
    {
      try
      {
        System.out.println("expected:");
        print(expected);
        System.out.println("actual:");
        print(actual);
      }
      catch (Exception e)
      {
        e.printStackTrace();
      }
    }

    assertEquals("Test if the assertion document is equal, "+diff.toString(), true, diff.similar());
  }
View Full Code Here

Examples of org.custommonkey.xmlunit.Diff

            iterator.next();
            nsCount++;
        }
        assertTrue(nsCount == 2);
   
        Diff diff = XMLUnit.compareXML(expectedXML, omElement.toString());
        XMLAssert.assertXMLEqual(diff, true);
    }
View Full Code Here

Examples of org.custommonkey.xmlunit.Diff

    wrapper.pageable = pageable;
    wrapper.sort = sort;
    wrapper.pageableWithoutSort = new PageRequest(10, 20);
    marshaller.marshal(wrapper, writer);

    assertThat(new Diff(reference, writer.toString()).similar(), is(true));
  }
View Full Code Here

Examples of org.custommonkey.xmlunit.Diff

        }
        Assert.assertFalse("The XML message has encrypted data.", hasEncryptedData(inDoc));
       
        // verify that the decrypted message matches what was sent
        Document fragmentDoc = createDocumentfromInputStream(new ByteArrayInputStream(fragment.getBytes()), context);
        Diff xmlDiff = XMLUnit.compareXML(fragmentDoc, inDoc);
       
        Assert.assertTrue("The decrypted document does not match the control document.", xmlDiff.identical());           
    }
View Full Code Here

Examples of org.custommonkey.xmlunit.Diff

        XMLUnit.setNormalizeWhitespace(true);
        XMLUnit.setIgnoreDiffBetweenTextAndCDATA(true);
        XMLUnit.setIgnoreWhitespace(true);
        XMLUnit.setIgnoreComments(true);

        Diff xmlDiff = new Diff(new InputStreamReader(expectedPageCode), new StringReader(pageCode));
        xmlDiff.overrideDifferenceListener(getDifferenceListener());

        if (!xmlDiff.similar()) {
            System.out.println("=== ACTUAL PAGE CODE ===");
            System.out.println(pageCode);
            System.out.println("======== ERROR =========");
            System.out.println(xmlDiff.toString());
            System.out.println("========================");
            fail("XML was not similar:" + xmlDiff.toString());
        }
    }
View Full Code Here

Examples of org.custommonkey.xmlunit.Diff

    }

    private void assertXMLEqual(String expectedXml,
                                String resultXml) {
        try {
            Diff diff = new Diff( expectedXml,
                                  resultXml );
            diff.overrideElementQualifier( new RecursiveElementNameAndTextQualifier() );
            XMLAssert.assertXMLEqual( diff,
                                      true );
        } catch ( Exception e ) {
            throw new RuntimeException( "XML Assertion failure",
                                        e );
View Full Code Here

Examples of org.custommonkey.xmlunit.Diff

        // compare the results to the expected results
        if (expectedFileName != null) {
            in = getClass().getClassLoader().getResourceAsStream(expectedFileName);
            String expected = readContent(in);
            String actual = toString(appModule.getCmpMappings());
            Diff myDiff = new Diff(expected, actual);
            assertTrue("Files are similar " + myDiff, myDiff.similar());
        }
        return appModule.getCmpMappings();
    }
View Full Code Here

Examples of org.custommonkey.xmlunit.Diff

            }
            String actual = toString(cmpMappings);

            XMLUnit.setIgnoreWhitespace(true);
            try {
                Diff myDiff = new DetailedDiff(new Diff(expected, actual));
                assertTrue("Files are not similar " + myDiff, myDiff.similar());
            } catch (AssertionFailedError e) {
                assertEquals(expected, actual);
            }
        }
View Full Code Here

Examples of org.custommonkey.xmlunit.Diff

    public final void assertIdentical(String msg, Document expected, Document actual) {

        expected.getDocumentElement().normalize();
        actual.getDocumentElement().normalize();

        Diff diff = compareXML(expected, actual);

        assertEquals(msg + ", " + diff.toString(), true, diff.identical());
    }
View Full Code Here

Examples of org.custommonkey.xmlunit.Diff

    public final void assertIdentical(Document expected, Document actual) {

        expected.getDocumentElement().normalize();
        actual.getDocumentElement().normalize();

        Diff diff = compareXML(expected, actual);

        assertEquals("Test if the assertion document is equal, " + diff.toString(), true, diff.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.