Package org.springframework.ws

Examples of org.springframework.ws.MockWebServiceMessage$StringBufferWriter


        Object extracted = new Object();
        expect(extractorMock.extractData(isA(WebServiceMessage.class))).andReturn(extracted);

        connectionMock.send(isA(WebServiceMessage.class));
        expect(connectionMock.hasError()).andReturn(false);
        expect(connectionMock.receive(messageFactory)).andReturn(new MockWebServiceMessage("<response/>"));
        expect(connectionMock.hasFault()).andReturn(false);
        connectionMock.close();

        replay(connectionMock, requestCallback, extractorMock);
View Full Code Here


        FaultMessageResolver faultMessageResolverMock = createMock(FaultMessageResolver.class);
        template.setFaultMessageResolver(faultMessageResolverMock);
        faultMessageResolverMock.resolveFault(isA(WebServiceMessage.class));

        MockWebServiceMessage response = new MockWebServiceMessage("<response/>");
        response.setFault(true);

        connectionMock.send(isA(WebServiceMessage.class));
        expect(connectionMock.hasError()).andReturn(false);
        expect(connectionMock.hasFault()).andReturn(true);
        expect(connectionMock.receive(messageFactory)).andReturn(response);
View Full Code Here

        Object extracted = new Object();
        expect(extractorMock.extractData(isA(Source.class))).andReturn(extracted);

        connectionMock.send(isA(WebServiceMessage.class));
        expect(connectionMock.hasError()).andReturn(false);
        expect(connectionMock.receive(messageFactory)).andReturn(new MockWebServiceMessage("<response/>"));
        expect(connectionMock.hasFault()).andReturn(false);
        connectionMock.close();

        replay(connectionMock, extractorMock);
View Full Code Here

    @Test
    public void testSendAndReceiveResultResponse() throws Exception {
        connectionMock.send(isA(WebServiceMessage.class));
        expect(connectionMock.hasError()).andReturn(false);
        expect(connectionMock.receive(messageFactory)).andReturn(new MockWebServiceMessage("<response/>"));
        expect(connectionMock.hasFault()).andReturn(false);
        connectionMock.close();

        replay(connectionMock);
View Full Code Here

        Object unmarshalled = new Object();
        expect(unmarshallerMock.unmarshal(isA(Source.class))).andReturn(unmarshalled);

        connectionMock.send(isA(WebServiceMessage.class));
        expect(connectionMock.hasError()).andReturn(false);
        expect(connectionMock.receive(messageFactory)).andReturn(new MockWebServiceMessage("<response/>"));
        expect(connectionMock.hasFault()).andReturn(false);
        connectionMock.close();

        replay(connectionMock, marshallerMock, unmarshallerMock);
View Full Code Here

        Object extracted = new Object();
        expect(extractorMock.extractData(isA(WebServiceMessage.class))).andReturn(extracted);

        connectionMock.send(isA(WebServiceMessage.class));
        expect(connectionMock.hasError()).andReturn(false);
        expect(connectionMock.receive(messageFactory)).andReturn(new MockWebServiceMessage("<response/>"));
        expect(connectionMock.hasFault()).andReturn(false);
        connectionMock.close();

        replay(connectionMock, requestCallback, extractorMock);
View Full Code Here

        Object extracted = new Object();
        expect(extractorMock.extractData(isA(WebServiceMessage.class))).andReturn(extracted);

        connectionMock.send(isA(WebServiceMessage.class));
        expect(connectionMock.hasError()).andReturn(false);
        expect(connectionMock.receive(messageFactory)).andReturn(new MockWebServiceMessage("<response/>"));
        expect(connectionMock.hasFault()).andReturn(false);
        connectionMock.close();

        replay(connectionMock, interceptorMock1, interceptorMock2, requestCallback, extractorMock);
View Full Code Here

        Object extracted = new Object();
        expect(extractorMock.extractData(isA(WebServiceMessage.class))).andReturn(extracted);

        connectionMock.send(isA(WebServiceMessage.class));
        expect(connectionMock.hasError()).andReturn(false);
        expect(connectionMock.receive(messageFactory)).andReturn(new MockWebServiceMessage("<response/>"));
        expect(connectionMock.hasFault()).andReturn(false);

        replay(connectionMock, interceptorMock1, interceptorMock2, requestCallback, extractorMock);

        Object result = template.doSendAndReceive(messageContext, connectionMock, requestCallback, extractorMock);
View Full Code Here

        Assert.assertNull("Detail on fault", fault.getFaultDetail());
    }

    @Test
    public void testHandlerInvalidRequest() throws Exception {
        MockWebServiceMessage request = new MockWebServiceMessage();
        request.setPayload(new ClassPathResource(INVALID_MESSAGE, getClass()));
        context = new DefaultMessageContext(request, new MockWebServiceMessageFactory());
        boolean result = interceptor.handleRequest(context, null);
        Assert.assertFalse("Invalid response from interceptor", result);
    }
View Full Code Here

        Assert.assertFalse("Invalid response from interceptor", result);
    }

    @Test
    public void testHandleValidRequest() throws Exception {
        MockWebServiceMessage request = new MockWebServiceMessage();
        request.setPayload(new ClassPathResource(VALID_MESSAGE, getClass()));
        context = new DefaultMessageContext(request, new MockWebServiceMessageFactory());
        boolean result = interceptor.handleRequest(context, null);
        Assert.assertTrue("Invalid response from interceptor", result);
        Assert.assertFalse("Response set", context.hasResponse());
    }
View Full Code Here

TOP

Related Classes of org.springframework.ws.MockWebServiceMessage$StringBufferWriter

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.