Tests (Was Warnings Cleanup in java.util.<various> (more from hack day))

Alan Bateman Alan.Bateman at oracle.com
Sat Dec 3 07:36:36 PST 2011


On 03/12/2011 11:27, Martijn Verburg wrote:
> Hi all,
>
> So the recent warnings clean up exercise got me thinking about the
> approach we took and how we could make it safer by applying/running
> tests in some of these areas. I'm very new to the OpenJDK, but I
> figure there must be a suite of tests (for the TCK if nothing else).
> Is that the set of tests that are typically run? Or is there another
> test suite that can be run/added to?
>
> For example I feel that could/should have written a unit test for the
> write method in the Manifest class that I had my recent brain melt in
> :-)
>
There are lots of tests in the jdk repository (lots in langtools and 
some tests in the hotspot repository too). In order to run them then 
you'll need the jtreg test harness [1]. We probably need better 
documentation on the OpenJDK site for how to run the tests but one 
useful thing to know is that the make file in jdk/test directory has 
make targets that run the tests for many areas of the libraries. In this 
case you are working on java.util classes and we have a jdk_util target 
in the make file that runs the tests in jdk/test/java/util/**. You can 
run them with:

make JT_HOME=<jtreg-location> jdk_util

This locates your build in the default output directory so if it's 
somewhere else when you'll need to specify PRODUCT_HOME=<myjdk> to point 
it to the JDK that you are testing.

It's possible that your sponsor (maybe Sherman in this case) will run 
the tests before pushing the changes but we need to get more people used 
to running the tests too.

-Alan.

[1] http://openjdk.java.net/jtreg/



More information about the jdk8-dev mailing list