diff options
author | Omair Majid <[email protected]> | 2013-10-22 16:21:40 -0400 |
---|---|---|
committer | Omair Majid <[email protected]> | 2013-10-22 16:21:40 -0400 |
commit | 2242e242bb2da682cf13c0c4d866f64a68f03691 (patch) | |
tree | b8e3fa2229e7481bdc301bb55f3bf4abc38120f2 /netx/net | |
parent | b445a32bfff282734144340ad5ace7327ea37f9f (diff) |
Reset the LogConfig in unit tests
LogConfig is globally shared. Fix unit tests that modify the logging
configuration to reset it after (and before) to avoid affecting other
unit tests or being affected by the results of other tests.
Before this patch, if the tests were executed in a certain order, it
was possible for them to leave behind a LogConfig that enabled logging
in the most verbose manner possible. This would generate megabytes of
output when running unit tests.
2013-10-22 Omair Majid <[email protected]>
* netx/net/sourceforge/jnlp/util/logging/LogConfig.java
(resetLogConfig): New method.
* tests/netx/unit/net/sourceforge/jnlp/util/logging/OutputControllerTest.java
(setUp, tearDown): New method.
Diffstat (limited to 'netx/net')
-rw-r--r-- | netx/net/sourceforge/jnlp/util/logging/LogConfig.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/netx/net/sourceforge/jnlp/util/logging/LogConfig.java b/netx/net/sourceforge/jnlp/util/logging/LogConfig.java index 5e1644c..70db30c 100644 --- a/netx/net/sourceforge/jnlp/util/logging/LogConfig.java +++ b/netx/net/sourceforge/jnlp/util/logging/LogConfig.java @@ -98,6 +98,13 @@ public class LogConfig { return logConfig; } + /** For testing only: throw away the previous config */ + static void resetLogConfig() { + if (logConfig != null) { + logConfig = new LogConfig(); + } + } + public String getIcedteaLogDir() { return icedteaLogDir; } |