package org.lttng.ust.agent.integration.context;
import static org.junit.Assert.fail;
-import static org.junit.Assume.assumeTrue;
import java.io.IOException;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.junit.After;
+import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.lttng.tools.ILttngSession.Domain;
-import org.lttng.tools.LttngToolsHelper;
import org.lttng.ust.agent.log4j.LttngLogAppender;
import org.lttng.ust.agent.utils.Log4jTestUtils;
-import org.lttng.ust.agent.utils.LttngUtils;
/**
* Implementation of {@link AppContextOrderingITBase} for the log4j API.
*/
@BeforeClass
public static void log4jClassSetup() {
- /* Skip tests if we can't find the JNI library or lttng-tools */
- assumeTrue(Log4jTestUtils.checkForLog4jLibrary());
- assumeTrue(LttngUtils.checkForLttngTools(Domain.LOG4J));
+ Log4jTestUtils.testClassSetup();
+ }
- LttngToolsHelper.destroyAllSessions();
+ /**
+ * Class cleanup
+ */
+ @AfterClass
+ public static void log4jClassCleanup() {
+ Log4jTestUtils.testClassCleanup();
}
/**
try {
logHandler = new LttngLogAppender();
} catch (SecurityException | IOException e) {
- fail();
+ fail(e.getMessage());
}
logger.addAppender((Appender) logHandler);
}