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.management;
8   
9   import org.mule.api.MuleException;
10  import org.mule.module.management.agent.JmxAgent;
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 ManagementStartupTestCase extends FunctionalTestCase
19  {
20  
21      @Override
22      protected String getConfigResources()
23      {
24          return "org/mule/test/integration/management/management-startup-test.xml";
25      }
26  
27      @Test
28      public void testAgentConfiguration() throws MuleException
29      {
30          JmxAgent agent = muleContext.getRegistry().lookupObject(JmxAgent.class);
31          assertNotNull(agent);
32          assertNotNull(agent.getConnectorServerUrl());
33          assertEquals("service:jmx:rmi:///jndi/rmi://0.0.0.0:1100/server", agent.getConnectorServerUrl());
34          assertNotNull(agent.getConnectorServerProperties());
35          assertEquals("true", agent.getConnectorServerProperties().get("jmx.remote.jndi.rebind"));
36      }
37  
38  }