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.Before;
-import org.junit.BeforeClass;
-import org.lttng.tools.ILttngSession.Domain;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
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
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));
+ @BeforeAll
+ public static void julClassSetup() {
+ JulTestUtils.testClassSetup();
+ }
- LttngToolsHelper.destroyAllSessions();
+ /**
+ * Class cleanup
+ */
+ @AfterAll
+ public static void julClassCleanup() {
+ JulTestUtils.testClassCleanup();
}
/**
* @throws SecurityException
* @throws IOException
*/
- @Before
+ @BeforeEach
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),
/**
* Test teardown. Detach and close all log handlers.
*/
- @After
+ @AfterEach
public void julTeardown() {
for (Logger logger : loggers) {
for (Handler handler : handlers) {