You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ma...@apache.org on 2020/09/17 19:01:15 UTC

[logging-log4j2] branch master updated: Specify resource lock for status logger extension

This is an automated email from the ASF dual-hosted git repository.

mattsicker pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git


The following commit(s) were added to refs/heads/master by this push:
     new ac9643c  Specify resource lock for status logger extension
ac9643c is described below

commit ac9643c82ab1df29db11c28e03f467f7f768593d
Author: Matt Sicker <bo...@gmail.com>
AuthorDate: Thu Sep 17 14:01:01 2020 -0500

    Specify resource lock for status logger extension
    
    Signed-off-by: Matt Sicker <bo...@gmail.com>
---
 .../src/test/java/org/apache/logging/log4j/AbstractLoggerTest.java     | 3 ++-
 .../test/java/org/apache/logging/log4j/junit/StatusLoggerLevel.java    | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/AbstractLoggerTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/AbstractLoggerTest.java
index 089a3fa..817f082 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/AbstractLoggerTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/AbstractLoggerTest.java
@@ -38,7 +38,6 @@ import static org.junit.jupiter.api.Assertions.*;
 
 @StatusLoggerLevel("WARN")
 @ResourceLock("log4j2.MarkerManager")
-@ResourceLock("log4j2.StatusLogger")
 public class AbstractLoggerTest {
 
     private static final StringBuilder CHAR_SEQ = new StringBuilder("CharSeq");
@@ -886,6 +885,7 @@ public class AbstractLoggerTest {
     }
 
     @Test
+    @ResourceLock("log4j2.StatusLogger")
     public void testMessageThrows() {
         final ThrowableExpectingLogger logger = new ThrowableExpectingLogger(false);
         logger.error(new TestMessage(() -> {
@@ -900,6 +900,7 @@ public class AbstractLoggerTest {
     }
 
     @Test
+    @ResourceLock("log4j2.StatusLogger")
     public void testMessageThrowsAndNullFormat() {
         final ThrowableExpectingLogger logger = new ThrowableExpectingLogger(false);
         logger.error(new TestMessage(() -> {
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/junit/StatusLoggerLevel.java b/log4j-api/src/test/java/org/apache/logging/log4j/junit/StatusLoggerLevel.java
index 9edf7b0..ef36d97 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/junit/StatusLoggerLevel.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/junit/StatusLoggerLevel.java
@@ -18,6 +18,7 @@
 package org.apache.logging.log4j.junit;
 
 import org.junit.jupiter.api.extension.ExtendWith;
+import org.junit.jupiter.api.parallel.ResourceLock;
 
 import java.lang.annotation.Documented;
 import java.lang.annotation.ElementType;
@@ -36,6 +37,7 @@ import java.lang.annotation.Target;
 @Documented
 @Inherited
 @ExtendWith(StatusLoggerLevelExtension.class)
+@ResourceLock("log4j2.StatusLogger")
 public @interface StatusLoggerLevel {
     /** Name of {@link org.apache.logging.log4j.Level} to use for status logger. */
     String value();