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.management.agents;
8   
9   import org.mule.management.AbstractMuleJmxTestCase;
10  import org.mule.module.management.agent.Mx4jAgent;
11  
12  import mx4j.tools.adaptor.http.HttpAdaptor;
13  import org.junit.Test;
14  
15  /**
16   * Test that the lifecycle is properly managed.
17   */
18  public class Mx4jAgentTestCase extends AbstractMuleJmxTestCase
19  {
20      @Test
21      public void testRedeploy() throws Exception
22      {
23          final String name = jmxSupport.getDomainName(muleContext) +
24                              ":" + Mx4jAgent.HTTP_ADAPTER_OBJECT_NAME;
25          mBeanServer.registerMBean(new HttpAdaptor(), jmxSupport.getObjectName(name));
26  
27          Mx4jAgent agent = new Mx4jAgent();
28          agent.setMuleContext(muleContext);
29          agent.initialise();
30      }
31  }