Examples of XMLComparator


Examples of org.apache.axis2.om.impl.llom.util.XMLComparator

        msgCtxt.setMessageInformationHeaders(mIHeaders);
        msgCtxt.setEnvelope(
                OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope());
        outHandler.invoke(msgCtxt);

        XMLComparator xmlComparator = new XMLComparator();
        assertTrue(
                xmlComparator.compare(msgCtxt.getEnvelope(),
                        testUtil.getOMBuilder("OutHandlerTest.xml")
                .getDocumentElement()));
    }
View Full Code Here

Examples of org.apache.axis2.om.impl.llom.util.XMLComparator

        super.setUp();
    }

    public void testCompare() throws Exception {
        StAXSOAPModelBuilder omBuilder = getOMBuilder("");
        XMLComparator xmlComparator = new XMLComparator();
        assertTrue(
                xmlComparator.compare(omBuilder.getDocumentElement(),
                        omBuilder.getDocumentElement()));


    }
View Full Code Here

Examples of org.apache.sis.test.XMLComparator

     *
     * @throws Exception Should never happen.
     */
    @Test
    public void testIgnore() throws Exception {
        final XMLComparator cmp = new XMLComparator(
            "<body>\n" +
            "  <form id=\"MyForm\">\n" +
            "    <table cellpading=\"1\">\n" +
            "      <tr><td>foo</td></tr>\n" +
            "    </table>\n" +
            "  </form>\n" +
            "</body>",
            "<body>\n" +
            "  <form id=\"MyForm\">\n" +
            "    <table cellpading=\"2\">\n" +
            "      <tr><td>foo</td></tr>\n" +
            "    </table>\n" +
            "  </form>\n" +
            "</body>");

        ensureFail("Should fail because the \"cellpading\" attribute value is different.", cmp);

        // Following comparison should not fail anymore.
        cmp.ignoredAttributes.add("cellpading");
        cmp.compare();

        cmp.ignoredAttributes.clear();
        cmp.ignoredAttributes.add("bgcolor");
        ensureFail("The \"cellpading\" attribute should not be ignored anymore.", cmp);

        // Ignore the table node, which contains the faulty attribute.
        cmp.ignoredNodes.add("table");
        cmp.compare();

        // Ignore the form node and all its children.
        cmp.ignoredNodes.clear();
        cmp.ignoredNodes.add("form");
        cmp.compare();
    }
View Full Code Here

Examples of org.apache.sis.test.XMLComparator

     *
     * @throws Exception Shall never happen.
     */
    @Test
    public void testIgnore() throws Exception {
        final XMLComparator cmp = new XMLComparator(
            "<body>\n" +
            "  <form id=\"MyForm\">\n" +
            "    <table cellpading=\"1\">\n" +
            "      <tr><td>foo</td></tr>\n" +
            "    </table>\n" +
            "  </form>\n" +
            "</body>",

            "<body>\n" +
            "  <form id=\"MyForm\">\n" +
            "    <table cellpading=\"2\">\n" +
            "      <tr><td>foo</td></tr>\n" +
            "    </table>\n" +
            "  </form>\n" +
            "</body>");

        assertFail("Shall fail because the \"cellpading\" attribute value is different.", cmp);

        // Following comparison should not fail anymore.
        cmp.ignoredAttributes.add("cellpading");
        cmp.compare();

        cmp.ignoredAttributes.clear();
        cmp.ignoredAttributes.add("bgcolor");
        assertFail("The \"cellpading\" attribute should not be ignored anymore.", cmp);

        // Ignore the table node, which contains the faulty attribute.
        cmp.ignoredNodes.add("table");
        cmp.compare();

        // Ignore the form node and all its children.
        cmp.ignoredNodes.clear();
        cmp.ignoredNodes.add("form");
        cmp.compare();
    }
View Full Code Here

Examples of org.apache.sis.test.XMLComparator

     *
     * @throws Exception Shall never happen.
     */
    @Test
    public void testNamespaceAware() throws Exception {
        XMLComparator cmp = new XMLComparator(
            "<ns1:body xmlns:ns1=\"http://myns1\" xmlns:ns2=\"http://myns2\">\n" +
            "  <ns1:table ns2:cellpading=\"1\"/>\n" +
            "</ns1:body>",

            "<ns4:body xmlns:ns4=\"http://myns1\" xmlns:ns3=\"http://myns2\">\n" +
            "  <ns4:table ns3:cellpading=\"1\"/>\n" +
            "</ns4:body>");

        // Following comparison should not fail anymore.
        cmp.ignoredAttributes.add("http://www.w3.org/2000/xmlns:*");
        cmp.compare();
        /*
         * Opposite case: same prefix, but different URL.
         * The XML comparison is expected to fail.
         */
        cmp = new XMLComparator(
            "<ns1:body xmlns:ns1=\"http://myns1\" xmlns:ns2=\"http://myns2\">\n" +
            "  <ns1:table ns2:cellpading=\"1\"/>\n" +
            "</ns1:body>",

            "<ns1:body xmlns:ns1=\"http://myns1\" xmlns:ns2=\"http://myns3\">\n" +
View Full Code Here

Examples of org.apache.ws.commons.om.impl.llom.util.XMLComparator

        msgCtxt.setEnvelope(defaultEnvelope);
        outHandler.invoke(msgCtxt);

        StAXSOAPModelBuilder omBuilder = testUtil.getOMBuilder("eprTest.xml");

        XMLComparator xmlComparator = new XMLComparator();

        assertTrue(
                xmlComparator.compare(omBuilder.getDocumentElement(),
                        defaultEnvelope));

    }
View Full Code Here

Examples of org.apache.ws.commons.om.impl.llom.util.XMLComparator

        msgCtxt.setEnvelope(
                OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope());
        outHandler.invoke(msgCtxt);

        XMLComparator xmlComparator = new XMLComparator();
        assertTrue(
                xmlComparator.compare(msgCtxt.getEnvelope(),
                        testUtil.getOMBuilder("OutHandlerTest.xml")
                .getDocumentElement()));
    }
View Full Code Here

Examples of xdoclet.retest.util.XMLComparator

    public void testJbossXml()
    throws Exception
    {
        Node one = readReferenceNode("jboss.xml");
        Node two = readGeneratedNode("jboss.xml");
        XMLComparator comp = new XMLComparator(one,two);
        comp.setAttributeValidation(false);
        ComparisonResultSet res = comp.compare();
        if (res.error()) System.out.println(res.toString());
        assertTrue("ejb-jar.xml comparison failed "+res, ! res.error());
    }
View Full Code Here

Examples of xdoclet.retest.util.XMLComparator

            one = readReferenceNode("jaws.xml");
        }catch (FileNotFoundException e){
            return;
        }
        Node two = readGeneratedNode("jaws.xml");
        XMLComparator comp = new XMLComparator(one,two);
        comp.setAttributeValidation(false);
        ComparisonResultSet res = comp.compare();
        if (res.error()) System.out.println(res.toString());
        assertTrue("ejb-jar.xml comparison failed "+res, ! res.error());
    }
View Full Code Here

Examples of xdoclet.retest.util.XMLComparator

            one = readReferenceNode("jboss-cmp.xml");
        }catch (FileNotFoundException e){
            return;
        }
        Node two = readGeneratedNode("jboss-cmp.xml");
        XMLComparator comp = new XMLComparator(one,two);
        comp.setAttributeValidation(false);
        ComparisonResultSet res = comp.compare();
        if (res.error()) System.out.println(res.toString());
        assertTrue("ejb-jar.xml comparison failed "+res, ! res.error());
    }
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.