RFR(s): 8166624: java/util/jar/JarFile/mrjar regression tests has undeclared dependencies

Sergei Kovalev sergei.kovalev at oracle.com
Sun Sep 25 15:05:26 UTC 2016


Hi Alan,

Here is the result of one of the tests run in initial state (no fix applied)

1) no module limitation

jtreg -jdk:/home/skovalev/TRASH/jdk-9 -verbose:all 
/home/skovalev/repos/jake/jdk/test/java/util/jar/JarFile/mrjar/MultiReleaseJarAPI.java

TEST RESULT: Passed. Execution successful

2) limit modules java.base

jtreg -jdk:/home/skovalev/jdk-9 -verbose:all 
-javaoptions:"--limit-modules java.base" 
/home/skovalev/repos/jake/jdk/test/java/util/jar/JarFile/mrjar/MultiReleaseJarAPI.java

STDOUT:
Error occurred during initialization of VM
java.lang.module.ResolutionException: Module java.compiler not found, 
required by jdk.compiler
         at java.lang.module.Resolver.fail(java.base at 9-ea/Resolver.java:790)
         at 
java.lang.module.Resolver.resolve(java.base at 9-ea/Resolver.java:138)
         at 
java.lang.module.Resolver.resolveRequires(java.base at 9-ea/Resolver.java:108)
         at 
java.lang.module.Configuration.resolveRequiresAndUses(java.base at 9-ea/Configuration.java:370)
         at 
java.lang.module.ModuleDescriptor$1.resolveRequiresAndUses(java.base at 9-ea/ModuleDescriptor.java:1986)
         at 
jdk.internal.module.ModuleBootstrap.boot(java.base at 9-ea/ModuleBootstrap.java:263)
         at java.lang.System.initPhase2(java.base at 9-ea/System.java:1927)

3) In case I limiting modules java.base and jdk.compiler only (with 
modified TEST.prioperties)

jtreg -jdk:/home/skovalev/jdk-9 -verbose:all 
-javaoptions:"--limit-modules java.base,jdk.compiler" 
/home/skovalev/repos/jdk9-dev/jdk/test/java/util/jar/JarFile/mrjar/MultiReleaseJarAPI.java

config MultiReleaseJarAPI.initialize(): failure
java.lang.NoClassDefFoundError: jdk/security/jarsigner/JarSigner$Builder
         at 
CreateMultiReleaseTestJars.buildSignedMultiReleaseJar(CreateMultiReleaseTestJars.java:147)
         at MultiReleaseJarAPI.initialize(MultiReleaseJarAPI.java:74)
         at 
jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(java.base at 9-ea/Native 
Method)
         at 
jdk.internal.reflect.NativeMethodAccessorImpl.invoke(java.base at 9-ea/NativeMethodAccessorImpl.java:62)
         at 
jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base at 9-ea/DelegatingMethodAccessorImpl.java:43)
         at java.lang.reflect.Method.invoke(java.base at 9-ea/Method.java:535)
         at 
org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86)
         at 
org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:515)
         at 
org.testng.internal.Invoker.invokeConfigurations(Invoker.java:216)
         at 
org.testng.internal.Invoker.invokeConfigurations(Invoker.java:143)
         at 
org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:178)
         at 
org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
         at org.testng.TestRunner.privateRun(TestRunner.java:778)
         at org.testng.TestRunner.run(TestRunner.java:632)
         at org.testng.SuiteRunner.runTest(SuiteRunner.java:366)
         at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361)
         at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319)
         at org.testng.SuiteRunner.run(SuiteRunner.java:268)
         at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
         at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
         at org.testng.TestNG.runSuitesSequentially(TestNG.java:1222)
         at org.testng.TestNG.runSuitesLocally(TestNG.java:1147)
         at org.testng.TestNG.runSuites(TestNG.java:1072)
         at org.testng.TestNG.run(TestNG.java:1044)
         at 
com.sun.javatest.regtest.TestNGAction$TestNGRunner.main(TestNGAction.java:220)
         at 
com.sun.javatest.regtest.TestNGAction$TestNGRunner.main(TestNGAction.java:184)
         at 
jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(java.base at 9-ea/Native 
Method)
         at 
jdk.internal.reflect.NativeMethodAccessorImpl.invoke(java.base at 9-ea/NativeMethodAccessorImpl.java:62)
         at 
jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base at 9-ea/DelegatingMethodAccessorImpl.java:43)
         at java.lang.reflect.Method.invoke(java.base at 9-ea/Method.java:535)
         at 
com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:110)
         at java.lang.Thread.run(java.base at 9-ea/Thread.java:843)



25.09.16 17:48, Alan Bateman wrote:
> On 25/09/2016 13:53, Sergei Kovalev wrote:
>
>> Hi Alan,
>>
>> The modules list in mrar/TEST.properties guarantee that jtreg add 
>> "--add-module @modules" command line option during test execution. If 
>> you create custom JRE that does not contains the modules, the tests 
>> fails. The proposed fix guarantee that jtreg skips the tests if no 
>> listed modules found.
> Are you sure about this? I believe the original intent was that jtreg 
> would select the test to run when the runtime has the required modules 
> (@modules just overrides the value of "modules" that is read from 
> TEST.properties).
>
> In any case, it should be "@modules java.compiler", no need to include 
> /javax.tools because that package is exported.
>
> -Alan

-- 
With best regards,
Sergei



More information about the core-libs-dev mailing list