Package org.springframework.ws

Examples of org.springframework.ws.WebServiceMessageFactory


    @Test
    public void testNoResponse() throws Exception {
        WebServiceMessage messageMock = createMock(WebServiceMessage.class);
        expect(messageMock.getPayloadSource()).andReturn(new StringSource("<request/>"));
        WebServiceMessageFactory factoryMock = createMock(WebServiceMessageFactory.class);
        MessageContext messageContext = new DefaultMessageContext(messageMock, factoryMock);

        Method noResponse = getClass().getMethod("noResponse", MyGenericType.class);
        MethodEndpoint methodEndpoint = new MethodEndpoint(this, noResponse);
        expect(unmarshallerMock.unmarshal(isA(Source.class))).andReturn(new MyGenericType<MyType>());
View Full Code Here


    @Test
    public void testNoRequestPayload() throws Exception {
        WebServiceMessage messageMock = createMock(WebServiceMessage.class);
        expect(messageMock.getPayloadSource()).andReturn(null);
        WebServiceMessageFactory factoryMock = createMock(WebServiceMessageFactory.class);
        MessageContext messageContext = new DefaultMessageContext(messageMock, factoryMock);

        Method noResponse = getClass().getMethod("noResponse", MyGenericType.class);
        MethodEndpoint methodEndpoint = new MethodEndpoint(this, noResponse);
View Full Code Here

    public void testResponse() throws Exception {
        WebServiceMessage requestMock = createMock(WebServiceMessage.class);
        expect(requestMock.getPayloadSource()).andReturn(new StringSource("<request/>"));
        WebServiceMessage responseMock = createMock(WebServiceMessage.class);
        expect(responseMock.getPayloadResult()).andReturn(new StringResult());
        WebServiceMessageFactory factoryMock = createMock(WebServiceMessageFactory.class);
        expect(factoryMock.createWebServiceMessage()).andReturn(responseMock);
        MessageContext messageContext = new DefaultMessageContext(requestMock, factoryMock);

        Method response = getClass().getMethod("response", MyGenericType.class);
        MethodEndpoint methodEndpoint = new MethodEndpoint(this, response);
        expect(unmarshallerMock.unmarshal(isA(Source.class))).andReturn(new MyGenericType<MyType>());
View Full Code Here

    @Test
    public void testInvokeTypes() throws Exception {
        WebServiceMessage messageMock = createMock(WebServiceMessage.class);
        expect(messageMock.getPayloadSource()).andReturn(new StringSource(CONTENTS));
        WebServiceMessageFactory factoryMock = createMock(WebServiceMessageFactory.class);
        replay(messageMock, factoryMock);

        MessageContext messageContext = new DefaultMessageContext(messageMock, factoryMock);
        MethodEndpoint endpoint = new MethodEndpoint(this, "supportedTypes",
                new Class[]{Boolean.TYPE, Double.TYPE, Node.class, NodeList.class, String.class});
View Full Code Here

    public void testInvokeSource() throws Exception {
        WebServiceMessage requestMock = createMock(WebServiceMessage.class);
        WebServiceMessage responseMock = createMock(WebServiceMessage.class);
        expect(requestMock.getPayloadSource()).andReturn(new StringSource(CONTENTS));
        expect(responseMock.getPayloadResult()).andReturn(new StringResult());
        WebServiceMessageFactory factoryMock = createMock(WebServiceMessageFactory.class);
        expect(factoryMock.createWebServiceMessage()).andReturn(responseMock);
        replay(requestMock, responseMock, factoryMock);

        MessageContext messageContext = new DefaultMessageContext(requestMock, factoryMock);
        MethodEndpoint endpoint = new MethodEndpoint(this, "supportedSource", new Class[]{String.class});
        adapter.invoke(messageContext, endpoint);
View Full Code Here

        text = document.createTextNode("other-value");
        second.appendChild(text);

        WebServiceMessage requestMock = createMock(WebServiceMessage.class);
        expect(requestMock.getPayloadSource()).andReturn(new DOMSource(first));
        WebServiceMessageFactory factoryMock = createMock(WebServiceMessageFactory.class);

        replay(requestMock, factoryMock);

        Map<String, String> namespaces = new HashMap<String, String>();
        namespaces.put("root", rootNamespace);
View Full Code Here

    @Test
    public void registrationSingle() throws Exception {
        SoapMessage requestMock = createMock(SoapMessage.class);
        expect(requestMock.getSoapAction()).andReturn("http://springframework.org/spring-ws/SoapAction");
        WebServiceMessageFactory factoryMock = createMock(WebServiceMessageFactory.class);
        replay(requestMock, factoryMock);

        MessageContext context = new DefaultMessageContext(requestMock, factoryMock);
        EndpointInvocationChain chain = mapping.getEndpoint(context);
        Assert.assertNotNull("MethodEndpoint not registered", chain);
View Full Code Here

    @Test
    public void registrationMultiple() throws Exception {
        SoapMessage requestMock = createMock(SoapMessage.class);
        expect(requestMock.getSoapAction()).andReturn("http://springframework.org/spring-ws/SoapAction1");
        expect(requestMock.getSoapAction()).andReturn("http://springframework.org/spring-ws/SoapAction2");
        WebServiceMessageFactory factoryMock = createMock(WebServiceMessageFactory.class);
        replay(requestMock, factoryMock);

      Method doItMultiple = MyEndpoint.class.getMethod("doItMultiple");
      MethodEndpoint expected = new MethodEndpoint("endpoint", applicationContext, doItMultiple);
View Full Code Here

    @Test
    public void registrationRepeatable() throws Exception {
        SoapMessage requestMock = createMock(SoapMessage.class);
        expect(requestMock.getSoapAction()).andReturn("http://springframework.org/spring-ws/SoapAction3");
        expect(requestMock.getSoapAction()).andReturn("http://springframework.org/spring-ws/SoapAction4");
        WebServiceMessageFactory factoryMock = createMock(WebServiceMessageFactory.class);
        replay(requestMock, factoryMock);

      Method doItRepeatable = MyEndpoint.class.getMethod("doItRepeatable");
      MethodEndpoint expected = new MethodEndpoint("endpoint", applicationContext, doItRepeatable);
View Full Code Here

        MockStrategiesHelper strategiesHelper = new MockStrategiesHelper(applicationContext);

        WebServiceMessageReceiver messageReceiver =
                strategiesHelper.getStrategy(WebServiceMessageReceiver.class, SoapMessageDispatcher.class);
        WebServiceMessageFactory messageFactory =
                strategiesHelper.getStrategy(WebServiceMessageFactory.class, SaajSoapMessageFactory.class);
        return new MockWebServiceClient(messageReceiver, messageFactory);
    }
View Full Code Here

TOP

Related Classes of org.springframework.ws.WebServiceMessageFactory

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.