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.spring;
8   
9   import org.mule.api.MuleMessage;
10  import org.mule.module.client.MuleClient;
11  import org.mule.module.client.RemoteDispatcher;
12  import org.mule.tck.junit4.FunctionalTestCase;
13  import org.mule.tck.junit4.rule.DynamicPort;
14  
15  import org.junit.Rule;
16  import org.junit.Test;
17  
18  import static org.junit.Assert.assertNotNull;
19  
20  public class MuleAdminTestCase extends FunctionalTestCase
21  {
22  
23      @Rule
24      public DynamicPort dynamicPort = new DynamicPort("port1");
25  
26      @Override
27      protected String getConfigResources()
28      {
29          return "org/mule/test/integration/spring/mule-admin-spring.xml";
30      }
31  
32      @Test
33      public void testMuleAdminChannelInSpring() throws Exception
34      {
35          MuleClient mc = new MuleClient(muleContext);
36          RemoteDispatcher rd = mc.getRemoteDispatcher("tcp://localhost:" + dynamicPort.getNumber());
37          MuleMessage result = rd.sendToRemoteComponent("appleComponent", "string", null);
38          assertNotNull(result);
39      }
40  
41  }