This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I have a module in a suite which is needs filesystems on classpath to run unit tests. I tried to add dependency on filesystems, but just the one for runtime. To my surprise the module did not get included in the runtime classpath of junit tests. I needed to say that I want to use the dependency during compile time as well. The classpath of junit should be composed from runtime classpath of the project, at minimum.
To add to the test classpath you should append to ${test.unit.run.cp.extra}, not add module deps. See issue #54161 for more thoughts. *** This issue has been marked as a duplicate of 54161 ***
"The classpath of junit should be composed from runtime classpath of the project, at minimum." The reason I said "at minimum" is that we can wait for ages till issue 54161 is implemented, but we do not need to - it is enough to base the unit classpath on the compilation path, which imho should be pretty easy to fix.
May be easy or not (haven't checked yet), but in any rate wouldn't have helped you in this case; you should not have been adding a module dep at all for something that was only needed by unit tests.
I want to understand why runtime of junit tests is not using runtime module dependencies. Until this gets trustfully explained, I have to consider the behaviour to be a bug.
By design currently.
*** This issue has been marked as a duplicate of 54161 ***
verified duplicate.