Closed GoogleCodeExporter closed 8 years ago
Added, you can build and check the development version.
Original comment by lipinski...@gmail.com
on 13 Mar 2013 at 1:15
[deleted comment]
Thanks for adding the osgi headers to the manifest, but i think they are not
(completly) correct.
Currently i can create a dependency to you library, but when running a junit
test i get the following exception:
java.lang.TypeNotPresentException: Type [unknown] not present
at sun.reflect.annotation.TypeNotPresentExceptionProxy.generateException(TypeNotPresentExceptionProxy.java:46)
at sun.reflect.annotation.AnnotationInvocationHandler.invoke(AnnotationInvocationHandler.java:75)
at com.sun.proxy.$Proxy9.value(Unknown Source)
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:24)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:33)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(JUnit4TestClassReference.java:25)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:48)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.swtbot.eclipse.core.RemotePluginTestRunner.main(RemotePluginTestRunner.java:64)
at org.eclipse.swtbot.eclipse.core.UITestApplication.runTests(UITestApplication.java:117)
at org.eclipse.ui.internal.testing.WorkbenchTestable$1.run(WorkbenchTestable.java:71)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.NoClassDefFoundError:
org/junit/runners/BlockJUnit4ClassRunner
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at
the important point is NoClassDefFoundError:
org/junit/runners/BlockJUnit4ClassRunner
you bundle does not define a (direct) dependency to the org.junit bundle.
you could just an add an "import package" to the junit packages you need or
directly define a dependency to the org.junit bundle (not recommended)
your curretn usage of the uses directive in the export package line does not
seem correct to me, since you are not importing the referenced package.
excerpt from
http://blog.springsource.org/2008/10/20/understanding-the-osgi-uses-directive/
<snip>
Note that the package, or packages, named in a "uses" directive are either
exported or imported by the bundle manifest containing the "uses" directive. So
the following manifest
is valid:
…
export-package: p;uses:="q,r", q
import-package: r
…
whereas the following manifest is invalid (because it neither exports nor
imports the package q):
…
export-package: p;uses:="q,r"
import-package: r
…
</snip>
Original comment by prace...@googlemail.com
on 14 Mar 2013 at 1:34
Original comment by lipinski...@gmail.com
on 18 Mar 2013 at 11:31
i tried with the following in the manifest
Import-Package: org.junit;version="4.8",
org.junit.runner;version="4.8"
but that didn't work too.
I'll have to grab the source and see what the problem is.
Original comment by prace...@googlemail.com
on 19 Mar 2013 at 8:03
Please replace the current MANIFEST.MF file with the one attached.
The Tests do not work for me so I had to do an
mvn -DskipTests=true clean verify
The resulting .jar file worked for me as a OSGI Bundle.
Worked for running as plain JUnit Test as well as running as Plugin-Tests (Test
Suites etc.)
Another cool enhancement would be to have a (Eclipse compatible)-Source Bundle
as described here:
http://rajakannappan.blogspot.de/2010/03/automating-eclipse-source-bundle.html
but that's another task. That also shows how the MANIFEST.MF file could be
generated in version changes ....
Original comment by prace...@googlemail.com
on 13 Jan 2014 at 1:51
Attachments:
Fixed - will be available with 1.0.4
Original comment by lipinski...@gmail.com
on 28 Jul 2014 at 1:00
Great! Please make sure to set the correct version number in the MANIFEST.MF
file for
Export-Package: junitparams;version="1.0.0";uses:="org.junit"
Bundle-Version: 1.0.0
In the latest 1.0.2 release it's still 1.0.0 which leads to problems when
dependencies are resolved.
Thanks!
Original comment by prace...@googlemail.com
on 28 Jul 2014 at 2:02
The version will now be generated, so this will not happen anymore.
Original comment by lipinski...@gmail.com
on 28 Jul 2014 at 2:03
Original issue reported on code.google.com by
prace...@googlemail.com
on 24 Jan 2013 at 12:49