View Javadoc

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