Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
Description
I've noticed that in some tests (currently: gradle) Module system complains in test logs that this or that module is not enabled. While some tests aim to check dynamic behaviour, i.e. when a plugin module/provider is/is not present, or test behaviour of module system and the config infrastructure itself, most of tests work in "static" environment they build on Classpath.
But as a simple call as NbPrefences.forModule may initialize ModuleManager and its dependency checks. It greatly prolongs test time and makes the logs full of garbage.
But mocking just Preferences won't be probably sufficient.
I think that there should be some 'mock' ModuleManager for tests, that could eventually serve Module objects whose state would be (for example) all enabled, as they are all active on the Classpath (and therefore their registrations in META-INF are read by classloaders). Such a support should be strictly opt-in for older code, and ideally opt-out for code with newer dependencies (assuming that just a fraction of tests actually check module's state).