1
2
3
4
5
6
7
8
9
10
11 package org.mule.providers.soap.axis;
12
13 import org.mule.extras.client.MuleClient;
14 import org.mule.impl.MuleMessage;
15 import org.mule.tck.FunctionalTestCase;
16 import org.mule.umo.UMOMessage;
17
18 import java.util.HashMap;
19 import java.util.List;
20 import java.util.Map;
21
22 import org.dom4j.Document;
23 import org.dom4j.DocumentHelper;
24 import org.dom4j.Element;
25
26 public class AxisServiceUsingXFireEndpointTestCase extends FunctionalTestCase
27 {
28
29 public AxisServiceUsingXFireEndpointTestCase()
30 {
31 super();
32 this.setDisposeManagerPerSuite(true);
33 }
34
35 public void testAxis() throws Exception
36 {
37 MuleClient client = new MuleClient();
38 UMOMessage reply = client.send("vm://axis.in", new MuleMessage("Test String"));
39
40 assertNotNull(reply);
41 assertNotNull(reply.getPayload());
42 assertEquals(reply.getPayloadAsString(), "Received: Test String");
43 logger.info(reply.getPayloadAsString());
44 }
45
46 public void testRequestWsdl() throws Exception
47 {
48 MuleClient client = new MuleClient();
49 Map props = new HashMap();
50 props.put("http.method", "GET");
51 UMOMessage reply = client.send("http://localhost:63381/services/AxisService?WSDL", "", props);
52
53 assertNotNull(reply);
54 assertNotNull(reply.getPayload());
55
56 Document document = DocumentHelper.parseText(reply.getPayloadAsString());
57 List nodes;
58
59 nodes = document.selectNodes("//wsdl:definitions/wsdl:service");
60 assertEquals(((Element)nodes.get(0)).attribute("name").getStringValue(), "AxisService");
61 }
62
63 protected String getConfigResources()
64 {
65 return "axis-using-xfire-config.xml";
66 }
67
68 }