jdk/test/sun/management/jdp/README
author dsamersoff
Thu, 09 Oct 2014 06:49:13 -0700
changeset 26971 f170b364177d
parent 21646 38f9ba0664de
permissions -rw-r--r--
8059037: JdpTest.sh hangs when trying to kill the test VM Summary: Removed shell tests enable java ones Reviewed-by: sla, miauno
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
26971
f170b364177d 8059037: JdpTest.sh hangs when trying to kill the test VM
dsamersoff
parents: 21646
diff changeset
     1
The tests in this folder are contributed by alex.schenkman@oracle.com
21646
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
     2
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
     3
There are three Jdp test cases in this folder:
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
     4
 1) Jdp is turned off.
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
     5
 2) Jdp is turned on, using default values
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
     6
 3) Jdp is turned on, using a specific IP and port
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
     7
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
     8
For the test cases above, the actual tests are:
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
     9
 1) JdpOffTestCase.java
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    10
 2) JdpOnTestCase.java
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    11
 3) JdpOnTestCase.java, using different parameters.
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    12
All these three test are implemented as subclasses of JdpTestCase.java.
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    13
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    14
For all of these three tests, the VM sending the Jdp packets is also catching them.
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    15
That is, while the VM itself is sending Jdp multicast packets, the program executed by
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    16
that same VM is listening for those packets.
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    17
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    18
These tests above work as follows:
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    19
 1) Start a VM with Jdp off, make sure that no Jdp packets arrive at the default IP/port.
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    20
 2) Start a VM with Jdp on, make sure three packets arrive at the default IP/port.
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    21
 3) Start a VM with Jdp on a specific IP/port, make sure three packets arrive.
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    22
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    23
To make sure that we are not catching Jdp packets from some other VM, the INSTANCE_NAME
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    24
attribute is set to a unique id. The setting of this unique id is done by a launcher.
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    25
There are three launchers, one for each of the tests above:
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    26
 1) JdpOffTest.java
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    27
 2) JdpDefaultsTest.java
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    28
 3) JdpSpecificAddressTest.java
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    29
All these three tests are implemented as subclasses of DynamicLauncher.java.
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    30
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    31
So, JdpOffTest.class will execute JdpOffTestCase.class (using ProcessTools),
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    32
and that will exercise test case nr.1; and so on for the other cases.
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    33
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    34
These launchers are also the entry points for JTreg.
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    35
This means that JTreg will only see these launchers as tests.
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    36
You might run the tests without JTreg, as long as you specify all the VM optiones needed.
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    37
Look at the launcher to determine what is needed. Do not forget -Dtest.jdk, that is set by JTreg.
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    38
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    39
JMX must be enabled in order to enable Jdp. This requires a free port (com.sun.management.jmxremote.port).
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    40
To avoid port-busy conflicts, DynamicLauncher.java will try to find a free port up to three times.
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    41
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    42
There are some other tests used for test development, and not meant to be run automatically by JTreg.
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    43
 1) PortAlreadyInUse.java, used to test the retry mechanism to find a free port.
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    44
 2) PacketTest.java, Jdp packet sanity.
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    45
 3) JdpTestUtil.java, Utility functions to read a Jdp packet.
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    46
 4) JdpTestUtilTest.java, Unit tests for JdpTestUtil.java