Add JUnit RunListener to Tycho Surefire Plugin #1258
Unanswered
vaclavHala
asked this question in
Q&A
Replies: 1 comment 14 replies
-
You are mixing thinks here, the booter is not part of the project resolution (e.g. you will never really see it on the compile path) but only part of the test-execution framework, that are different things.
I think that https://www.eclipse.org/tycho/sitedocs/tycho-surefire-plugin/integration-test-mojo.html#dependencies is more suitable for this (never checked if a plain jar is then even enough). |
Beta Was this translation helpful? Give feedback.
14 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We have some custom RunListener we'd like to add to each of our tests (i.e. register it in parent pom and have all test bundles inherit it).
So far I managed to get the listener working by registering it like this in the parent pom
and then adding bundle containing this class as explicit dependency to
META-INF/MANIFEST.MF
of every test bundle.While this works, I'm not happy about having to add it to each test as every time we add a new test bundle the build breaks (failed to find the listener class).
So what I tried to do was mark the bundle containing the listener as
Fragment-Host: org.eclipse.tycho.surefire.osgibooter
, as that seems to be the bundle which does the lookup by reflection at runtime, and adding the listener bundle as extra requirement totarget-platform-configuration
in the parent. Problem with this approach is that target resolution fails with such setup:which seems wrong to me as the booter obviously is part of the final target, this can be seen by running any tests with the
-Dtycho.printBundles
flag.Finally, my question - is the approach with fragment I took reasonable and should I create a feature request for exposing the booter in the target? Is there some better way I didn't think of to achieve what I'm trying to do with what is already available (i.e. add some code visible to tycho-surefire classpath without having to explicitly depend on it from the test bundle)?
I have found thread asking for pretty much the same thing https://www.eclipse.org/lists/tycho-user/msg06256.html but no resolution there.
Beta Was this translation helpful? Give feedback.
All reactions