Examples of similar()


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

        marshaller.marshal(element, baos);

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

        Diff myDiff = new Diff(expected, actual);
        assertTrue("Files are similar " + myDiff, myDiff.similar());
    }

    private java.lang.String readContent(InputStream in) throws IOException {
        StringBuffer sb = new StringBuffer();
        in = new BufferedInputStream(in);
View Full Code Here

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

        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

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

        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

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

        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

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

    @Test
    public void testParse() throws Exception {
        String xml = convertToXml(JSON);
        Diff diff = XMLUnit.compareXML(XML, xml);
        assertTrue(diff.toString(), diff.similar());
    }

    @Test
    public void testParseArray() throws Exception {
        String xml = convertToXml("[{\"name\":\"smith\"},{\"skill\":\"java\"}]", new JsonXmlReader(null, false, "elem"));
View Full Code Here

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

    @Test
    public void testParseArray() throws Exception {
        String xml = convertToXml("[{\"name\":\"smith\"},{\"skill\":\"java\"}]", new JsonXmlReader(null, false, "elem"));
        Diff diff = XMLUnit.compareXML("<elem><elem><name>smith</name></elem><elem><skill>java</skill></elem></elem>", xml);
        assertTrue(diff.toString(), diff.similar());
    }

    @Test
    public void testParseArrayOfObjects() throws Exception {
        String xml = convertToXml("{\"equipments\":[{\"type\":\"charger\",\"cost\":\"1$\"},{\"type\":\"battery\",\"cost\":\"2$\"}]}", new JsonXmlReader());
View Full Code Here

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

                "      <equipments>\n" +
                "         <type>battery</type>\n" +
                "         <cost>2$</cost>\n" +
                "      </equipments>\n" +
                "   </equipments>", xml);
        assertTrue(diff.toString(), diff.similar());
    }

    @Test
    public void testParseSimple() throws Exception {
        String xml = convertToXml("1", new JsonXmlReader(null, false, "elem"));
View Full Code Here

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

    @Test
    public void testParseSimple() throws Exception {
        String xml = convertToXml("1", new JsonXmlReader(null, false, "elem"));
        Diff diff = XMLUnit.compareXML("<elem>1</elem>", xml);
        assertTrue(diff.toString(), diff.similar());
    }

    @Test(expected = ParserException.class)
    public void testParseSimpleNoRoot() throws Exception {
        ContentHandler contentHandler = mock(ContentHandler.class);
View Full Code Here

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

    @Test
    public void testParseNamespace() throws Exception {
        String xml = convertToXml(JSON, new JsonXmlReader("http://javacrumbs.net/test"));
        String xmlWithNamespace = XML.replace("<document>", "<document xmlns=\"http://javacrumbs.net/test\">");
        Diff diff = XMLUnit.compareXML(xmlWithNamespace, xml);
        assertTrue(diff.toString(), diff.similar());
    }

    @Test
    public void testParseNamespaceWithAttributes() throws Exception {
        String xml = convertToXml(JSON, new JsonXmlReader("http://javacrumbs.net/test", true));
View Full Code Here

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

    @Test
    public void testParseNamespaceWithAttributes() throws Exception {
        String xml = convertToXml(JSON, new JsonXmlReader("http://javacrumbs.net/test", true));
        Diff diff = XMLUnit.compareXML(XML_WITH_TYPES, xml);
        assertTrue(diff.toString(), diff.similar());
    }

    @Test
    public void testParseMultipleRootsArtificialRoot() throws Exception {
        String xml = convertToXml("{\"a\":1, \"b\":2}", new JsonXmlReader(null, false, "artificialRoot"));
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.