|
I'm currently working to modify my local version if Exam to implement this behavior.
I created a new CoreOption that can be used in the JUnit @Configuration method @Configuration It uses the assembly protocol instead of the Pax URL dir protocol to create the testbundle and include the jar. It also puts the jar in the Bundle-Classpath. With the 'JSON file'-solution you should manually specify the class file of your test in that file (or else your testclass isn't available in the testbundle). That is a lot of boilerplate if you ask me. So one can think of a solution where your custom JSON is extended with the location of your testclass (and optional subclasses since they are compiled to separate class files) With that, I ran in another problem with the current use of Pax URL dir protocol. At this moment. The root dir of your testclass is used by Pax URL-dir to locate your testclass (and dependencies) But what if your junit test-class is located (eg) in a jar? That won't work either. With the problem of external dependencies and locating the testclass itself I think we should consider an (substantial) modification of the generation of the testbundle. Toni mentioned in a chat to me that the Pax URL dir is a little rough. I agree. Classes that aren't necessarily used are included in the test, because the are located in the (subfolder) of the testclass root folder. I'm not sure how trhe testbundle should be generated, but I think it should include solutions for the problems described above. Perhaps something with specifying a custom classpath and that all the classes and jars on this classpath are automatically included in the testbundle. But what if you want use testclasses located in a maven repository? I think the assembly protocol is most suitable. But in what form should it be implemented? The issue described is addressed with TinyBundles. (http://wiki.ops4j.org/display/paxexam/ExamAndTinybundles
I'm closing this issue since using TinyBundle doesn't require any changes to the automatic testbundle generation of Exam. |
||||||||||||||||||||||||||||||||||||||||||
The current way is to just add that library as a wrapped bundle to your provisioning stack.