Package org.springframework.ws.server.endpoint

Examples of org.springframework.ws.server.endpoint.MethodEndpoint


                adapter.supportsInternal(new MethodEndpoint(this, "unsupportedWrongParam", new Class[]{String.class})));
    }

    @Test
    public void testInvokeSupported() throws Exception {
        MethodEndpoint methodEndpoint = new MethodEndpoint(this, "supported", new Class[]{MessageContext.class});
        Assert.assertFalse("Method invoked", supportedInvoked);
        adapter.invoke(messageContext, methodEndpoint);
        Assert.assertTrue("Method not invoked", supportedInvoked);
    }
View Full Code Here


        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>());

        replay(marshallerMock, unmarshallerMock, messageMock, factoryMock);

        Assert.assertFalse("Method invoked", noResponseInvoked);
View Full Code Here

        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);

        replay(marshallerMock, unmarshallerMock, messageMock, factoryMock);

        Assert.assertFalse("Method invoked", noResponseInvoked);
        adapter.invoke(messageContext, methodEndpoint);
View Full Code Here

        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>());
        marshallerMock.marshal(isA(MyGenericType.class), isA(Result.class));

        replay(marshallerMock, unmarshallerMock, requestMock, responseMock, factoryMock);
View Full Code Here

    }

    @Test
    public void testSupportedNoResponse() throws NoSuchMethodException {
        Method noResponse = getClass().getMethod("noResponse", MyGenericType.class);
        MethodEndpoint methodEndpoint = new MethodEndpoint(this, noResponse);
        expect(unmarshallerMock.supports(noResponse.getGenericParameterTypes()[0])).andReturn(true);

        replay(marshallerMock, unmarshallerMock);

        Assert.assertTrue("Method unsupported", adapter.supportsInternal(methodEndpoint));
View Full Code Here

    }

    @Test
    public void testSupportedResponse() throws NoSuchMethodException {
        Method response = getClass().getMethod("response", MyGenericType.class);
        MethodEndpoint methodEndpoint = new MethodEndpoint(this, response);

        expect(unmarshallerMock.supports(response.getGenericParameterTypes()[0])).andReturn(true);
        expect(marshallerMock.supports(response.getGenericReturnType())).andReturn(true);

        replay(marshallerMock, unmarshallerMock);
View Full Code Here

    public void testUnsupportedMethodMultipleParams() throws NoSuchMethodException {
        Method unsupported = getClass().getMethod("unsupportedMultipleParams", String.class, String.class);

        replay(marshallerMock, unmarshallerMock);

        Assert.assertFalse("Method supported", adapter.supportsInternal(new MethodEndpoint(this, unsupported)));

        verify(marshallerMock, unmarshallerMock);
    }
View Full Code Here

        expect(unmarshallerMock.supports(unsupported.getGenericParameterTypes()[0])).andReturn(false);
        expect(marshallerMock.supports(unsupported.getGenericReturnType())).andReturn(true);

        replay(marshallerMock, unmarshallerMock);

        Assert.assertFalse("Method supported", adapter.supportsInternal(new MethodEndpoint(this, unsupported)));

        verify(marshallerMock, unmarshallerMock);
    }
View Full Code Here

        Method unsupported = getClass().getMethod("unsupportedWrongParam", String.class);
        expect(marshallerMock.supports(unsupported.getGenericReturnType())).andReturn(false);

        replay(marshallerMock, unmarshallerMock);

        Assert.assertFalse("Method supported", adapter.supportsInternal(new MethodEndpoint(this, unsupported)));

        verify(marshallerMock, unmarshallerMock);
    }
View Full Code Here

        adapter.afterPropertiesSet();
    }

    @Test
    public void testUnsupportedInvalidParam() throws NoSuchMethodException {
        MethodEndpoint endpoint = new MethodEndpoint(this, "unsupportedInvalidParamType", new Class[]{Integer.TYPE});
        Assert.assertFalse("Method supported", adapter.supports(endpoint));
    }
View Full Code Here

TOP

Related Classes of org.springframework.ws.server.endpoint.MethodEndpoint

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.