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 public class SoapActionTemplateTestCase extends AbstractMuleTestCase
20 {
21 public void testHostInfoReplace() throws Exception
22 {
23 OutboundEndpoint ep = muleContext.getRegistry().lookupEndpointFactory().getOutboundEndpoint(
24 "axis:http://mycompany.com:8080/services/myService?method=foo");
25
26 AxisMessageDispatcher dispatcher = new AxisMessageDispatcher(ep);
27 MuleEvent event = getTestEvent("test,", ep);
28 String result = dispatcher.parseSoapAction("#[hostInfo]/#[method]", new QName("foo"), event);
29
30 assertEquals("http://mycompany.com:8080/foo", result);
31 }
32
33 public void testHostReplace() throws Exception
34 {
35 OutboundEndpoint ep = muleContext.getRegistry().lookupEndpointFactory().getOutboundEndpoint(
36 "axis:http://mycompany.com:8080/services/myService?method=foo");
37 AxisMessageDispatcher dispatcher = new AxisMessageDispatcher(ep);
38 MuleEvent event = getTestEvent("test,", ep);
39 String name = event.getFlowConstruct().getName();
40 String result = dispatcher.parseSoapAction("#[scheme]://#[host]:#[port]/#[serviceName]/#[method]",
41 new QName("foo"), event);
42
43 assertEquals("http://mycompany.com:8080/" + name + "/foo", result);
44 }
45 }