View Javadoc

1   /*
2    * $Id: FlowRefTestCase.java 22694 2011-08-17 11:44:57Z 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.assertEquals;
14  
15  import org.junit.Test;
16  import org.mule.DefaultMuleMessage;
17  import org.mule.api.MuleMessage;
18  import org.mule.api.client.MuleClient;
19  import org.mule.tck.junit4.FunctionalTestCase;
20  
21  public class FlowRefTestCase extends FunctionalTestCase
22  {
23  
24      @Override
25      protected String getConfigResources()
26      {
27          return "org/mule/test/construct/flow-ref.xml";
28      }   
29  
30      @Test
31      public void testTwoFlowRefsToSubFlow() throws Exception
32      {
33          MuleClient client = muleContext.getClient();
34  
35          MuleMessage msg = client.send("vm://two.flow.ref.to.sub.flow",
36              new DefaultMuleMessage("0", muleContext));
37          
38          assertEquals("012xyzabc312xyzabc3", msg.getPayloadAsString());        
39          
40      }
41  
42  }