View Javadoc

1   /*
2    * $Id: InOutOutOnlyAsyncRouterTestCase.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.messaging.meps;
12  
13  import org.mule.api.MuleMessage;
14  import org.mule.module.client.MuleClient;
15  import org.mule.tck.junit4.FunctionalTestCase;
16  
17  import org.junit.Test;
18  
19  import static org.junit.Assert.assertEquals;
20  import static org.junit.Assert.assertNotNull;
21  
22  public class InOutOutOnlyAsyncRouterTestCase extends FunctionalTestCase
23  {
24  
25      public static final long TIMEOUT = 3000;
26  
27      @Override
28      protected String getConfigResources()
29      {
30          return "org/mule/test/integration/messaging/meps/pattern_In-Out_Out-Only-Async-Router.xml";
31      }
32  
33      @Test
34      public void testExchange() throws Exception
35      {
36          MuleClient client = new MuleClient(muleContext);
37  
38          MuleMessage result = client.send("inboundEndpoint", "some data", null);
39          assertNotNull(result);
40          assertEquals("got it!", result.getPayloadAsString());
41  
42          final Object foo = result.getInboundProperty("foo");
43          assertNotNull(foo);
44          assertEquals("bar", foo);
45      }
46  }