View Javadoc

1   /*
2    * $Id: ReplyToChainIntegration1TestCase.java 22422 2011-07-15 08:22:16Z dirk.olmes $
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.junit4.FunctionalTestCase;
17  
18  import java.util.HashMap;
19  import java.util.Map;
20  
21  import org.junit.Test;
22  
23  import static org.junit.Assert.assertEquals;
24  import static org.junit.Assert.assertNotNull;
25  
26  public class ReplyToChainIntegration1TestCase extends FunctionalTestCase
27  {
28  
29      @Override
30      protected String getConfigResources()
31      {
32          return "org/mule/test/integration/routing/replyto/replyto-chain-integration-test-1.xml";
33      }
34  
35      @Test
36      public void testReplyToChain() throws Exception
37      {
38          String message = "test";
39  
40          MuleClient client = new MuleClient(muleContext);
41          Map props = new HashMap();
42          props.put(MuleProperties.MULE_REMOTE_SYNC_PROPERTY, "false");
43          MuleMessage result = client.send("vm://pojo1", message, props);
44          assertNotNull(result);
45          assertEquals("Received: " + message, result.getPayloadAsString());
46      }
47      
48      @Test
49      public void testReplyToChainWithoutProps() throws Exception
50      {
51          String message = "test";
52  
53          MuleClient client = new MuleClient(muleContext);
54          MuleMessage result = client.send("vm://pojo1", message, null);
55          assertNotNull(result);
56          assertEquals("Received: " + message, result.getPayloadAsString());
57      }
58  
59  }