View Javadoc

1   /*
2    * $Id: ClientBridgeTestCase.java 19856 2010-10-06 21:36:13Z 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.test.usecases.axis.clientbridge;
12  
13  import org.mule.api.MuleMessage;
14  import org.mule.module.client.MuleClient;
15  import org.mule.tck.DynamicPortTestCase;
16  import org.mule.tck.FunctionalTestCase;
17  
18  public class ClientBridgeTestCase extends DynamicPortTestCase
19  {
20  
21      protected String getConfigResources()
22      {
23          return "org/mule/test/usecases/axis/clientbridge/client-mule-config.xml";
24      }
25  
26      public void testBridgeVMToAxis() throws Exception
27      {
28          MuleClient client = new MuleClient(muleContext);
29          MuleMessage message = client.send("vm://complexRequest", new ComplexData("Foo", new Integer(84)), null);
30  
31          assertNotNull(message);
32          assertTrue(message.getPayload() instanceof ComplexData);
33          ComplexData result = (ComplexData)message.getPayload();
34          assertEquals(new Integer(84), result.getSomeInteger());
35          assertEquals("Foo", result.getSomeString());
36  
37      }
38  
39      @Override
40      protected int getNumPortsToFind()
41      {
42          return 1;
43      }
44  }