Package org.springframework.xml.transform

Examples of org.springframework.xml.transform.StringSource


        mockClient = MockWebServiceClient.createClient(applicationContext);
    }

    @Test
    public void basic() throws Exception {
        Source requestPayload = new StringSource("<customerCountRequest xmlns='http://springframework.org/spring-ws'>" +
                "<customerName>John Doe</customerName>" + "</customerCountRequest>");
        Source expectedResponsePayload = new StringSource(
                "<customerCountResponse xmlns='http://springframework.org/spring-ws'>" +
                        "<customerCount>42</customerCount>" + "</customerCountResponse>");

        mockClient.sendRequest(withPayload(requestPayload)).andExpect(payload(expectedResponsePayload));
    }
View Full Code Here


        XPathExpectationsHelper helper = new XPathExpectationsHelper("//b");
        WebServiceMessageMatcher matcher = helper.exists();
        assertNotNull(matcher);

        WebServiceMessage message = createMock(WebServiceMessage.class);
        expect(message.getPayloadSource()).andReturn(new StringSource("<a><b/></a>"));

        replay(message);

        matcher.match(message);
View Full Code Here

        XPathExpectationsHelper helper = new XPathExpectationsHelper("//c");
        WebServiceMessageMatcher matcher = helper.exists();
        assertNotNull(matcher);

        WebServiceMessage message = createMock(WebServiceMessage.class);
        expect(message.getPayloadSource()).andReturn(new StringSource("<a><b/></a>")).times(2);

        replay(message);

        matcher.match(message);
    }
View Full Code Here

        XPathExpectationsHelper helper = new XPathExpectationsHelper("//c");
        WebServiceMessageMatcher matcher = helper.doesNotExist();
        assertNotNull(matcher);

        WebServiceMessage message = createMock(WebServiceMessage.class);
        expect(message.getPayloadSource()).andReturn(new StringSource("<a><b/></a>"));

        replay(message);

        matcher.match(message);
View Full Code Here

        XPathExpectationsHelper helper = new XPathExpectationsHelper("//a");
        WebServiceMessageMatcher matcher = helper.doesNotExist();
        assertNotNull(matcher);

        WebServiceMessage message = createMock(WebServiceMessage.class);
        expect(message.getPayloadSource()).andReturn(new StringSource("<a><b/></a>")).times(2);

        replay(message);

        matcher.match(message);
    }
View Full Code Here

        XPathExpectationsHelper helper = new XPathExpectationsHelper("//b=1");
        WebServiceMessageMatcher matcher = helper.evaluatesTo(true);
        assertNotNull(matcher);

        WebServiceMessage message = createMock(WebServiceMessage.class);
        expect(message.getPayloadSource()).andReturn(new StringSource("<a><b>1</b></a>")).times(2);

        replay(message);

        matcher.match(message);
View Full Code Here

        XPathExpectationsHelper helper = new XPathExpectationsHelper("//b=2");
        WebServiceMessageMatcher matcher = helper.evaluatesTo(true);
        assertNotNull(matcher);

        WebServiceMessage message = createMock(WebServiceMessage.class);
        expect(message.getPayloadSource()).andReturn(new StringSource("<a><b>1</b></a>")).times(2);

        replay(message);

        matcher.match(message);
    }
View Full Code Here

        XPathExpectationsHelper helper = new XPathExpectationsHelper("//b!=1");
        WebServiceMessageMatcher matcher = helper.evaluatesTo(false);
        assertNotNull(matcher);

        WebServiceMessage message = createMock(WebServiceMessage.class);
        expect(message.getPayloadSource()).andReturn(new StringSource("<a><b>1</b></a>")).times(2);

        replay(message);

        matcher.match(message);
View Full Code Here

        XPathExpectationsHelper helper = new XPathExpectationsHelper("//b!=2");
        WebServiceMessageMatcher matcher = helper.evaluatesTo(false);
        assertNotNull(matcher);

        WebServiceMessage message = createMock(WebServiceMessage.class);
        expect(message.getPayloadSource()).andReturn(new StringSource("<a><b>1</b></a>")).times(2);

        replay(message);

        matcher.match(message);
    }
View Full Code Here

        XPathExpectationsHelper helper = new XPathExpectationsHelper("//b");
        WebServiceMessageMatcher matcher = helper.evaluatesTo(1);
        assertNotNull(matcher);

        WebServiceMessage message = createMock(WebServiceMessage.class);
        expect(message.getPayloadSource()).andReturn(new StringSource("<a><b>1</b></a>")).times(2);

        replay(message);

        matcher.match(message);
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.