1
2
3
4
5
6
7
8
9
10
11 package org.mule.transport.soap.axis;
12
13 import org.mule.api.MuleEvent;
14 import org.mule.api.endpoint.OutboundEndpoint;
15 import org.mule.tck.AbstractMuleTestCase;
16
17 import javax.xml.namespace.QName;
18
19
20
21
22 public class SoapActionTemplateTestCase extends AbstractMuleTestCase
23 {
24 public void testHostInfoReplace() throws Exception
25 {
26 OutboundEndpoint ep = muleContext.getRegistry().lookupEndpointFactory().getOutboundEndpoint(
27 "axis:http://mycompany.com:8080/services/myService?method=foo");
28
29 AxisMessageDispatcher dispatcher = new AxisMessageDispatcher(ep);
30 MuleEvent event = getTestEvent("test,", ep);
31 String result = dispatcher.parseSoapAction("[hostInfo]/[method]", new QName("foo"), event);
32
33 assertEquals("http://mycompany.com:8080/foo", result);
34 }
35
36 public void testHostReplace() throws Exception
37 {
38 OutboundEndpoint ep = muleContext.getRegistry().lookupEndpointFactory().getOutboundEndpoint(
39 "axis:http://mycompany.com:8080/services/myService?method=foo");
40 AxisMessageDispatcher dispatcher = new AxisMessageDispatcher(ep);
41 MuleEvent event = getTestEvent("test,", ep);
42 event.getService().setName("myService");
43 String result = dispatcher.parseSoapAction("[scheme]://[host]:[port]/[serviceName]/[method]",
44 new QName("foo"), event);
45
46 assertEquals("http://mycompany.com:8080/myService/foo", result);
47 }
48 }