Package org.springframework.xml.transform

Examples of org.springframework.xml.transform.StringResult


        expect(connectionMock.hasFault()).andReturn(false);
        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


        expect(connectionMock.receive(messageFactory)).andReturn(null);
        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

        expect(response.getPayloadSource()).andReturn(null);
        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 notFound() {
        try {
            template.sendSourceAndReceiveToResult(baseUrl + "/errors/notfound",
                    new StringSource(messagePayload), new StringResult());
            Assert.fail("WebServiceTransportException expected");
        }
        catch (WebServiceTransportException ex) {
            //expected
        }
View Full Code Here

        }
    }

  @Test
    public void fault() {
        Result result = new StringResult();
        try {
            template.sendSourceAndReceiveToResult(baseUrl + "/soap/fault", new StringSource(messagePayload),
                    result);
            Assert.fail("SoapFaultClientException expected");
        }
View Full Code Here

        }
    }

  @Test
    public void faultNonCompliant() {
        Result result = new StringResult();
        template.setCheckConnectionForFault(false);
        template.setCheckConnectionForError(false);
        try {
            template.sendSourceAndReceiveToResult(baseUrl + "/soap/badRequestFault",
                    new StringSource(messagePayload), result);
View Full Code Here

                        SoapMessage soapMessage = (SoapMessage) message;
                        final String attachmentContent = "content";
                        soapMessage.addAttachment("attachment-1",
                                new DataHandler(new ByteArrayDataSource(attachmentContent, "text/plain")));
                    }
                }, new StringResult());
    }
View Full Code Here

  public abstract SoapMessageFactory createMessageFactory() throws Exception;

  @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

  @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.StringResult

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.