You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This seems to confuse Eclipse, and makes JUnit tests difficult to run. I seem to get the following error, having the following project hierarchy:
This would also require the test module to have a different name than the main module. In the example above, we have main module org.scijava.discovery.therapi and test module org.scijava.discovery.therapi.test
As it currently stands, the test classes are on the classpath, which prevents us from having to declare test-related dependencies in the main package's module-info. It would be smooth, however, if the test package was also a module
Interestingly enough, when I had the test module-info, scijava/scijava-discovery-therapi/target/test-classes was still on the classpath. This means that test scope dependencies do not have to be required in the main module-info if we do not have the separate test module.
For interested parties, this can be seen in scijava/scijava-discovery-therapi in scijava incubator, commit 3e07b868315a4e5325260a228159c58c4b369a87
I think I made a bit of a mistake; while the commit I linked did have the running module's classes on the classpath, they are somehow still "on" the modulepath, and their exports/opens still apply (this can be seen with commit scijava/incubator@3bd4ee7b). @hinerm@ctrueden we should look into patching the module-info.java at test runtime, similar to the way done here with module-info.test. It's not the prettiest solution, but I'd prefer it over creating test modules.
I think that whatever we have working now is good enough, as it passes in IntelliJ, on CLI, and on CI, and we don't have to do anything funny with the module infos. So I'm going to close this as unplanned.
Activity
gselzer commentedon Oct 11, 2021
Interestingly enough, when I had the test
module-info,scijava/scijava-discovery-therapi/target/test-classeswas still on the classpath. This means that test scope dependencies do not have to berequiredin the mainmodule-infoif we do not have the separate test module.For interested parties, this can be seen in scijava/scijava-discovery-therapi in scijava incubator, commit 3e07b868315a4e5325260a228159c58c4b369a87
hinerm commentedon Oct 12, 2021
I agree that we do not need a
module-info.javainsrc/test. This seems consistent with answers to https://stackoverflow.com/q/46613214gselzer commentedon Oct 21, 2021
I think I made a bit of a mistake; while the commit I linked did have the running module's classes on the classpath, they are somehow still "on" the modulepath, and their
exports/opensstill apply (this can be seen with commit scijava/incubator@3bd4ee7b). @hinerm @ctrueden we should look into patching themodule-info.javaat test runtime, similar to the way done here withmodule-info.test. It's not the prettiest solution, but I'd prefer it over creating test modules.gselzer commentedon Oct 18, 2023
I think that whatever we have working now is good enough, as it passes in IntelliJ, on CLI, and on CI, and we don't have to do anything funny with the module infos. So I'm going to close this as unplanned.
Scijava/scijava javadoc parser/javadoc to yaml (#79)