Details
-
Test
-
Status: Closed
-
Trivial
-
Resolution: Fixed
-
None
-
None
Description
Many CPE tests use ManageOutputDevice.setAllSystemOutputToNirvana() calls to attempt to stop expected error output from flooding the console. This works when the tests are run from Eclipse, but fails when run from Maven. This because the mechanism used is to swap in to System.err and System.out new print streams that throw away their output. However, if any logging occurs previous to this, the logger will initialize and copy the System.err, for example, so that subsequent setting of it has no effect on logging. When running from Maven, this happens.
The fix is to use a different mechanism to stop the output due to logging: UIMAFramework.getLogger().setLevel(Level.OFF). Ideally this is surrounded by a try / finally block to insure it's put back to INFO.