< prev index next >

test/jdk/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java

Print this page
rev 51638 : [mq]: 8210112


  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 import java.io.File;
  25 import java.net.InetAddress;
  26 import java.net.NetworkInterface;
  27 import java.net.SocketException;
  28 import java.util.ArrayList;
  29 import java.util.List;
  30 import java.util.stream.Collectors;
  31 
  32 import jdk.test.lib.thread.ProcessThread;
  33 import jdk.testlibrary.ProcessTools;
  34 
  35 /**
  36  * NOTE:
  37  *    This test requires at least a setup similar to the following in
  38  *    /etc/hosts file (or the windows equivalent). I.e. it expects it to
  39  *    be multi-homed and not both being the loop-back interface.
  40  *    For example:
  41  *    ----->8-------- /etc/hosts ----------->8---
  42  *    127.0.0.1   localhost
  43  *    192.168.0.1 localhost
  44  *    ----->8-------- /etc/hosts ----------->8---
  45  *
  46  * @test
  47  * @bug     6425769
  48  * @summary Test JMX agent host address binding. Same ports but different
  49  *          interfaces to bind to (using plain sockets and SSL sockets).
  50  *
  51  * @library /lib/testlibrary
  52  * @library /test/lib
  53  * @modules java.management.rmi
  54  *
  55  * @build jdk.testlibrary.* JMXAgentInterfaceBinding
  56  * @run main/timeout=5 JMXInterfaceBindingTest
  57  */
  58 public class JMXInterfaceBindingTest {
  59 
  60     public static final int COMMUNICATION_ERROR_EXIT_VAL = 1;
  61     public static final int STOP_PROCESS_EXIT_VAL = 143;
  62     public static final int JMX_PORT = 9111;
  63     public static final int RMI_PORT = 9112;
  64     public static final String READY_MSG = "MainThread: Ready for connections";
  65     public static final String TEST_CLASS = JMXAgentInterfaceBinding.class.getSimpleName();
  66     public static final String KEYSTORE_LOC = System.getProperty("test.src", ".") +
  67                                               File.separator +
  68                                               "ssl" +
  69                                               File.separator +
  70                                               "keystore";
  71     public static final String TRUSTSTORE_LOC = System.getProperty("test.src", ".") +
  72                                                 File.separator +
  73                                                 "ssl" +
  74                                                 File.separator +
  75                                                 "truststore";




  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 import java.io.File;
  25 import java.net.InetAddress;
  26 import java.net.NetworkInterface;
  27 import java.net.SocketException;
  28 import java.util.ArrayList;
  29 import java.util.List;
  30 import java.util.stream.Collectors;
  31 
  32 import jdk.test.lib.thread.ProcessThread;
  33 import jdk.test.lib.process.ProcessTools;
  34 
  35 /**
  36  * NOTE:
  37  *    This test requires at least a setup similar to the following in
  38  *    /etc/hosts file (or the windows equivalent). I.e. it expects it to
  39  *    be multi-homed and not both being the loop-back interface.
  40  *    For example:
  41  *    ----->8-------- /etc/hosts ----------->8---
  42  *    127.0.0.1   localhost
  43  *    192.168.0.1 localhost
  44  *    ----->8-------- /etc/hosts ----------->8---
  45  *
  46  * @test
  47  * @bug     6425769
  48  * @summary Test JMX agent host address binding. Same ports but different
  49  *          interfaces to bind to (using plain sockets and SSL sockets).
  50  *

  51  * @library /test/lib
  52  * @modules java.management.rmi
  53  *
  54  * @build JMXAgentInterfaceBinding
  55  * @run main/timeout=5 JMXInterfaceBindingTest
  56  */
  57 public class JMXInterfaceBindingTest {
  58 
  59     public static final int COMMUNICATION_ERROR_EXIT_VAL = 1;
  60     public static final int STOP_PROCESS_EXIT_VAL = 143;
  61     public static final int JMX_PORT = 9111;
  62     public static final int RMI_PORT = 9112;
  63     public static final String READY_MSG = "MainThread: Ready for connections";
  64     public static final String TEST_CLASS = JMXAgentInterfaceBinding.class.getSimpleName();
  65     public static final String KEYSTORE_LOC = System.getProperty("test.src", ".") +
  66                                               File.separator +
  67                                               "ssl" +
  68                                               File.separator +
  69                                               "keystore";
  70     public static final String TRUSTSTORE_LOC = System.getProperty("test.src", ".") +
  71                                                 File.separator +
  72                                                 "ssl" +
  73                                                 File.separator +
  74                                                 "truststore";


< prev index next >