View Javadoc

1   /*
2    * $Id: ReplyToChainIntegration1TestCase.java 19191 2010-08-25 21:05:23Z tcarlson $
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.integration.routing.replyto;
12  
13  import org.mule.api.MuleMessage;
14  import org.mule.api.config.MuleProperties;
15  import org.mule.module.client.MuleClient;
16  import org.mule.tck.FunctionalTestCase;
17  
18  import java.util.HashMap;
19  import java.util.Map;
20  
21  public class ReplyToChainIntegration1TestCase extends FunctionalTestCase
22  {
23  
24      protected String getConfigResources()
25      {
26          return "org/mule/test/integration/routing/replyto/replyto-chain-integration-test-1.xml";
27      }
28  
29      public void testReplyToChain() throws Exception
30      {
31          String message = "test";
32  
33          MuleClient client = new MuleClient(muleContext);
34          Map props = new HashMap();
35          props.put(MuleProperties.MULE_REMOTE_SYNC_PROPERTY, "false");
36          MuleMessage result = client.send("vm://pojo1", message, props);
37          assertNotNull(result);
38          assertEquals("Received: " + message, result.getPayloadAsString());
39      }
40      
41      public void testReplyToChainWithoutProps() throws Exception
42      {
43          String message = "test";
44  
45          MuleClient client = new MuleClient(muleContext);
46          MuleMessage result = client.send("vm://pojo1", message, null);
47          assertNotNull(result);
48          assertEquals("Received: " + message, result.getPayloadAsString());
49      }
50  
51  }