How can you run jtreg with jdk-base-image?
mandy.chung at oracle.com
Wed Aug 31 13:59:26 PDT 2011
On 08/31/11 13:36, Sean Mullan wrote:
> On 8/31/11 4:29 PM, Alan Bateman wrote:
>> Sean Mullan wrote:
>>> I'm trying to run tests with only a jdk-base-image but I am getting errors
>>> because jtreg can't find classes that aren't in the installed modules. Is it
>>> possible to run jtreg with this type of setup?
>> Is it classes that jtreg needs or classes that the tests need?
> jtreg. Here's the exception stack trace:
> Exception in thread "main" java.lang.NoClassDefFoundError:
> at javax.help.HelpSet.findHelpSet(HelpSet.java:169)
> at javax.help.HelpSet.findHelpSet(HelpSet.java:200)
> at javax.help.HelpSet.findHelpSet(HelpSet.java:213)
> at com.sun.interview.Interview.setHelpSet(Interview.java:380)
> at com.sun.javatest.interview.TestsInterview.<init>(TestsInterview.java:72)
> at com.sun.javatest.regtest.Main.createParameters(Main.java:1434)
> at com.sun.javatest.regtest.Main.run(Main.java:979)
> at com.sun.javatest.regtest.Main.run(Main.java:877)
> at com.sun.javatest.regtest.Main.main(Main.java:821)
>> I recall
>> there were issues with jtreg (may have been JavaTest, which jtreg uses)
>> needing JavaHelp and AWT and I remember having to do a bit of hacking to
>> get it to work.
> yep - do you remember what you did?
Is JAVA_HOME set to jdk-base-image? Are you using jtreg -jdk option to
specify the jdk to run the tests?
For testing purpose, you can run jtreg with jdk 7. You can either unset
JAVA_HOME or set ST_JAVA to the runtime for launching jtreg.
>> The jdk-base-image has the compiler and tools so we
>> should be able to get this to work. The other useful thing to know is
>> the -compilejdk option so we should be able to run tests with a
>> jre-base-image too.
> Is that a jtreg option?
If you unset JAVA_HOME, jtreg should use java on your path. I think
this command should work (except that some tests may fail if they depend
on classes not in the base module):
$ jtreg -jdk:jdk-base-image jdk/test/....
$ jtreg -compilejdk:jdk-base-image -jdk:jre-base-image ....
>> Anyway, once you get past that then the real fun
>> begins because our tests aren't organized by module and will have
>> dependency on modules that aren't in the base image (and since jtreg
>> will be running the tests in legacy mode then it means ClassNotFoundErrors).
> I'm mostly interested in running the security tests, validating signed modules
> and so forth.
The above commands should work.
More information about the jigsaw-dev