org.ops4j.pax.exam2
org.ops4j.pax.exam2 copied to clipboard
regression: forked container unit tests failing
18 [main] INFO org.ops4j.pax.exam.junit.DriverExtension - creating PaxExam runner for class org.ops4j.pax.exam.forked.ReferenceJarTest
73 [main] INFO org.ops4j.pax.exam.spi.DefaultExamSystem - Pax Exam System (Version: 5.0.0-SNAPSHOT) created.
Running org.ops4j.pax.exam.forked.ForkedFrameworkFactoryTest
1020 [main] INFO org.ops4j.pax.exam.ExamJavaRunner - ExamJavaRunner completed successfully
1021 [main] INFO org.ops4j.pax.exam.forked.ForkedFrameworkFactory - Connecting to host: 127.0.0.1 port: 21000
3473 [main] INFO org.ops4j.pax.exam.ExamJavaRunner - ExamJavaRunner completed successfully
3473 [main] INFO org.ops4j.pax.exam.forked.ForkedFrameworkFactory - Connecting to host: 127.0.0.1 port: 21001
8649 [main] INFO org.ops4j.pax.exam.ExamJavaRunner - Platform has been shutdown.
Tests run: 4, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 7.713 sec <<< FAILURE! - in org.ops4j.pax.exam.forked.ForkedFrameworkFactoryTest
forkEquinox(org.ops4j.pax.exam.forked.ForkedFrameworkFactoryTest) Time elapsed: 2.497 sec <<< ERROR!
java.rmi.ServerError: Error occurred in server thread; nested exception is:
java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
Downgrading the swissbox dependency to 1.8.3 fixes the issue (that is, reverting #1021)
cc @jbonofre
@reschke Does downgrading Swissbox in 4.13.6-SNAPSHOT also fix the issue?
I don't quiet understand the question - the bug report is for what's current in "master"; and that hasn't changed since Nov 2021.
There is a regression in versions newer 4.13.3 which could be the same or similar and prevents me from upgrading Pax Exam in several Sling projects. Never mind, I will investigate when back at desk.
Yes, I believe we talk about the same regression (or multiple ones).
Just checking: is anybody actually working actively on pax-exam?
Not that I'm aware of depending on your needs osgi-test might be a more lightweight alternative:
- https://github.com/osgi/osgi-test
- https://github.com/laeubisoft/osgi-test-framework
but it is all open source so if you want open a PR with a fix and I think it could be merged without much issues,
@reschke I intended to do some work around junit 5 support and relatives, however ended up not doing so yet. Mean while other project where I worked with where I expected to see more pax-exam decided to go with test containers as a more consistent way for testing multiple things. We do have some Karaf integration tests, which normally would work with pax: https://github.com/OpenNMS-Cloud/lokahi/blob/v0.0.42-dev/minion/docker-it/src/test/java/org/opennms/horizon/dockerit/testcontainers/TestContainerRunnerClassRule.java
Main difference there is - you can verify system behavior. If you are still interested in asserting internal state of framework or supplied extensions - exam or tools pointed by @laeubi is way to go, as it will give you access to all low level details. For any system level testing test-containers will do the job. I hope to put some more effort into ConnectorIO/connectorio-addons#5 in July and make it a drop-in replacement of higher level tests.
FYI, I've extracted some of the code from that repository into separate repository. I made also an attempt to separate container handling from customization (what we know as exam options) so they can be applied across different distributions. I'll continue working on it further: https://github.com/ConnectorIO/connectorio-testcontainers and try to see how it will work with integration tests for openHAB (readme is missing for now ;-)).
@reschke, Were you able to identify the change in Swissbox which is causing the issue?
@reschke, Were you able to identify the change in Swissbox which is causing the issue?
Nope.
The issue was caused by the introduction of Logger and LoggerFactory into ServiceLookup in commit ed0dccb.
Fixed by #1124.