jdk/test/sun/management/jdp/README
author alexsch
Thu, 31 Jul 2014 14:28:10 +0400
changeset 26019 10a56d28f48d
parent 21646 38f9ba0664de
child 26971 f170b364177d
permissions -rw-r--r--
8051838: [Findbugs]sun.awt.image.MultiResolutionCachedImage expose internal representation Reviewed-by: serb, pchelko
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
21646
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
     1
The following test were contributed by dmitry.samersoff@oracle.com and will be ported in the near future:
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
     2
JdpClient.java
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
     3
JdpDoSomething.java  
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
     4
JdpTest.sh  
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
     5
JdpUnitTest.java
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
     6
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
     7
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
     8
JdpTest.sh:
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
     9
-------------------------------------
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    10
test_01 - basic test, check if JDP packet assembler and other
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    11
          parts of JDP is not broken
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    12
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    13
test_02 - test if JDP starts with custom parameters. (disabled)
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    14
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    15
test_03 - test if jcmd is able to start jdp with
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    16
          custom parameters (disabled)
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    17
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    18
test_04 - test if JDP starts with default parameters (disabled)
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    19
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    20
test_05 - test if jcmd is able to start jdp with default
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    21
          parameters (disabled)
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    22
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    23
Only test_01 is enabled at the moment.
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    24
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    25
JdpUnitTest.java: contains unit tests used under development.
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    26
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    27
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    28
==========================================================================
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    29
The other Java-based tests in this folder are contributed by alex.schenkman@oracle.com
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    30
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    31
There are three Jdp test cases in this folder:
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    32
 1) Jdp is turned off.
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    33
 2) Jdp is turned on, using default values
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    34
 3) Jdp is turned on, using a specific IP and port
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    35
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    36
For the test cases above, the actual tests are:
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    37
 1) JdpOffTestCase.java
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    38
 2) JdpOnTestCase.java
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    39
 3) JdpOnTestCase.java, using different parameters.
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    40
All these three test are implemented as subclasses of JdpTestCase.java.
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    41
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    42
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
    43
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
    44
that same VM is listening for those packets.
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    45
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    46
These tests above work as follows:
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    47
 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
    48
 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
    49
 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
    50
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    51
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
    52
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
    53
There are three launchers, one for each of the tests above:
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    54
 1) JdpOffTest.java
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    55
 2) JdpDefaultsTest.java
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    56
 3) JdpSpecificAddressTest.java
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    57
All these three tests are implemented as subclasses of DynamicLauncher.java.
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    58
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    59
So, JdpOffTest.class will execute JdpOffTestCase.class (using ProcessTools),
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    60
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
    61
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    62
These launchers are also the entry points for JTreg.
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    63
This means that JTreg will only see these launchers as tests.
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    64
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
    65
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
    66
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    67
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
    68
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
    69
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    70
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
    71
 1) PortAlreadyInUse.java, used to test the retry mechanism to find a free port.
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    72
 2) PacketTest.java, Jdp packet sanity.
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    73
 3) JdpTestUtil.java, Utility functions to read a Jdp packet.
38f9ba0664de 8014506: Test of Jdp feature
sla
parents:
diff changeset
    74
 4) JdpTestUtilTest.java, Unit tests for JdpTestUtil.java