Package javax.xml.transform.sax

Examples of javax.xml.transform.sax.SAXSource


                handler.endElement("http://springframework.org", "root", "root");
                handler.endPrefixMapping("");
                handler.endDocument();
            }
        };
        final SAXSource source = new SAXSource(xmlReader, new InputSource());
       
        // Create a mock WebServiceMessage that returns the SAXSource as payload source.
        WebServiceMessage request = new WebServiceMessage() {
            @Override
            public void writeTo(OutputStream outputStream) throws IOException {
View Full Code Here


    @Test
    public void testSaxSource() throws Exception {
        XMLReader reader = XMLReaderFactory.createXMLReader();
        InputSource inputSource = new InputSource(new StringReader(REQUEST));
        testSource(new SAXSource(reader, inputSource));
    }
View Full Code Here

    @Test
    public void testStaxSourceEventReader() throws Exception {
        XMLInputFactory inputFactory = XMLInputFactory.newInstance();
        XMLEventReader eventReader = inputFactory.createXMLEventReader(new StringReader(REQUEST));
        testSource(new SAXSource(StaxUtils.createXMLReader(eventReader), new InputSource()));
    }
View Full Code Here

    @Test
    public void testStaxSourceStreamReader() throws Exception {
        XMLInputFactory inputFactory = XMLInputFactory.newInstance();
        XMLStreamReader streamReader = inputFactory.createXMLStreamReader(new StringReader(REQUEST));
        testSource(new SAXSource(StaxUtils.createXMLReader(streamReader), new InputSource()));
    }
View Full Code Here

        MessageContext context = new DefaultMessageContext(request, new MockWebServiceMessageFactory());

        boolean result = interceptor.handleRequest(context, null);
        Assert.assertTrue("Invalid interceptor result", result);
        StringResult expected = new StringResult();
        transformer.transform(new SAXSource(SaxUtils.createInputSource(output)), expected);
        assertXMLEqual(expected.toString(), request.getPayloadAsString());
    }
View Full Code Here

        MessageContext context = new DefaultMessageContext(request, new MockWebServiceMessageFactory());

        boolean result = interceptor.handleRequest(context, null);
        Assert.assertTrue("Invalid interceptor result", result);
        StringResult expected = new StringResult();
        transformer.transform(new SAXSource(SaxUtils.createInputSource(input)), expected);
        assertXMLEqual(expected.toString(), request.getPayloadAsString());
    }
View Full Code Here

        response.setPayload(input);

        boolean result = interceptor.handleResponse(context, null);
        Assert.assertTrue("Invalid interceptor result", result);
        StringResult expected = new StringResult();
        transformer.transform(new SAXSource(SaxUtils.createInputSource(output)), expected);
        assertXMLEqual(expected.toString(), response.getPayloadAsString());
    }
View Full Code Here

        response.setPayload(input);

        boolean result = interceptor.handleResponse(context, null);
        Assert.assertTrue("Invalid interceptor result", result);
        StringResult expected = new StringResult();
        transformer.transform(new SAXSource(SaxUtils.createInputSource(input)), expected);
        assertXMLEqual(expected.toString(), response.getPayloadAsString());
    }
View Full Code Here

        transformer.transform(new ResourceSource(input), message.getPayloadResult());
        MessageContext context = new DefaultMessageContext(message, new SaajSoapMessageFactory(messageFactory));

        Assert.assertTrue("Invalid interceptor result", interceptor.handleRequest(context, null));
        StringResult expected = new StringResult();
        transformer.transform(new SAXSource(SaxUtils.createInputSource(output)), expected);
        StringResult result = new StringResult();
        transformer.transform(message.getPayloadSource(), result);
        assertXMLEqual(expected.toString(), result.toString());

    }
View Full Code Here

        transformer.transform(new ResourceSource(input), message.getPayloadResult());
        MessageContext context = new DefaultMessageContext(message, factory);

        Assert.assertTrue("Invalid interceptor result", interceptor.handleRequest(context, null));
        StringResult expected = new StringResult();
        transformer.transform(new SAXSource(SaxUtils.createInputSource(output)), expected);
        StringResult result = new StringResult();
        transformer.transform(message.getPayloadSource(), result);
        assertXMLEqual(expected.toString(), result.toString());

    }
View Full Code Here

TOP

Related Classes of javax.xml.transform.sax.SAXSource

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.