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
21
22
23
24 public class SoapActionTemplateTestCase extends AbstractMuleTestCase
25 {
26 public void testHostInfoReplace() throws Exception
27 {
28 UMOImmutableEndpoint ep = new ImmutableMuleEndpoint(
29 "axis:http://mycompany.com:8080/services/myService?method=foo", false);
30 AxisMessageDispatcher dispatcher = new AxisMessageDispatcher(ep);
31 UMOEvent event = getTestEvent("test,", ep);
32 String result = dispatcher.parseSoapAction("${hostInfo}/${method}", new QName("foo"), event);
33
34 assertEquals("http://mycompany.com:8080/foo", result);
35 }
36
37 public void testHostReplace() throws Exception
38 {
39 UMOImmutableEndpoint ep = new ImmutableMuleEndpoint(
40 "axis:http://mycompany.com:8080/services/myService?method=foo", false);
41
42 AxisMessageDispatcher dispatcher = new AxisMessageDispatcher(ep);
43 UMOEvent event = getTestEvent("test,", ep);
44 event.getComponent().getDescriptor().setName("myService");
45 String result = dispatcher.parseSoapAction("${scheme}://${host}:${port}/${serviceName}/${method}",
46 new QName("foo"), event);
47
48 assertEquals("http://mycompany.com:8080/myService/foo", result);
49 }
50 }