X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;ds=sidebyside;f=lttng-ust-java-tests-log4j%2Fsrc%2Ftest%2Fjava%2Forg%2Flttng%2Fust%2Fagent%2Fintegration%2Fevents%2FLog4jListEventsIT.java;h=7c1effa054f09fd67daf547e8b24c5193c3ed436;hb=9d06e3eb07ead1ec21411259823a758375a912be;hp=e06abf8b26537231a02bc1bde38a093dcd3ebac2;hpb=4821eac962d2f707558b6d9a5b66af9dbe89b933;p=lttng-ust-java-tests.git diff --git a/lttng-ust-java-tests-log4j/src/test/java/org/lttng/ust/agent/integration/events/Log4jListEventsIT.java b/lttng-ust-java-tests-log4j/src/test/java/org/lttng/ust/agent/integration/events/Log4jListEventsIT.java index e06abf8..7c1effa 100644 --- a/lttng-ust-java-tests-log4j/src/test/java/org/lttng/ust/agent/integration/events/Log4jListEventsIT.java +++ b/lttng-ust-java-tests-log4j/src/test/java/org/lttng/ust/agent/integration/events/Log4jListEventsIT.java @@ -18,22 +18,18 @@ package org.lttng.ust.agent.integration.events; -import static org.junit.Assume.assumeTrue; - import java.io.IOException; import org.apache.log4j.Appender; +import org.apache.log4j.LogManager; import org.apache.log4j.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.log4j.LttngLogAppender; import org.lttng.ust.agent.utils.Log4jTestUtils; -import org.lttng.ust.agent.utils.LttngUtils; /** * Test suite for the list events command for the log4j domain @@ -44,15 +40,19 @@ public class Log4jListEventsIT extends ListEventsITBase { private Appender[] appenders; /** - * Test class setup + * Class setup */ @BeforeClass - public static void testClassSetup() { - /* Skip tests if we can't find the JNI library or lttng-tools */ - assumeTrue(Log4jTestUtils.checkForLog4jLibrary()); - assumeTrue(LttngUtils.checkForLttngTools(Domain.LOG4J)); + public static void log4jClassSetup() { + Log4jTestUtils.testClassSetup(); + } - LttngToolsHelper.destroyAllSessions(); + /** + * Class cleanup + */ + @AfterClass + public static void log4jClassCleanup() { + Log4jTestUtils.testClassCleanup(); } /** @@ -63,6 +63,10 @@ public class Log4jListEventsIT extends ListEventsITBase { */ @Before public void log4jSetup() throws SecurityException, IOException { + /* Try clearing the log4j logger configuration */ + LogManager.resetConfiguration(); + System.gc(); + loggers = new Logger[] { Logger.getLogger(LOGGER_NAME_1), Logger.getLogger(LOGGER_NAME_2),