View Javadoc

1   /*
2    * $Id: AxisServletBindingTestCase.java 20321 2010-11-24 15:21:24Z dfeist $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.transport.soap.axis;
12  
13  import org.mule.transport.servlet.MuleReceiverServlet;
14  import org.mule.transport.servlet.jetty.util.EmbeddedJettyServer;
15  
16  public class AxisServletBindingTestCase extends AbstractSoapFunctionalTestCase
17  {
18      public static int HTTP_PORT;
19  
20      private EmbeddedJettyServer httpServer;
21  
22      @Override
23      protected void doSetUp() throws Exception
24      {
25          super.doSetUp();
26          HTTP_PORT = getPorts().get(0);
27          httpServer = new EmbeddedJettyServer(HTTP_PORT, "/", "/services/*", new MuleReceiverServlet(), muleContext);
28          httpServer.start();
29      }
30  
31      @Override
32      protected void doTearDown() throws Exception
33      {
34          super.doTearDown();
35          // this generates an exception in GenericServlet which we can safely ignore
36          if (httpServer != null)
37          {
38              httpServer.stop();
39              httpServer.destroy();
40          }
41      }
42  
43      @Override
44      public String getConfigResources()
45      {
46          return "axis-test-servlet-mule-config.xml";
47      }
48  
49      @Override
50      protected String getRequestResponseEndpoint()
51      {
52          return "axis:http://localhost:" + HTTP_PORT + "/services/mycomponent?method=echo";
53      }
54  
55      @Override
56      protected String getReceiveEndpoint()
57      {
58          return "axis:http://localhost:" + HTTP_PORT + "/services/mycomponent?method=getDate";
59      }
60  
61      @Override
62      protected String getReceiveComplexEndpoint()
63      {
64          return "axis:http://localhost:" + HTTP_PORT + "/services/mycomponent?method=getPerson&param=Fred";
65      }
66  
67      @Override
68      protected String getSendReceiveComplexEndpoint1()
69      {
70          return "axis:http://localhost:" + HTTP_PORT + "/services/mycomponent?method=addPerson";
71      }
72  
73      @Override
74      protected String getSendReceiveComplexEndpoint2()
75      {
76          return "axis:http://localhost:" + HTTP_PORT + "/services/mycomponent?method=getPerson&param=Dino";
77      }
78  
79      @Override
80      protected String getReceiveComplexCollectionEndpoint()
81      {
82          return "axis:http://localhost:" + HTTP_PORT + "/services/mycomponent?method=getPeople";
83      }
84  
85      @Override
86      protected String getDispatchAsyncComplexEndpoint1()
87      {
88          return "axis:http://localhost:" + HTTP_PORT + "/services/mycomponent?method=addPerson";
89      }
90  
91      @Override
92      protected String getDispatchAsyncComplexEndpoint2()
93      {
94          return "axis:http://localhost:" + HTTP_PORT + "/services/mycomponent?method=getPerson&param=Betty";
95      }
96  
97      @Override
98      protected String getTestExceptionEndpoint()
99      {
100         return "axis:http://localhost:" + HTTP_PORT + "/services/mycomponent?method=getDate";
101     }
102 
103     @Override
104     protected String getWsdlEndpoint()
105     {
106         return "http://localhost:" + HTTP_PORT + "/services/mycomponent?wsdl";
107     }
108 
109     @Override
110     protected int getNumPortsToFind()
111     {
112         return 1;
113     }
114 }