21646
|
1 |
The following test were contributed by dmitry.samersoff@oracle.com and will be ported in the near future:
|
|
2 |
JdpClient.java
|
|
3 |
JdpDoSomething.java
|
|
4 |
JdpTest.sh
|
|
5 |
JdpUnitTest.java
|
|
6 |
|
|
7 |
|
|
8 |
JdpTest.sh:
|
|
9 |
-------------------------------------
|
|
10 |
test_01 - basic test, check if JDP packet assembler and other
|
|
11 |
parts of JDP is not broken
|
|
12 |
|
|
13 |
test_02 - test if JDP starts with custom parameters. (disabled)
|
|
14 |
|
|
15 |
test_03 - test if jcmd is able to start jdp with
|
|
16 |
custom parameters (disabled)
|
|
17 |
|
|
18 |
test_04 - test if JDP starts with default parameters (disabled)
|
|
19 |
|
|
20 |
test_05 - test if jcmd is able to start jdp with default
|
|
21 |
parameters (disabled)
|
|
22 |
|
|
23 |
Only test_01 is enabled at the moment.
|
|
24 |
|
|
25 |
JdpUnitTest.java: contains unit tests used under development.
|
|
26 |
|
|
27 |
|
|
28 |
==========================================================================
|
|
29 |
The other Java-based tests in this folder are contributed by alex.schenkman@oracle.com
|
|
30 |
|
|
31 |
There are three Jdp test cases in this folder:
|
|
32 |
1) Jdp is turned off.
|
|
33 |
2) Jdp is turned on, using default values
|
|
34 |
3) Jdp is turned on, using a specific IP and port
|
|
35 |
|
|
36 |
For the test cases above, the actual tests are:
|
|
37 |
1) JdpOffTestCase.java
|
|
38 |
2) JdpOnTestCase.java
|
|
39 |
3) JdpOnTestCase.java, using different parameters.
|
|
40 |
All these three test are implemented as subclasses of JdpTestCase.java.
|
|
41 |
|
|
42 |
For all of these three tests, the VM sending the Jdp packets is also catching them.
|
|
43 |
That is, while the VM itself is sending Jdp multicast packets, the program executed by
|
|
44 |
that same VM is listening for those packets.
|
|
45 |
|
|
46 |
These tests above work as follows:
|
|
47 |
1) Start a VM with Jdp off, make sure that no Jdp packets arrive at the default IP/port.
|
|
48 |
2) Start a VM with Jdp on, make sure three packets arrive at the default IP/port.
|
|
49 |
3) Start a VM with Jdp on a specific IP/port, make sure three packets arrive.
|
|
50 |
|
|
51 |
To make sure that we are not catching Jdp packets from some other VM, the INSTANCE_NAME
|
|
52 |
attribute is set to a unique id. The setting of this unique id is done by a launcher.
|
|
53 |
There are three launchers, one for each of the tests above:
|
|
54 |
1) JdpOffTest.java
|
|
55 |
2) JdpDefaultsTest.java
|
|
56 |
3) JdpSpecificAddressTest.java
|
|
57 |
All these three tests are implemented as subclasses of DynamicLauncher.java.
|
|
58 |
|
|
59 |
So, JdpOffTest.class will execute JdpOffTestCase.class (using ProcessTools),
|
|
60 |
and that will exercise test case nr.1; and so on for the other cases.
|
|
61 |
|
|
62 |
These launchers are also the entry points for JTreg.
|
|
63 |
This means that JTreg will only see these launchers as tests.
|
|
64 |
You might run the tests without JTreg, as long as you specify all the VM optiones needed.
|
|
65 |
Look at the launcher to determine what is needed. Do not forget -Dtest.jdk, that is set by JTreg.
|
|
66 |
|
|
67 |
JMX must be enabled in order to enable Jdp. This requires a free port (com.sun.management.jmxremote.port).
|
|
68 |
To avoid port-busy conflicts, DynamicLauncher.java will try to find a free port up to three times.
|
|
69 |
|
|
70 |
There are some other tests used for test development, and not meant to be run automatically by JTreg.
|
|
71 |
1) PortAlreadyInUse.java, used to test the retry mechanism to find a free port.
|
|
72 |
2) PacketTest.java, Jdp packet sanity.
|
|
73 |
3) JdpTestUtil.java, Utility functions to read a Jdp packet.
|
|
74 |
4) JdpTestUtilTest.java, Unit tests for JdpTestUtil.java
|