View Javadoc

1   /*
2    * $Id: AxisServletBindingTestCase.java 22450 2011-07-19 08:20:41Z dirk.olmes $
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.tck.junit4.rule.DynamicPort;
14  import org.mule.transport.servlet.MuleReceiverServlet;
15  import org.mule.transport.servlet.jetty.util.EmbeddedJettyServer;
16  
17  import org.junit.Rule;
18  
19  public class AxisServletBindingTestCase extends AbstractSoapFunctionalTestCase
20  {
21  
22      private EmbeddedJettyServer httpServer;
23  
24      @Rule
25      public DynamicPort dynamicPort = new DynamicPort("port1");
26  
27      @Override
28      public String getConfigResources()
29      {
30          return "axis-test-servlet-mule-config.xml";
31      }
32  
33      @Override
34      protected void doSetUp() throws Exception
35      {
36          super.doSetUp();
37          httpServer = new EmbeddedJettyServer(dynamicPort.getNumber(), "/", "/services/*", new MuleReceiverServlet(), muleContext);
38          httpServer.start();
39      }
40  
41      @Override
42      protected void doTearDown() throws Exception
43      {
44          super.doTearDown();
45          // this generates an exception in GenericServlet which we can safely ignore
46          if (httpServer != null)
47          {
48              httpServer.stop();
49              httpServer.destroy();
50          }
51      }
52  
53      @Override
54      protected String getRequestResponseEndpoint()
55      {
56          return "axis:http://localhost:" + dynamicPort.getNumber() + "/services/mycomponent?method=echo";
57      }
58  
59      @Override
60      protected String getReceiveEndpoint()
61      {
62          return "axis:http://localhost:" + dynamicPort.getNumber() + "/services/mycomponent?method=getDate";
63      }
64  
65      @Override
66      protected String getReceiveComplexEndpoint()
67      {
68          return "axis:http://localhost:" + dynamicPort.getNumber() + "/services/mycomponent?method=getPerson&param=Fred";
69      }
70  
71      @Override
72      protected String getSendReceiveComplexEndpoint1()
73      {
74          return "axis:http://localhost:" + dynamicPort.getNumber() + "/services/mycomponent?method=addPerson";
75      }
76  
77      @Override
78      protected String getSendReceiveComplexEndpoint2()
79      {
80          return "axis:http://localhost:" + dynamicPort.getNumber() + "/services/mycomponent?method=getPerson&param=Dino";
81      }
82  
83      @Override
84      protected String getReceiveComplexCollectionEndpoint()
85      {
86          return "axis:http://localhost:" + dynamicPort.getNumber() + "/services/mycomponent?method=getPeople";
87      }
88  
89      @Override
90      protected String getDispatchAsyncComplexEndpoint1()
91      {
92          return "axis:http://localhost:" + dynamicPort.getNumber() + "/services/mycomponent?method=addPerson";
93      }
94  
95      @Override
96      protected String getDispatchAsyncComplexEndpoint2()
97      {
98          return "axis:http://localhost:" + dynamicPort.getNumber() + "/services/mycomponent?method=getPerson&param=Betty";
99      }
100 
101     @Override
102     protected String getTestExceptionEndpoint()
103     {
104         return "axis:http://localhost:" + dynamicPort.getNumber() + "/services/mycomponent?method=getDate";
105     }
106 
107     @Override
108     protected String getWsdlEndpoint()
109     {
110         return "http://localhost:" + dynamicPort.getNumber() + "/services/mycomponent?wsdl";
111     }
112 }