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