1
2
3
4
5
6
7
8
9
10
11 package org.mule.module.cxf;
12
13 import org.mule.DefaultMuleMessage;
14 import org.mule.api.MuleMessage;
15 import org.mule.module.client.MuleClient;
16 import org.mule.tck.FunctionalTestCase;
17
18 import java.util.Properties;
19
20 public class WebServiceWrapperWithCxfTestCase extends FunctionalTestCase
21 {
22 private String testString = "test";
23
24 public void testWsCall() throws Exception
25 {
26 MuleClient client = new MuleClient(muleContext);
27 MuleMessage result = client.send("vm://testin", new DefaultMuleMessage(testString, muleContext));
28 assertNotNull(result.getPayload());
29 assertEquals("Payload", testString, result.getPayloadAsString());
30 }
31
32 public void testWsCallWithUrlFromMessage() throws Exception
33 {
34 MuleClient client = new MuleClient(muleContext);
35 Properties props = new Properties();
36 props.setProperty("ws.service.url", "http://localhost:65081/services/TestUMO?method=onReceive");
37 MuleMessage result = client.send("vm://testin2", testString, props);
38 assertNotNull(result.getPayload());
39 assertEquals("Payload", testString, result.getPayloadAsString());
40 }
41
42 protected String getConfigResources()
43 {
44 return "mule-ws-wrapper-config.xml";
45 }
46 }