testcontainers / testcontainers-java

Testcontainers is a Java library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.
https://testcontainers.org
MIT License
7.97k stars 1.64k forks source link

Using testcontainers on the module path fails #991

Closed alexanderkjall closed 5 years ago

alexanderkjall commented 5 years ago

When trying to use testcontainers on the module path you get these warnings:

[WARNING] Can't extract module name from visible-assertions-2.1.1.jar: TtyCheck.class found in top-level directory (unnamed package not allowed in module)
[WARNING] Can't extract module name from native-lib-loader-2.0.2.jar: native.lib.loader: Invalid module name: 'native' is not a Java identifier
[WARNING] Can't extract module name from junixsocket-native-common-2.0.4.jar: junixsocket.native.common: Invalid module name: 'native' is not a Java identifier

And the test fails with:

java.lang.NoClassDefFoundError: org/rnorth/visibleassertions/VisibleAssertions

These are the bugs in the underlying dependencies:

The issue can be reproduced by running the tests in this repository https://github.com/pgjdbc/pgadba with the configuration <forkCount>0</forkCount> commented out.

kiview commented 5 years ago

Thanks for bringing this up @alexanderkjall. Am I right in the assumption, that this is actually a duplicate of #521?

alexanderkjall commented 5 years ago

Yes, it looks like a duplicate, I don't know how I missed that one.

rnorth commented 5 years ago

I'll close this ticket, but your writeup is helpful, thank you @alexanderkjall. I'll copy it over.