View Javadoc

1   /*
2    * $Id: JmxAgentEmptyConfigurationTestCase.java 22401 2011-07-13 09:10:18Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  package org.mule.management;
11  
12  import org.mule.module.management.agent.FixedHostRmiClientSocketFactory;
13  import org.mule.tck.junit4.FunctionalTestCase;
14  
15  import java.net.ConnectException;
16  import java.net.Socket;
17  
18  import org.junit.Test;
19  
20  public class JmxAgentEmptyConfigurationTestCase extends FunctionalTestCase
21  {
22  
23      @Override
24      protected String getConfigResources()
25      {
26          return "empty-management-config.xml";
27      }
28  
29      @Test(expected = ConnectException.class)
30      public void testDefaultJmxAgent() throws Exception
31      {
32          FixedHostRmiClientSocketFactory rmiSocketFactory = new FixedHostRmiClientSocketFactory();
33          Socket socket = rmiSocketFactory.createSocket("localhost", 1099);
34          socket.close();
35      }
36  }