[rfc][icedtea-web] dont expect junit have hamcrest included

Jiri Vanek jvanek at redhat.com
Mon Jan 26 11:11:59 UTC 2015


Hi!

I noticed an issue during build for fedora rawhide [1]

Omair later investigated it, and found:
"> Could it be that the junit version in rawhide is not compatible with
 > your junit-runner sources somehow?

I tried removing the junit-runner but the errors persisted.

It turns out that this is caused by a change in Fedora's junit.jar. In
F20 (at least) the junit.jar includes org.hamcrest.* classes. This is no
longer true for the version in rawhide (this matches the jar shipped by
upstream in maven repositories). Since the hamcrest classes are not
available on the classpath, a class that imports them, such as
org/junit/internal/AssumptionViolatedException, fails to load with a
NoClassDefFoundError.

The fix is to make sure that the hamcrest jar is available on the
classpath next to junit.jar too. The attached patch (for icedtea-web)
does that and works on my machine with an upstream junit 4.12 jar.

A scratch build with this patch applied is able to run the unit tests:
http://koji.fedoraproject.org/koji/taskinfo?taskID=8711128"


I'm attaching his patch here. Form my point of view is ok to push. Both head and 1.5

Any other ideas?

Omair, Thank you!


J.





[1]
http://koji.fedoraproject.org/koji/taskinfo?taskID=8707158
the following runs have no appearance of AssumptionViolatedException. And above, with import of it, 
hae built.
http://koji.fedoraproject.org/koji/taskinfo?taskID=8708483
http://koji.fedoraproject.org/koji/taskinfo?taskID=8707469

the failures are a bit random:

Passed: net.sourceforge.jnlp.runtime.CodeBaseClassLoaderTest.testClassResourceLoadSuccessCachingApplet
  - This test is running remote content, note that failures may be caused by broken target 
application or connection
Exception in thread "main" java.lang.NoClassDefFoundError: 
org/junit/internal/AssumptionViolatedException
     at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
     at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
     at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
     at org.junit.runner.JUnitCore.run(JUnitCore.java:105)
     at org.junit.runner.JUnitCore.run(JUnitCore.java:94)
     at CommandLine.runMain(CommandLine.java:48)
     at CommandLine.runMainAndExit(CommandLine.java:28)
     at CommandLine.main(CommandLine.java:24)
Makefile:1727: recipe for target 'stamps/run-netx-unit-tests.stamp' failed

Passed: net.sourceforge.jnlp.JNLPMatcherTest.testApplicationCDATA
  - WARNING This test is known to fail, but have passed!
Exception in thread "main" java.lang.NoClassDefFoundError: 
org/junit/internal/AssumptionViolatedException
     at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
     at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
     at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
     at org.junit.runner.JUnitCore.run(JUnitCore.java:105)
     at org.junit.runner.JUnitCore.run(JUnitCore.java:94)
     at CommandLine.runMain(CommandLine.java:48)
     at CommandLine.runMainAndExit(CommandLine.java:28)
     at CommandLine.main(CommandLine.java:24)
Makefile:1727: recipe for target 'stamps/run-netx-unit-tests.stamp' failed

Passed: net.sourceforge.jnlp.security.policyeditor.PolicyFileModelTest.testSavePolicyFileWithFileNull
Exception in thread "main" java.lang.NoClassDefFoundError: 
org/junit/internal/AssumptionViolatedException
     at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
     at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
     at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
     at org.junit.runner.JUnitCore.run(JUnitCore.java:105)
     at org.junit.runner.JUnitCore.run(JUnitCore.java:94)
     at CommandLine.runMain(CommandLine.java:48)
     at CommandLine.runMainAndExit(CommandLine.java:28)
     at CommandLine.main(CommandLine.java:24)
Makefile:1727: recipe for target 'stamps/run-netx-unit-tests.stamp' failed
-------------- next part --------------
A non-text attachment was scrubbed...
Name: use-hamcrest.patch
Type: text/x-patch
Size: 9133 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20150126/77e7a8f8/use-hamcrest.patch>


More information about the distro-pkg-dev mailing list