Package org.springframework.ws.server.endpoint

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


    @Autowired
    private ApplicationContext applicationContext;

    @Test
    public void registration() throws NoSuchMethodException {
        MethodEndpoint jdkProxy = mapping.lookupEndpoint(new QName("http://springframework.org/spring-ws", "Request"));
        assertNotNull("jdk proxy endpoint not registered", jdkProxy);
        Method doIt = MyEndpointImpl.class.getMethod("doIt", Source.class);
        MethodEndpoint expected = new MethodEndpoint("jdkProxyEndpoint", applicationContext, doIt);
        assertEquals("Invalid endpoint registered", expected, jdkProxy);
    }
View Full Code Here


        argumentResolver2 = createMock("intResolver", MethodArgumentResolver.class);
        returnValueHandler = createMock(MethodReturnValueHandler.class);
        adapter.setMethodArgumentResolvers(Arrays.asList(argumentResolver1, argumentResolver2));
        adapter.setMethodReturnValueHandlers(
            Collections.singletonList(returnValueHandler));
        supportedEndpoint = new MethodEndpoint(this, "supported", String.class, Integer.class);
      nullReturnValue = new MethodEndpoint(this, "nullReturnValue", String.class);
        unsupportedEndpoint = new MethodEndpoint(this, "unsupported", String.class);
        exceptionEndpoint = new MethodEndpoint(this, "exception", String.class);
    }
View Full Code Here

    }

    @Test
    public void testNoResponse() throws Exception {
        Method noResponse = getClass().getMethod("noResponse", new Class[]{MyType.class});
        MethodEndpoint methodEndpoint = new MethodEndpoint(this, noResponse);
        expect(unmarshallerMock.unmarshal(isA(Source.class))).andReturn(new MyType());

        replay(marshallerMock, unmarshallerMock);

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

    @Test
    public void testNoRequestPayload() throws Exception {
        MockWebServiceMessage request = new MockWebServiceMessage();
        messageContext = new DefaultMessageContext(request, new MockWebServiceMessageFactory());
        Method noResponse = getClass().getMethod("noResponse", new Class[]{MyType.class});
        MethodEndpoint methodEndpoint = new MethodEndpoint(this, noResponse);

        replay(marshallerMock, unmarshallerMock);

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

    }

    @Test
    public void testResponse() throws Exception {
        Method response = getClass().getMethod("response", new Class[]{MyType.class});
        MethodEndpoint methodEndpoint = new MethodEndpoint(this, response);
        expect(unmarshallerMock.unmarshal(isA(Source.class))).andReturn(new MyType());
        marshallerMock.marshal(isA(MyType.class), isA(Result.class));

        replay(marshallerMock, unmarshallerMock);
View Full Code Here

    }

    @Test
    public void testSupportedNoResponse() throws NoSuchMethodException {
        Method noResponse = getClass().getMethod("noResponse", new Class[]{MyType.class});
        MethodEndpoint methodEndpoint = new MethodEndpoint(this, noResponse);
        expect(unmarshallerMock.supports(MyType.class)).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", new Class[]{MyType.class});
        MethodEndpoint methodEndpoint = new MethodEndpoint(this, response);
        expect(unmarshallerMock.supports(MyType.class)).andReturn(true);
        expect(marshallerMock.supports(MyType.class)).andReturn(true);

        replay(marshallerMock, unmarshallerMock);
View Full Code Here

    public void testUnsupportedMethodMultipleParams() throws NoSuchMethodException {
        Method unsupported = getClass().getMethod("unsupportedMultipleParams", new Class[]{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(String.class)).andReturn(false);
        expect(marshallerMock.supports(String.class)).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", new Class[]{String.class});
        expect(marshallerMock.supports(String.class)).andReturn(false);

        replay(marshallerMock, unmarshallerMock);

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

        verify(marshallerMock, unmarshallerMock);
    }
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.