View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.module.cxf.wsa;
8   
9   import org.mule.example.employee.EmployeeDirectory;
10  import org.mule.example.employee.EmployeeDirectory_Service;
11  import org.mule.tck.junit4.FunctionalTestCase;
12  import org.mule.tck.junit4.rule.DynamicPort;
13  
14  import javax.xml.ws.BindingProvider;
15  import javax.xml.ws.soap.AddressingFeature;
16  
17  import org.junit.Rule;
18  import org.junit.Test;
19  
20  public class WSATest extends FunctionalTestCase
21  {
22      @Rule
23      public DynamicPort dynamicPort = new DynamicPort("port1");
24  
25      @Override
26      protected String getConfigResources()
27      {
28          return "wsa-conf.xml";
29      }
30  
31      @Test
32      public void testWSA() throws Exception
33      {
34          EmployeeDirectory_Service svc = new EmployeeDirectory_Service();
35  
36          EmployeeDirectory port = svc.getEmployeeDirectoryPort(new AddressingFeature());
37          BindingProvider bp = (BindingProvider) port;
38          bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
39              "http://localhost:" + dynamicPort.getNumber() + "/services/employee");
40      }
41  
42  }
43  
44