Package org.custommonkey.xmlunit

Examples of org.custommonkey.xmlunit.Difference


        XMLUnit.setIgnoreWhitespace(true);
        try {
            DetailedDiff diffs = new DetailedDiff(XMLUnit.compareXML(expected, StubbedChannel.getOutput()));
            List allDiffs = diffs.getAllDifferences();
            assertEquals("Only expected 1 difference", 1, allDiffs.size());
            Difference diff = (Difference) allDiffs.get(0);
            String expectedDiffPath = "/Envelope[1]/Body[1]/Fault[1]/detail[1]/Exception[1]/text()[1]";
            assertEquals("Expected difference to be at " + expectedDiffPath, expectedDiffPath, diff.getTestNodeDetail()
                .getXpathLocation());
            String expectedText = diff.getControlNodeDetail().getValue();
            String actualText = diff.getTestNodeDetail().getValue();
            assertTrue("Expected <Exception> element text to start with " + expectedText, actualText
                .startsWith(expectedText));
            String methodName = "testSendFaultOnExceptionWithStackTrace";
            assertTrue("Expected <Exception> element text to include " + methodName + " in stack trace", actualText
                .indexOf(methodName) != -1);
View Full Code Here

TOP

Related Classes of org.custommonkey.xmlunit.Difference

Copyright © 2018 www.massapicom. 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.