How can you run jtreg with jdk-base-image?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

How can you run jtreg with jdk-base-image?

Sean Mullan
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?

Thanks,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: How can you run jtreg with jdk-base-image?

Mandy Chung
  On 08/31/11 13:03, 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?

What error did you get?

I think most of the jigsaw tests requires the default platform module
which is currently the full JDK and so they will fail when running with
jdk-base-image.

Mandy
Reply | Threaded
Open this post in threaded view
|

Re: How can you run jtreg with jdk-base-image?

Alan Bateman
In reply to this post by Sean Mullan
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? 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. 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. 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).

-Alan.
Reply | Threaded
Open this post in threaded view
|

Re: How can you run jtreg with jdk-base-image?

Sean Mullan
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:
java/awt/IllegalComponentStateException
        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.interview.BasicInterviewParameters.createTestsInterview(BasicInterviewParameters.java:96)
        at
com.sun.javatest.interview.BasicInterviewParameters.<init>(BasicInterviewParameters.java:64)
        at
com.sun.javatest.interview.BasicInterviewParameters.<init>(BasicInterviewParameters.java:83)
        at
com.sun.javatest.regtest.RegressionParameters.<init>(RegressionParameters.java:56)
        at
com.sun.javatest.regtest.RegressionTestSuite.createInterview(RegressionTestSuite.java:106)
        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?

> 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?

> 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.

--Sean
Reply | Threaded
Open this post in threaded view
|

Re: How can you run jtreg with jdk-base-image?

Mandy Chung
  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:
> java/awt/IllegalComponentStateException
> 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.interview.BasicInterviewParameters.createTestsInterview(BasicInterviewParameters.java:96)
> at
> com.sun.javatest.interview.BasicInterviewParameters.<init>(BasicInterviewParameters.java:64)
> at
> com.sun.javatest.interview.BasicInterviewParameters.<init>(BasicInterviewParameters.java:83)
> at
> com.sun.javatest.regtest.RegressionParameters.<init>(RegressionParameters.java:56)
> at
> com.sun.javatest.regtest.RegressionTestSuite.createInterview(RegressionTestSuite.java:106)
> 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/....

Or

$ 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.

Mandy
Reply | Threaded
Open this post in threaded view
|

Re: How can you run jtreg with jdk-base-image?

Alan Bateman
In reply to this post by Sean Mullan
Sean Mullan wrote:

> :
> jtreg. Here's the exception stack trace:
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> java/awt/IllegalComponentStateException
> 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.interview.BasicInterviewParameters.createTestsInterview(BasicInterviewParameters.java:96)
> at
> com.sun.javatest.interview.BasicInterviewParameters.<init>(BasicInterviewParameters.java:64)
> at
> com.sun.javatest.interview.BasicInterviewParameters.<init>(BasicInterviewParameters.java:83)
> at
> com.sun.javatest.regtest.RegressionParameters.<init>(RegressionParameters.java:56)
> at
> com.sun.javatest.regtest.RegressionTestSuite.createInterview(RegressionTestSuite.java:106)
> 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)
>  
Ah, this is running jtreg with the base image whereas you want to run
jtreg with a full JDK image. You can do that by setting JT_JAVA to a JDK
(legacy or a modular JDK that has all modules installed).  Then specify
the base image that you want to test by specifying the -jdk option.

-Alan.

Reply | Threaded
Open this post in threaded view
|

Re: How can you run jtreg with jdk-base-image?

Sean Mullan
On 8/31/11 5:09 PM, Alan Bateman wrote:

> Sean Mullan wrote:
>> :
>> jtreg. Here's the exception stack trace:
>>
>> Exception in thread "main" java.lang.NoClassDefFoundError:
>> java/awt/IllegalComponentStateException
>> 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.interview.BasicInterviewParameters.createTestsInterview(BasicInterviewParameters.java:96)
>> at
>> com.sun.javatest.interview.BasicInterviewParameters.<init>(BasicInterviewParameters.java:64)
>> at
>> com.sun.javatest.interview.BasicInterviewParameters.<init>(BasicInterviewParameters.java:83)
>> at
>> com.sun.javatest.regtest.RegressionParameters.<init>(RegressionParameters.java:56)
>> at
>> com.sun.javatest.regtest.RegressionTestSuite.createInterview(RegressionTestSuite.java:106)
>> 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)
>>  
> Ah, this is running jtreg with the base image whereas you want to run
> jtreg with a full JDK image. You can do that by setting JT_JAVA to a JDK
> (legacy or a modular JDK that has all modules installed).  Then specify
> the base image that you want to test by specifying the -jdk option.

Yep that works.

--Sean