Package org.custommonkey.xmlunit

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


    private void testConverter() throws Exception {
        DOMResult expectedStructureTree = loadExpectedStructureTree();
        DOMResult actualStructureTree = buildActualStructureTree();
        final Diff diff = createDiff(expectedStructureTree, actualStructureTree);
        assertTrue(diff.toString(), diff.identical());
    }

    private DOMResult loadExpectedStructureTree() {
        DOMResult expectedStructureTree = new DOMResult();
        InputStream xslt = getResource("fo2StructureTree.xsl");
View Full Code Here


        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        pipeline.setup(baos);
        pipeline.execute();

        Diff diff = new Diff("<?xml version=\"1.0\" encoding=\"UTF-8\"?><p></p>", new String(baos.toByteArray()));
        assertTrue("XSL transformation didn't work as expected " + diff, diff.identical());
    }

    /**
     * A pipeline that performs a simple transformation: generator -&gt; transformer -&gt;
     * serializer; the transformer uses a compiled XSLT using Xalan xsltc.
View Full Code Here

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        pipeline.setup(baos);
        pipeline.execute();

        Diff diff = new Diff("<?xml version=\"1.0\" encoding=\"UTF-8\"?><p></p>", new String(baos.toByteArray()));
        assertTrue("XSL transformation didn't work as expected " + diff, diff.identical());
    }
}
View Full Code Here

       String actualDocument = new String(baos.toByteArray());

       Diff diff = new Diff(expectedDocument, actualDocument);
       assertTrue("XInclude transformation didn't work as expected " + diff,
               diff.identical());
   }

}
View Full Code Here

        boolean match = false;
        if (lax) {
            match = diff.similar();
        } else {
            match = diff.identical();
        }

        if (match) {
            // pass
            return true;
View Full Code Here

        String old_xml = new StringPuller().pull(xml, getClass());
        SwitchYardModel switchyard = _puller.pull(new StringReader(old_xml));
        String new_xml = switchyard.toString();
        XMLUnit.setIgnoreWhitespace(true);
        Diff diff = XMLUnit.compareXML(old_xml, new_xml);
        Assert.assertTrue(diff.toString(), diff.identical());
    }

    @Test
    public void testValidateContainer() throws Exception {
        doTestValidate(CONTAINER_XML);
View Full Code Here

    res = res.replaceAll("\t", "");
    expResult = expResult.replaceAll("\n", "");
    expResult = expResult.replaceAll("\t", "");
   
    Diff diff = new Diff(expResult.trim(), res);
        if (!diff.identical()) {
          System.out.println("expected:");
          System.out.println(expResult);
          System.out.println("get:");
          System.out.println(res);
          System.out.println(diff.toString());
View Full Code Here

                }
            } else {
                v2.append(serialize((NodeValue) s2.itemAt(0)));
            }
      Diff d = new Diff(v1.toString(), v2.toString());
            boolean identical = d.identical();
            if (!identical) {
                logger.warn("Diff result: " + d.toString());
            }
            result = new BooleanValue(identical);
        } catch (Exception e) {
View Full Code Here

        System.out.println("response XML:"+ responseXML);
        System.out.println("control XML" + XML_RESULT);

         Diff myDiff = new Diff(XML_RESULT, responseXML);
         assertTrue("pieces of XML are similar " + myDiff, myDiff.similar());
         assertTrue("but are they identical? " + myDiff, myDiff.identical());
        
         } catch (Exception e) {
             fail(e.getMessage());
         }
        
View Full Code Here

            System.out.println("response XML:"+ responseXML);
            System.out.println("control XML" + XML_RESULT_XPOINTER);

            Diff myDiff = new Diff(XML_RESULT_XPOINTER, responseXML);
            assertTrue("pieces of XML are similar " + myDiff, myDiff.similar());
            assertTrue("but are they identical? " + myDiff, myDiff.identical());

        } catch (Exception e) {
            fail(e.getMessage());
        }
    }
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.