ppkarwasz commented on code in PR #2015:
URL: https://github.com/apache/logging-log4j2/pull/2015#discussion_r1408922996
##########
log4j-to-slf4j/src/test/java/org/apache/logging/slf4j/LogBuilderTest.java:
##########
@@ -31,31 +30,29 @@
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.message.Message;
import org.apache.logging.log4j.message.SimpleMessage;
+import org.apache.logging.log4j.test.junit.UsingStatusListener;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
-import org.slf4j.LoggerFactory;
+@UsingStatusListener
+@LoggerContextSource
public class LogBuilderTest {
- private static final String CONFIG =
"target/test-classes/logback-turbofilter.xml";
private static final CharSequence CHAR_SEQUENCE = "CharSequence";
private static final String STRING = "String";
private static final Message MESSAGE = new SimpleMessage();
private static final Object[] P = {"p0", "p1", "p2", "p3", "p4", "p5",
"p6", "p7", "p8", "p9"};
- private static final Object OBJECT = "Object";
+ private static Object OBJECT = "Object";
Review Comment:
I would prefer to keep `final`. The `2.x` branch also has the `final`
modifier.
##########
log4j-to-slf4j/src/test/java/org/apache/logging/slf4j/LoggerTest.java:
##########
@@ -33,30 +33,28 @@
import org.apache.logging.log4j.message.ParameterizedMessageFactory;
import org.apache.logging.log4j.message.StringFormatterMessageFactory;
import org.apache.logging.log4j.spi.LoggingSystem;
-import org.junit.Before;
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.apache.logging.log4j.test.junit.UsingStatusListener;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.slf4j.MDC;
-/**
- *
- */
+@UsingStatusListener
+@LoggerContextSource
public class LoggerTest {
- private static final String CONFIG =
"target/test-classes/logback-slf4j.xml";
-
- @ClassRule
- public static final LoggerContextRule CTX = new LoggerContextRule(CONFIG);
-
+ private static Object OBJ = new Object();
Review Comment:
Same here. The difference is irrelevant, but it is one less difference to
track when comparing `2.x` with `main`.
##########
log4j-to-slf4j/src/test/java/org/apache/logging/slf4j/LoggerTest.java:
##########
@@ -73,7 +71,7 @@ public void basicFlow() {
@Test
public void simpleFlow() {
- logger.traceEntry(CONFIG);
+ logger.trace(OBJ);
Review Comment:
This test itself is pretty useless if you ask me (it doesn't even check the
logged messages), but it is supposed to test `traceEntry(OBJ)` instead of
`trace(OBJ)`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]