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