1   /*
2    * $Id: WebServiceWrapperWithCxfTestCase.java 12230 2008-07-03 03:43:26Z dfeist $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.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.cxf;
12  
13  import org.mule.DefaultMuleMessage;
14  import org.mule.api.MuleMessage;
15  import org.mule.module.client.MuleClient;
16  import org.mule.tck.FunctionalTestCase;
17  
18  import java.util.Properties;
19  
20  public class WebServiceWrapperWithCxfTestCase extends FunctionalTestCase
21  {
22      private String testString = "test";
23      
24      public void testWsCall() throws Exception
25      {
26          MuleClient client = new MuleClient();
27          MuleMessage result = client.send("vm://testin", new DefaultMuleMessage(testString));
28          assertNotNull(result.getPayload());
29          assertEquals("Payload", testString, result.getPayloadAsString());
30      }
31      
32      public void testWsCallWithUrlFromMessage() throws Exception
33      {
34          MuleClient client = new MuleClient();
35          Properties props = new Properties();
36          props.setProperty("ws.service.url", "http://localhost:65081/services/TestUMO?method=onReceive");
37          MuleMessage result = client.send("vm://testin2", testString, props);
38          assertNotNull(result.getPayload());
39          assertEquals("Payload", testString, result.getPayloadAsString());
40      }
41      
42      protected String getConfigResources()
43      {
44          return "mule-ws-wrapper-config.xml";
45      }
46  }