View Javadoc

1   /*
2    * $Id: FlowSynchronousProcessingStrategyTestCase.java 22629 2011-08-10 01:26:58Z dfeist $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.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 org.mule.api.MuleMessage;
14  import org.mule.api.client.MuleClient;
15  
16  public class FlowSynchronousProcessingStrategyTestCase extends FlowDefaultProcessingStrategyTestCase
17  {
18  
19      @Override
20      protected String getConfigResources()
21      {
22          return "org/mule/test/construct/flow-synchronous-processing-strategy-config.xml";
23      }
24  
25      public void testDispatchToOneWayInbound() throws Exception
26      {
27          MuleClient client = muleContext.getClient();
28          client.dispatch("vm://oneway-in", "a", null);
29  
30          MuleMessage result = client.request("vm://oneway-out", RECEIVE_TIMEOUT);
31  
32          assertAllProcessingInRecieverThread(result);
33      }
34  
35      public void testSendToOneWayInbound() throws Exception
36      {
37          MuleClient client = muleContext.getClient();
38          MuleMessage response = client.send("vm://oneway-in", "a", null);
39  
40          assertNull(response);
41  
42          MuleMessage result = client.request("vm://oneway-out", RECEIVE_TIMEOUT);
43  
44          assertAllProcessingInClientThread(result);
45      }
46  
47      @Override
48      public void testDispatchToOneWayOutboundTxOnly() throws Exception
49      {
50          MuleClient client = muleContext.getClient();
51          client.dispatch("vm://oneway-outboundtx-in", "a", null);
52  
53          MuleMessage result = client.request("vm://oneway-outboundtx-out", RECEIVE_TIMEOUT);
54  
55          assertAllProcessingInRecieverThread(result);
56      }
57  
58  }