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;
8   
9   import org.mule.tck.junit4.FunctionalTestCase;
10  import org.mule.tck.junit4.rule.DynamicPort;
11  
12  import org.apache.cxf.Bus;
13  import org.junit.Rule;
14  import org.junit.Test;
15  
16  import static org.junit.Assert.assertNotNull;
17  
18  public class StaxFeatureTestCase extends FunctionalTestCase
19  {
20  
21      @Rule
22      public DynamicPort dynamicPort = new DynamicPort("port1");
23  
24      @Override
25      protected String getConfigResources()
26      {
27          return "stax-feature-conf.xml";
28      }
29  
30      @Test
31      public void testEchoService() throws Exception
32      {
33          CxfConfiguration cxfCon = (CxfConfiguration)muleContext.getRegistry().lookupObject(CxfConstants.DEFAULT_CXF_CONFIGURATION);
34          assertNotNull(cxfCon);
35  
36          Bus cxfBus = cxfCon.getCxfBus();
37  
38          // ensure that our interceptor is there
39  //        assertEquals(2, cxfBus.getInInterceptors().size());
40  //
41  //        MuleClient client = new MuleClient();
42  //        MuleMessage result = client.send("cxf:http://localhost:63081/services/Echo?method=echo", "Hello!", null);
43  //        assertEquals("Hello!", result.getPayload());
44      }
45  
46  }
47