[JDK 11] RFR 8201528: Add new test to check for package versioning information in OpenJDK
mandy chung
mandy.chung at oracle.com
Thu Jun 7 22:38:16 UTC 2018
Hi Chris,
On 6/7/18 1:32 AM, Chris Yin wrote:
> Please review below new added test to check for package versioning
> information which customized in jar(s) manifest, many thanks
>
> bug: https://bugs.openjdk.java.net/browse/JDK-8201528 webrev:
> http://cr.openjdk.java.net/~xyin/8201528/webrev.00/
Thanks for adding the new test cases that we are missing.
Can you describe all these test cases? In the class javadoc is fine.
32 * @run main PackageFromManifest runJar single
33 * @run main/othervm PackageFromManifest runUrlLoader single
34 * @run main PackageFromManifest runJar 1
35 * @run main PackageFromManifest runJar 2
36 * @run main/othervm PackageFromManifest runUrlLoader 1
37 * @run main/othervm PackageFromManifest runUrlLoader 2
74 if (runType.equalsIgnoreCase("runTest")) {
The test accepts "runTest" but such test case is not listed above.
It'd be good to refactor the main method into separate cases and
a switch/if statement on different runtType will help the readability.
123 runTest(cl.loadClass(
124 PACKAGE_NAME + "." + TEST_CLASS_NAME1)
125 .getPackage(), option);
Can you use Class::forName here?
200 cmds = new String[] { "-cp",
201 TEST_JAR_FILE1 + File.pathSeparator +
TEST_JAR_FILE2,
202 "PackageFromManifest", "runTest", option };
Thanks for adding the split package test. It'd be good to test
1) loading TEST_CLASS_NAME1 first and TEST_CLASS_NAME2 second
2) loading TEST_CLASS_NAME2 first and TEST_CLASS_NAME1 second
Package should use the manifest attribute from the JAR file from
which the first class of package foo is loaded.
Looks like it creates the JAR files each time the non-runTest case
is run. You could do the setup as the first @run and subsequent
@run are executing individual test cases (or make it testng test
if you prefer).
Mandy
More information about the core-libs-dev
mailing list