Skip to content

Commit b8fb8c8

Browse files
committed
Remove redundant log4j-jcl annotations (#2163)
1 parent a863232 commit b8fb8c8

File tree

2 files changed

+11
-16
lines changed

2 files changed

+11
-16
lines changed

log4j-jcl/src/test/java/org/apache/logging/log4j/jcl/CallerInformationTest.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,17 @@
1616
*/
1717
package org.apache.logging.log4j.jcl;
1818

19-
import static org.assertj.core.api.Assertions.assertThat;
20-
21-
import java.util.List;
2219
import org.apache.commons.logging.Log;
2320
import org.apache.commons.logging.LogFactory;
2421
import org.apache.logging.log4j.core.LoggerContext;
2522
import org.apache.logging.log4j.core.test.appender.ListAppender;
2623
import org.apache.logging.log4j.core.test.junit.LoggerContextSource;
27-
import org.apache.logging.log4j.test.junit.SetTestProperty;
28-
import org.apache.logging.log4j.test.junit.UsingStatusListener;
2924
import org.junit.jupiter.api.Test;
3025

31-
@UsingStatusListener
32-
@SetTestProperty(key = "log4j2.configurationFile", value = "org/apache/logging/log4j/jcl/CallerInformationTest.xml")
26+
import java.util.List;
27+
28+
import static org.assertj.core.api.Assertions.assertThat;
29+
3330
public class CallerInformationTest {
3431

3532
@Test

log4j-jcl/src/test/java/org/apache/logging/log4j/jcl/LoggerTest.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@
2424
import org.apache.logging.log4j.core.LoggerContext;
2525
import org.apache.logging.log4j.core.test.appender.ListAppender;
2626
import org.apache.logging.log4j.core.test.junit.LoggerContextSource;
27-
import org.apache.logging.log4j.test.junit.UsingStatusListener;
2827
import org.apache.logging.log4j.util.Strings;
2928
import org.junit.jupiter.api.Test;
3029

31-
@UsingStatusListener
3230
class LoggerTest {
3331

3432
@Test
@@ -39,20 +37,20 @@ void testFactory() {
3937

4038
@Test
4139
@LoggerContextSource("LoggerTest.xml")
42-
void testLog(final LoggerContext loggerContext) {
40+
void testLog(final LoggerContext context) {
4341
final Log logger = LogFactory.getLog("LoggerTest");
4442
logger.debug("Test message");
45-
verify(loggerContext, "o.a.l.l.j.LoggerTest Test message MDC{}" + Strings.LINE_SEPARATOR);
43+
verify(context, "o.a.l.l.j.LoggerTest Test message MDC{}" + Strings.LINE_SEPARATOR);
4644
logger.debug("Exception: ", new NullPointerException("Test"));
47-
verify(loggerContext, "o.a.l.l.j.LoggerTest Exception: MDC{}" + Strings.LINE_SEPARATOR);
45+
verify(context, "o.a.l.l.j.LoggerTest Exception: MDC{}" + Strings.LINE_SEPARATOR);
4846
logger.info("Info Message");
49-
verify(loggerContext, "o.a.l.l.j.LoggerTest Info Message MDC{}" + Strings.LINE_SEPARATOR);
47+
verify(context, "o.a.l.l.j.LoggerTest Info Message MDC{}" + Strings.LINE_SEPARATOR);
5048
logger.info("Info Message {}");
51-
verify(loggerContext, "o.a.l.l.j.LoggerTest Info Message {} MDC{}" + Strings.LINE_SEPARATOR);
49+
verify(context, "o.a.l.l.j.LoggerTest Info Message {} MDC{}" + Strings.LINE_SEPARATOR);
5250
}
5351

54-
private static void verify(final LoggerContext loggerContext, final String expected) {
55-
final ListAppender listApp = loggerContext.getConfiguration().getAppender("List");
52+
private static void verify(final LoggerContext context, final String expected) {
53+
final ListAppender listApp = context.getConfiguration().getAppender("List");
5654
final List<String> events = listApp.getMessages();
5755
assertThat(events).hasSize(1).containsExactly(expected);
5856
listApp.clear();

0 commit comments

Comments
 (0)