X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;ds=sidebyside;f=lttng-ust-java-tests-jul%2Fsrc%2Ftest%2Fjava%2Forg%2Flttng%2Fust%2Fagent%2Fintegration%2Fevents%2FJulLoggerHierarchyListIT.java;h=e53e4a7e664ed63510831e7271e7d5d1eb22e821;hb=1e67919e5a809aafc1ad068ad690f3f48e9d10da;hp=4254aafec7ef95b85ff6b8899aa6147afb9ebcff;hpb=9d06e3eb07ead1ec21411259823a758375a912be;p=lttng-ust-java-tests.git diff --git a/lttng-ust-java-tests-jul/src/test/java/org/lttng/ust/agent/integration/events/JulLoggerHierarchyListIT.java b/lttng-ust-java-tests-jul/src/test/java/org/lttng/ust/agent/integration/events/JulLoggerHierarchyListIT.java index 4254aaf..e53e4a7 100644 --- a/lttng-ust-java-tests-jul/src/test/java/org/lttng/ust/agent/integration/events/JulLoggerHierarchyListIT.java +++ b/lttng-ust-java-tests-jul/src/test/java/org/lttng/ust/agent/integration/events/JulLoggerHierarchyListIT.java @@ -25,6 +25,7 @@ import java.util.logging.Logger; import org.junit.After; import org.junit.AfterClass; +import org.junit.Before; import org.junit.BeforeClass; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @@ -90,7 +91,23 @@ public class JulLoggerHierarchyListIT extends LoggerHierachyListITBase { } /** - * + * Test setup + */ + @SuppressWarnings("static-method") + @Before + public void setup() { + /* + * Kind of hackish, but it's the only way to ensure that loggers are + * really removed in-between tests, since LogManager does not provide a + * way to forcibly remove a logger, and it doesn't seem like it will any + * time soon, see http://bugs.java.com/view_bug.do?bug_id=4811930 + */ + LogManager.getLogManager().reset(); + System.gc(); + } + + /** + * Test cleanup */ @After public void cleanup() { @@ -111,15 +128,6 @@ public class JulLoggerHierarchyListIT extends LoggerHierachyListITBase { } childLogger = null; } - - /* - * Kind of hackish, but it's the only way to ensure that loggers are - * really removed in-between tests, since LogManager does not provide a - * way to forcibly remove a logger, and it doesn't seem like it will any - * time soon, see http://bugs.java.com/view_bug.do?bug_id=4811930 - */ - LogManager.getLogManager().reset(); - System.gc(); } // ------------------------------------------------------------------------