projects
/
lttng-ust-java-tests.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Migrate to Junit 5 Jupiter
[lttng-ust-java-tests.git]
/
lttng-ust-java-tests-log4j
/
src
/
test
/
java
/
org
/
lttng
/
ust
/
agent
/
integration
/
events
/
Log4jListEventsIT.java
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 885ba4b3c9b04a8198185396ae92f694ab7616dc..241e47c843765fc00f4ae5187a600717e0382826 100644
(file)
--- 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;
package org.lttng.ust.agent.integration.events;
-import static org.junit.Assert.assertTrue;
-
import java.io.IOException;
import org.apache.log4j.Appender;
import java.io.IOException;
import org.apache.log4j.Appender;
+import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.apache.log4j.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.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.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
/**
* Test suite for the list events command for the log4j domain
@@
-44,15
+40,19
@@
public class Log4jListEventsIT extends ListEventsITBase {
private Appender[] appenders;
/**
private Appender[] appenders;
/**
- *
Test c
lass setup
+ *
C
lass setup
*/
*/
- @BeforeClass
- public static void testClassSetup() {
- /* Make sure we can find the JNI library and lttng-tools */
- assertTrue(Log4jTestUtils.checkForLog4jLibrary());
- assertTrue(LttngUtils.checkForLttngTools(Domain.LOG4J));
+ @BeforeAll
+ public static void log4jClassSetup() {
+ Log4jTestUtils.testClassSetup();
+ }
- LttngToolsHelper.destroyAllSessions();
+ /**
+ * Class cleanup
+ */
+ @AfterAll
+ public static void log4jClassCleanup() {
+ Log4jTestUtils.testClassCleanup();
}
/**
}
/**
@@
-61,8
+61,12
@@
public class Log4jListEventsIT extends ListEventsITBase {
* @throws SecurityException
* @throws IOException
*/
* @throws SecurityException
* @throws IOException
*/
- @Before
+ @Before
Each
public void log4jSetup() throws SecurityException, IOException {
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),
loggers = new Logger[] {
Logger.getLogger(LOGGER_NAME_1),
Logger.getLogger(LOGGER_NAME_2),
@@
-78,7
+82,7
@@
public class Log4jListEventsIT extends ListEventsITBase {
/**
* Test teardown. Detach and close all log handlers.
*/
/**
* Test teardown. Detach and close all log handlers.
*/
- @After
+ @After
Each
public void log4jTeardown() {
for (Logger logger : loggers) {
for (Appender appender : appenders) {
public void log4jTeardown() {
for (Logger logger : loggers) {
for (Appender appender : appenders) {
This page took
0.024137 seconds
and
4
git commands to generate.