View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.test.integration.messaging.meps;
8   
9   import org.mule.api.MuleMessage;
10  import org.mule.module.client.MuleClient;
11  import org.mule.tck.junit4.FunctionalTestCase;
12  
13  import org.junit.Test;
14  
15  import static org.junit.Assert.assertEquals;
16  import static org.junit.Assert.assertNotNull;
17  
18  public class BindingInOnlyInOutOutOnlyTestCase extends FunctionalTestCase
19  {
20  
21      public static final long TIMEOUT = 3000;
22  
23      @Override
24      protected String getConfigResources()
25      {
26          return "org/mule/test/integration/messaging/meps/pattern_binding-In-Only_In-Out_Out-Only.xml";
27      }
28  
29      @Test
30      public void testExchange() throws Exception
31      {
32          MuleClient client = new MuleClient(muleContext);
33  
34          client.dispatch("inboundEndpoint", new int[]{1,2,3,4,5}, null);
35  
36          MuleMessage result = client.request("receivedEndpoint", TIMEOUT);
37          assertNotNull(result);
38          assertEquals("Total: 15", result.getPayloadAsString());
39      }
40  }