Package org.springframework.xml.transform

Examples of org.springframework.xml.transform.StringSource


        expect(connectionMock.hasFault()).andReturn(false);
        connectionMock.close();

        replay(connectionMock, extractorMock);

        Object result = template.sendSourceAndReceive(new StringSource("<request />"), extractorMock);
        assertEquals("Invalid response", extracted, result);

        verify(connectionMock, extractorMock);
    }
View Full Code Here


        expect(connectionMock.receive(messageFactory)).andReturn(null);
        connectionMock.close();

        replay(connectionMock, extractorMock);

        Object result = template.sendSourceAndReceive(new StringSource("<request />"), extractorMock);
        assertNull("Invalid response", result);

        verify(connectionMock, extractorMock);
    }
View Full Code Here

        connectionMock.close();

        replay(connectionMock);

        StringResult result = new StringResult();
        boolean b = template.sendSourceAndReceiveToResult(new StringSource("<request />"), result);
        assertTrue("Invalid result", b);

        verify(connectionMock);
    }
View Full Code Here

        connectionMock.close();

        replay(connectionMock);

        StringResult result = new StringResult();
        boolean b = template.sendSourceAndReceiveToResult(new StringSource("<request />"), result);
        assertFalse("Invalid result", b);

        verify(connectionMock);
    }
View Full Code Here

        connectionMock.close();

        replay(connectionMock, response);

        StringResult result = new StringResult();
        boolean b = template.sendSourceAndReceiveToResult(new StringSource("<request />"), result);
        assertTrue("Invalid result", b);

        verify(connectionMock, response);
    }
View Full Code Here

  @Test
    public void sendSourceAndReceiveToResult() throws SAXException, IOException {
        StringResult result = new StringResult();
        boolean b = template.sendSourceAndReceiveToResult(baseUrl + "/soap/echo",
                new StringSource(messagePayload), result);
        Assert.assertTrue("Invalid result", b);
        assertXMLEqual(messagePayload, result.toString());
    }
View Full Code Here

    }

  @Test
    public void sendSourceAndReceiveToResultNoResponse() {
        boolean b = template.sendSourceAndReceiveToResult(baseUrl + "/soap/noResponse",
                new StringSource(messagePayload), new StringResult());
        Assert.assertFalse("Invalid result", b);
    }
View Full Code Here

            @Override
            public void marshal(Object graph, Result result) throws XmlMappingException, IOException {
                Assert.assertEquals("Invalid object", graph, requestObject);
                try {
                    transformer.transform(new StringSource(messagePayload), result);
                }
                catch (TransformerException e) {
                    Assert.fail(e.getMessage());
                }
            }
View Full Code Here

            @Override
            public void marshal(Object graph, Result result) throws XmlMappingException, IOException {
                Assert.assertEquals("Invalid object", graph, requestObject);
                try {
                    transformer.transform(new StringSource(messagePayload), result);
                }
                catch (TransformerException e) {
                    Assert.fail(e.getMessage());
                }
            }
View Full Code Here

  @Test
    public void notFound() {
        try {
            template.sendSourceAndReceiveToResult(baseUrl + "/errors/notfound",
                    new StringSource(messagePayload), new StringResult());
            Assert.fail("WebServiceTransportException expected");
        }
        catch (WebServiceTransportException ex) {
            //expected
        }
View Full Code Here

TOP

Related Classes of org.springframework.xml.transform.StringSource

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.