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.transport.jms;
8   
9   import org.mule.api.MuleException;
10  import org.mule.api.MuleMessage;
11  import org.mule.module.client.MuleClient;
12  import org.mule.tck.junit4.FunctionalTestCase;
13  
14  import org.junit.Test;
15  
16  import static org.junit.Assert.assertEquals;
17  import static org.junit.Assert.assertNotNull;
18  
19  public class ComponentBindingTestCase extends FunctionalTestCase
20  {
21  
22      @Override
23      protected String getConfigResources()
24      {
25          return "org/mule/test/integration/providers/jms/nestedrouter-test.xml";
26      }
27  
28      @Test
29      public void testBinding() throws MuleException
30      {
31          MuleClient client = new MuleClient(muleContext);
32          String message = "Mule";
33          client.dispatch("jms://invoker.in", message, null);
34          MuleMessage reply = client.request("jms://invoker.out", 10000);
35          assertNotNull(reply);
36          assertEquals("Received: Hello " + message + " " + 0xC0DE, reply.getPayload());
37      }
38  }