Clear the logger configuration before "list" tests
[lttng-ust-java-tests.git] / lttng-ust-java-tests-jul / src / test / java / org / lttng / ust / agent / integration / events / JulListEventsIT.java
index 6b78cb273d2961f12462359bee303c97df0eb068..dbd5c334e5bfd15aa14633116b56b941213f5b5a 100644 (file)
 
 package org.lttng.ust.agent.integration.events;
 
-import static org.junit.Assume.assumeTrue;
-
 import java.io.IOException;
 import java.util.logging.Handler;
+import java.util.logging.LogManager;
 import java.util.logging.Logger;
 
 import org.junit.After;
+import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
-import org.lttng.tools.ILttngSession.Domain;
 import org.lttng.tools.ILttngSession;
-import org.lttng.tools.LttngToolsHelper;
-import org.lttng.ust.agent.integration.events.ListEventsITBase;
 import org.lttng.ust.agent.jul.LttngLogHandler;
 import org.lttng.ust.agent.utils.JulTestUtils;
-import org.lttng.ust.agent.utils.LttngUtils;
 
 /**
  * Test suite for the list events command for the JUL domain
@@ -44,15 +40,19 @@ public class JulListEventsIT extends ListEventsITBase {
     private Handler[] handlers;
 
     /**
-     * Test class setup
+     * Class setup
      */
     @BeforeClass
-    public static void testClassSetup() {
-        /* Skip tests if we can't find the JNI library or lttng-tools */
-        assumeTrue(JulTestUtils.checkForJulLibrary());
-        assumeTrue(LttngUtils.checkForLttngTools(Domain.JUL));
+    public static void julClassSetup() {
+        JulTestUtils.testClassSetup();
+    }
 
-        LttngToolsHelper.destroyAllSessions();
+    /**
+     * Class cleanup
+     */
+    @AfterClass
+    public static void julClassCleanup() {
+        JulTestUtils.testClassCleanup();
     }
 
     /**
@@ -63,6 +63,10 @@ public class JulListEventsIT extends ListEventsITBase {
      */
     @Before
     public void julSetup() throws SecurityException, IOException {
+        /* Clear the JUL logger configuration */
+        LogManager.getLogManager().reset();
+        System.gc();
+
         loggers = new Logger[] {
                 Logger.getLogger(LOGGER_NAME_1),
                 Logger.getLogger(LOGGER_NAME_2),
This page took 0.032882 seconds and 4 git commands to generate.