View Javadoc

1   /*
2    * $Id: InOutOutInTestCase.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 java.util.HashMap;
18  import java.util.Map;
19  
20  import org.junit.Test;
21  
22  import static org.junit.Assert.assertEquals;
23  import static org.junit.Assert.assertNotNull;
24  
25  public class InOutOutInTestCase extends FunctionalTestCase
26  {
27  
28      public static final long TIMEOUT = 3000;
29  
30      @Override
31      protected String getConfigResources()
32      {
33          return "org/mule/test/integration/messaging/meps/pattern_In-Out_Out-In.xml";
34      }
35  
36      @Test
37      public void testExchange() throws Exception
38      {
39          MuleClient client = new MuleClient(muleContext);
40  
41          Map props = new HashMap();
42          props.put("foo", "bar");
43          MuleMessage result = client.send("inboundEndpoint", "some data", props);
44          assertNotNull(result);
45          assertEquals("bar header received", result.getPayload());
46      }
47  }