Examples of DefaultMessageContext


Examples of org.springframework.ws.context.DefaultMessageContext

    private MessageContext context;

    @Before
    public void setUp() throws Exception {
        mapping = new SoapActionEndpointMapping();
        context = new DefaultMessageContext(new SaajSoapMessageFactory(MessageFactory.newInstance()));
    }
View Full Code Here

Examples of org.springframework.ws.context.DefaultMessageContext

        interceptor.setAddValidationErrorDetail(false);

        SoapMessage invalidMessage = soap11Factory.createWebServiceMessage();
        InputStream inputStream = getClass().getResourceAsStream(INVALID_MESSAGE);
        transformer.transform(new StreamSource(inputStream), invalidMessage.getPayloadResult());
        context = new DefaultMessageContext(invalidMessage, soap11Factory);

        boolean result = interceptor.handleRequest(context, null);
        Assert.assertFalse("Invalid response from interceptor", result);
        Assert.assertTrue("Context has no response", context.hasResponse());
        SoapMessage response = (SoapMessage) context.getResponse();
View Full Code Here

Examples of org.springframework.ws.context.DefaultMessageContext

    @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

Examples of org.springframework.ws.context.DefaultMessageContext

    @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

Examples of org.springframework.ws.context.DefaultMessageContext

    }

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

Examples of org.springframework.ws.context.DefaultMessageContext

    }

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

Examples of org.springframework.ws.context.DefaultMessageContext

            interceptor.setSchema(new ClassPathResource(SCHEMA2, PayloadValidatingInterceptorTest.class));
            interceptor.afterPropertiesSet();
            MessageFactory messageFactory = MessageFactory.newInstance();
            SOAPMessage saajMessage =
                    SaajUtils.loadMessage(new ClassPathResource(VALID_SOAP_MESSAGE, getClass()), messageFactory);
            context = new DefaultMessageContext(new SaajSoapMessage(saajMessage),
                    new SaajSoapMessageFactory(messageFactory));

            boolean result = interceptor.handleRequest(context, null);
            Assert.assertTrue("Invalid response from interceptor", result);
            Assert.assertFalse("Response set", context.hasResponse());
View Full Code Here

Examples of org.springframework.ws.context.DefaultMessageContext

    public void testHandlerInvalidRequestMultipleSchemas() throws Exception {
        interceptor.setSchemas(new Resource[]{new ClassPathResource(PRODUCT_SCHEMA, getClass()),
                new ClassPathResource(SIZE_SCHEMA, getClass())});
        interceptor.afterPropertiesSet();
        MockWebServiceMessage request = new MockWebServiceMessage(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

Examples of org.springframework.ws.context.DefaultMessageContext

    public void testHandleValidRequestMultipleSchemas() throws Exception {
        interceptor.setSchemas(new Resource[]{new ClassPathResource(PRODUCT_SCHEMA, getClass()),
                new ClassPathResource(SIZE_SCHEMA, getClass())});
        interceptor.afterPropertiesSet();
        MockWebServiceMessage request = new MockWebServiceMessage(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

Examples of org.springframework.ws.context.DefaultMessageContext

    public void testHandleInvalidResponseMultipleSchemas() throws Exception {
        interceptor.setSchemas(new Resource[]{new ClassPathResource(PRODUCT_SCHEMA, getClass()),
                new ClassPathResource(SIZE_SCHEMA, getClass())});
        interceptor.afterPropertiesSet();
        MockWebServiceMessage request = new MockWebServiceMessage();
        context = new DefaultMessageContext(request, new MockWebServiceMessageFactory());
        MockWebServiceMessage response = (MockWebServiceMessage) context.getResponse();
        response.setPayload(new ClassPathResource(INVALID_MESSAGE, getClass()));
        boolean result = interceptor.handleResponse(context, null);
        Assert.assertFalse("Invalid response from interceptor", result);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.