View Javadoc

1   /*
2    * $Id: AxisConnectorHttpsTestCase.java 19841 2010-10-05 23:17:20Z dzapata $
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.DefaultMuleMessage;
14  import org.mule.RequestContext;
15  import org.mule.api.MuleEvent;
16  import org.mule.api.MuleMessage;
17  import org.mule.api.endpoint.InboundEndpoint;
18  import org.mule.module.client.MuleClient;
19  import org.mule.tck.DynamicPortTestCase;
20  import org.mule.transport.http.HttpsConnector;
21  
22  public class AxisConnectorHttpsTestCase extends DynamicPortTestCase
23  {
24      public void testHttpsConnection() throws Exception{
25          MuleClient client = new MuleClient(muleContext);
26          MuleMessage m = client.send(((InboundEndpoint) client.getMuleContext().getRegistry().lookupObject("inTestUMO")).getAddress() + "?method=echo",new DefaultMuleMessage("hello", muleContext));
27          assertNotNull(m);
28          
29          // check that our https connector is being used
30          MuleEvent event = RequestContext.getEvent();
31          assertTrue (event.getEndpoint().getConnector() instanceof HttpsConnector);
32          assertTrue(event.getEndpoint().getConnector().getName().equals("myHttpsConnector"));
33      }
34      
35      protected String getConfigResources()
36      {
37          return "axis-https-connector-config.xml";
38      }
39  
40      @Override
41      protected int getNumPortsToFind()
42      {
43          return 1;
44      }
45  }
46  
47