View Javadoc

1   /*
2    * $Id: FlowOutboundInMiddleOfFlowTestCase.java 22677 2011-08-16 09:03:54Z justin.calleja $
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.construct;
12  
13  import static org.junit.Assert.*;
14  
15  import org.junit.Test;
16  import org.mule.api.MuleMessage;
17  import org.mule.api.client.MuleClient;
18  import org.mule.tck.junit4.FunctionalTestCase;
19  
20  public class FlowOutboundInMiddleOfFlowTestCase extends FunctionalTestCase
21  {
22  
23      @Override
24      protected String getConfigResources()
25      {
26          return "org/mule/test/construct/flow-outbound-in-middle-of-flow.xml";
27      }
28      
29      @Test
30      public void testOutboundInMiddleOfFlow() throws Exception
31      {
32          MuleClient client = muleContext.getClient();
33          
34          client.dispatch("vm://test.in", "message", null);
35          
36          MuleMessage msg = client.request("vm://test.out.1", 1000);
37          assertEquals("messagehello", msg.getPayloadAsString());
38          
39          MuleMessage msg2 = client.request("vm://test.out.2", 5000);        
40          assertEquals("messagebye", msg2.getPayloadAsString());
41          
42          MuleMessage msg3 = client.request("vm://test.out.3", 5000);        
43          assertEquals("egassem", msg3.getPayloadAsString());
44      }
45  
46      
47  }
48  
49