Proposed jimage refresh for JDK9
Christian Tornqvist
christian.tornqvist at oracle.com
Mon May 18 17:51:33 UTC 2015
Hi Jim,
I've looked a bit at the Hotspot test code and here are my initial findings:
General things:
* Don't print things like "Passed"/"Failed" on stdout, when tests are passing no output is needed, when tests are failing it should throw an exception with a helpful message. "Some cases are failed" is not a helpful message.
* Some more comments explaining what the test is trying to do would be useful
* Use the asserts available in jdk.test.lib.Asserts, for example you can replace the following code:
if (array != null) {
System.out.printf("Passed. Offsets\' array retrieved with %s flag", mm);
} else {
System.out.printf("Failed. Could not retrieve offsets\' array with %s flag", mm);
passed = false;
}
with
assertNotNull(array, "Could not retrieve offsets\' array");
* We don't put @author tags in our tests
* The test*() methods code should be moved into main
hotspot/test/runtime/modules/ImageFile/ImageAttributeOffsetsTest.java
* The whole +/-MemoryMapImage can be simplified, simply remove the +/- arguments to the tests and remove all the command line argument parsing code. The .jtr file will tell you what the command line options was when it failed.
hotspot/test/runtime/modules/ImageFile/ImageCloseTest.java
* How would this test fail? I can't see a way that testImageClose() doesn't return true
hotspot/test/runtime/modules/ImageFile/ImageGetDataAddressTest.java
* No need to loop through the arguments, simply do 'boolean isMMap = args[0].equals("+");'
* No need to print the VM arguments on stdout, jtreg will do that for you
hotspot/test/runtime/modules/ImageFile/ImageReadCompressedTest.java
* Why is this test in here? It doesn't do anything but seems to be a placeholder, please remove it.
hotspot/test/runtime/modules/ImageFile/ImageReadTest.java
* No need to loop through the arguments, simply do 'boolean isMMap = args[0].equals("+");'
* No need to print the VM arguments on stdout, jtreg will do that for you
Thanks,
Christian
-----Original Message-----
From: hotspot-runtime-dev [mailto:hotspot-runtime-dev-bounces at openjdk.java.net] On Behalf Of Jim Laskey (Oracle)
Sent: Friday, May 15, 2015 11:45 AM
To: hotspot-runtime-dev at openjdk.java.net; jigsaw-dev at openjdk.java.net
Subject: RFR: Proposed jimage refresh for JDK9
http://cr.openjdk.java.net/~jlaskey/jdk9-jimage/top/ <http://cr.openjdk.java.net/~jlaskey/jdk9-jimage/top/>
http://cr.openjdk.java.net/~jlaskey/jdk9-jimage/hotspot/ <http://cr.openjdk.java.net/~jlaskey/jdk9-jimage/hotspot/>
http://cr.openjdk.java.net/~jlaskey/jdk9-jimage/jdk/ <http://cr.openjdk.java.net/~jlaskey/jdk9-jimage/jdk/>
http://cr.openjdk.java.net/~jlaskey/jdk9-jimage/langtools/ <http://cr.openjdk.java.net/~jlaskey/jdk9-jimage/langtools/>
There are some issues with regard to the hotspot changes, but I’m working with Coleen and John R. to resolve those.
Cheers,
— Jim
More information about the jigsaw-dev
mailing list