Package org.custommonkey.xmlunit

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


        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


            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

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

        Diff diff = compareXML(expected, actual);

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

    /**
     * Assert that the result of an XML comparison is identical.
     *
 
View Full Code Here

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

        Diff diff = compareXML(expected, actual);

        assertEquals(msg + ", " + diff.toString(), true, diff.similar());
    }

    /**
     * Assert that the result of an XML comparison is similar.
     *
 
View Full Code Here

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

        Diff diff = compareXML(expected, actual);

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

    /**
     * Assert that the result of an XML comparison is identical.
     *
 
View Full Code Here

            @Override
            public void skippedComparison(Node node, Node node1) {
                // no-op
            }
        });
        assertTrue("Files are not similar", myDiff.similar());
    }

    private <T> void unmarshalAndMarshal(Class<T> type, java.lang.String xmlFileName, java.lang.String expectedFile) throws Exception {

        Object object = JaxbOpenejbJar2.unmarshal(type, getInputStream(xmlFileName));
View Full Code Here

            isr = new InputStreamReader(IO.read(getClass().getClassLoader().getResource(expectedFile)));
            final org.w3c.dom.Document actualDoc = XMLUnit.buildDocument(XMLUnit.newTestParser(), new StringReader(actual));
            final org.w3c.dom.Document expectedDoc = XMLUnit.buildDocument(XMLUnit.newControlParser(), isr);

            Diff myDiff = new Diff(expectedDoc, actualDoc);
            assertTrue("Files are similar " + myDiff, myDiff.similar());
        } finally {
            XMLUnit.setNormalizeWhitespace(nw);
            XMLUnit.setNormalize(n);

            if(null != isr){
View Full Code Here

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

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

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


        XMLUnit.setIgnoreWhitespace(true);
        try {
            Diff myDiff = new DetailedDiff(new Diff(expected, result));
            assertTrue("Files are not similar " + myDiff, myDiff.similar());
        } catch (AssertionFailedError e) {
            assertEquals(expected, result);
            throw e;
        }
    }
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.