1
2
3
4
5
6
7
8
9
10
11 package org.mule.extras.spring.remoting;
12
13 import org.mule.tck.FunctionalTestCase;
14
15 import org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean;
16
17 public class SpringRemotingTestCase extends FunctionalTestCase
18 {
19 private static final String SPRING_HTTP_ENDPOINT = "http://localhost:8003/springService";
20
21 protected String getConfigResources()
22 {
23 return "spring-remoting-mule-config.xml";
24 }
25
26 public void testHttpInvokeSpringService() throws Exception
27 {
28 ComplexData cd = new ComplexData("Foo", new Integer(13));
29 HttpInvokerProxyFactoryBean invoker = new HttpInvokerProxyFactoryBean();
30 invoker.setServiceInterface(WorkInterface.class);
31 invoker.setServiceUrl(SPRING_HTTP_ENDPOINT);
32 invoker.afterPropertiesSet();
33 WorkInterface worker = (WorkInterface)invoker.getObject();
34 ComplexData data = worker.executeComplexity(cd);
35 assertNotNull(data);
36 assertEquals(data.getSomeString(), "Foo Received");
37 assertEquals(data.getSomeInteger(), new Integer(14));
38 }
39 }