Package org.apache.axiom.testutils.stax

Examples of org.apache.axiom.testutils.stax.XMLStreamReaderComparator


            attachments[i] = new Attachments(getTestResource(TestConstants.MTOM_MESSAGE.getName()),
                    TestConstants.MTOM_MESSAGE.getContentType());
            soapPartReader[i] = StAXUtils.createXMLStreamReader(attachments[i].getRootPartInputStream());
        }
        XMLStreamReader actual = new XOPEncodingStreamReader(new XOPDecodingStreamReader(soapPartReader[1], new OMAttachmentAccessorMimePartProvider(attachments[1])), contentIDGenerator, OptimizationPolicy.DEFAULT);
        new XMLStreamReaderComparator(soapPartReader[0], actual).compare();
        for (int i=0; i<2; i++) {
            soapPartReader[i].close();
        }
    }
View Full Code Here


   
    public void testCompareToInlined() throws Exception {
        XMLStreamReader expected = StAXUtils.createXMLStreamReader(
                getTestResource(TestConstants.MTOM_MESSAGE_INLINED));
        XMLStreamReader actual = getXOPDecodingStreamReader();
        XMLStreamReaderComparator comparator = new XMLStreamReaderComparator(expected, actual);
        comparator.addPrefix("xop");
        comparator.compare();
        expected.close();
        actual.close();
    }
View Full Code Here

            XMLStreamReader expected = StAXUtils.createXMLStreamReader(in1);
            try {
                OMXMLParserWrapper builder = OMXMLBuilderFactory.createOMBuilder(metaFactory.getOMFactory(), in2);
                try {
                    XMLStreamReader actual = builder.getDocument().getXMLStreamReader(cache);
                    new XMLStreamReaderComparator(new RootWhitespaceFilter(expected),
                            new RootWhitespaceFilter(actual)).compare();
                } finally {
                    builder.close();
                }
            } finally {
View Full Code Here

            XMLStreamReader expected = StAXUtils.createXMLStreamReader(in1);
            try {
                OMXMLParserWrapper builder = OMXMLBuilderFactory.createOMBuilder(metaFactory.getOMFactory(), in2);
                try {
                    XMLStreamReader actual = containerFactory.getContainer(builder).getXMLStreamReader(cache);
                    new XMLStreamReaderComparator(containerFactory.filter(expected), containerFactory.filter(actual)).compare();
                } finally {
                    builder.close();
                }
            } finally {
                expected.close();
View Full Code Here

            XMLStreamReader expected = StAXUtils.createXMLStreamReader(TEST_PARSER_CONFIGURATION, file.getUrl().toString(), in);
            try {
                OMXMLParserWrapper builder = builderFactory.getBuilder(metaFactory, new InputSource(file.getUrl().toString()));
                try {
                    XMLStreamReader actual = containerFactory.getContainer(builder).getXMLStreamReader(cache);
                    XMLStreamReaderComparator comparator = new XMLStreamReaderComparator(containerFactory.filter(expected), containerFactory.filter(actual));
                    builderFactory.configureXMLStreamReaderComparator(comparator);
                    comparator.compare();
                } finally {
                    builder.close();
                }
            } finally {
                expected.close();
View Full Code Here

        String xml = "<ns:a xmlns:ns='urn:ns'>test</ns:a>";
        XMLStreamReader expected = StAXUtils.createXMLStreamReader(new StringReader(xml));
        XMLStreamReader reader = StAXUtils.createXMLStreamReader(new StringReader(xml));
        reader.nextTag();
        XMLStreamReader actual = new XMLFragmentStreamReader(reader);
        new XMLStreamReaderComparator(expected, actual).compare();
        assertEquals(XMLStreamReader.END_DOCUMENT, reader.getEventType());
        expected.close();
        reader.close();
    }
View Full Code Here

            attachments[i] = new Attachments(getTestResource(TestConstants.MTOM_MESSAGE),
                    TestConstants.MTOM_MESSAGE_CONTENT_TYPE);
            soapPartReader[i] = StAXUtils.createXMLStreamReader(attachments[i].getSOAPPartInputStream());
        }
        XMLStreamReader actual = new XOPEncodingStreamReader(new XOPDecodingStreamReader(soapPartReader[1], new OMAttachmentAccessorMimePartProvider(attachments[1])), contentIDGenerator, OptimizationPolicy.DEFAULT);
        new XMLStreamReaderComparator(soapPartReader[0], actual).compare();
        for (int i=0; i<2; i++) {
            soapPartReader[i].close();
        }
    }
View Full Code Here

   
    public void testCompareToInlined() throws Exception {
        XMLStreamReader expected = StAXUtils.createXMLStreamReader(
                getTestResource(TestConstants.MTOM_MESSAGE_INLINED));
        XMLStreamReader actual = getXOPDecodingStreamReader();
        XMLStreamReaderComparator comparator = new XMLStreamReaderComparator(expected, actual);
        comparator.addPrefix("xop");
        comparator.compare();
        expected.close();
        actual.close();
    }
View Full Code Here

                }
                StAXOMBuilder builder = new StAXOMBuilder(omMetaFactory.getOMFactory(),
                        StAXUtils.createXMLStreamReader(in2));
                try {
                    XMLStreamReader actual = builder.getDocumentElement().getXMLStreamReader();
                    new XMLStreamReaderComparator(new XMLFragmentStreamReader(expected), actual).compare();
                } finally {
                    builder.close();
                }
            } finally {
                expected.close();
View Full Code Here

TOP

Related Classes of org.apache.axiom.testutils.stax.XMLStreamReaderComparator

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.