Skip to content

Commit

Permalink
Rename Resources to Log4jStaticResources
Browse files Browse the repository at this point in the history
  • Loading branch information
ppkarwasz committed Mar 27, 2024
1 parent ec77306 commit 557e621
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
@Documented
@Inherited
@ExtendWith(ThreadContextInitializer.class)
@ResourceLock(value = Resources.THREAD_CONTEXT, mode = ResourceAccessMode.READ_WRITE)
@ResourceLock(value = Log4jStaticResources.THREAD_CONTEXT, mode = ResourceAccessMode.READ_WRITE)
public @interface InitializesThreadContext {}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/**
* Constants to use the {@link ResourceLock} annotation.
*/
public final class Resources {
public final class Log4jStaticResources {

/**
* Marks tests that require access to {@link org.apache.logging.log4j.LogManager} methods or change its
Expand Down Expand Up @@ -51,5 +51,5 @@ public final class Resources {
*/
public static final String STATUS_LOGGER = "log4j.StatusLogger";

private Resources() {}
private Log4jStaticResources() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@
@Inherited
@ExtendWith(ThreadContextMapExtension.class)
@ReadsSystemProperty
@ResourceLock(value = Resources.THREAD_CONTEXT, mode = ResourceAccessMode.READ)
@ResourceLock(value = Log4jStaticResources.THREAD_CONTEXT, mode = ResourceAccessMode.READ)
public @interface UsingThreadContextMap {}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import org.apache.logging.log4j.spi.AbstractLogger;
import org.apache.logging.log4j.status.StatusData;
import org.apache.logging.log4j.status.StatusLogger;
import org.apache.logging.log4j.test.junit.Resources;
import org.apache.logging.log4j.test.junit.Log4jStaticResources;
import org.apache.logging.log4j.test.junit.StatusLoggerLevel;
import org.apache.logging.log4j.util.MessageSupplier;
import org.apache.logging.log4j.util.Supplier;
Expand All @@ -42,7 +42,7 @@
import org.junit.jupiter.api.parallel.ResourceLock;

@StatusLoggerLevel("WARN")
@ResourceLock(value = Resources.MARKER_MANAGER, mode = ResourceAccessMode.READ)
@ResourceLock(value = Log4jStaticResources.MARKER_MANAGER, mode = ResourceAccessMode.READ)
public class AbstractLoggerTest {

private static final StringBuilder CHAR_SEQ = new StringBuilder("CharSeq");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
import org.apache.logging.log4j.message.StructuredDataMessage;
import org.apache.logging.log4j.test.TestLogger;
import org.apache.logging.log4j.test.TestLoggerContextFactory;
import org.apache.logging.log4j.test.junit.Log4jStaticResources;
import org.apache.logging.log4j.test.junit.LoggerContextFactoryExtension;
import org.apache.logging.log4j.test.junit.Resources;
import org.apache.logging.log4j.test.junit.UsingThreadContextMap;
import org.apache.logging.log4j.util.Strings;
import org.apache.logging.log4j.util.Supplier;
Expand All @@ -53,7 +53,7 @@
import org.junit.jupiter.api.parallel.ResourceLock;
import org.junitpioneer.jupiter.ReadsSystemProperty;

@ResourceLock(value = Resources.MARKER_MANAGER, mode = ResourceAccessMode.READ)
@ResourceLock(value = Log4jStaticResources.MARKER_MANAGER, mode = ResourceAccessMode.READ)
@ReadsSystemProperty
public class LoggerTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

import org.apache.logging.log4j.test.junit.Resources;
import org.apache.logging.log4j.test.junit.Log4jStaticResources;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.ResourceAccessMode;
import org.junit.jupiter.api.parallel.ResourceLock;

@ResourceLock(value = Resources.MARKER_MANAGER, mode = ResourceAccessMode.READ_WRITE)
@ResourceLock(value = Log4jStaticResources.MARKER_MANAGER, mode = ResourceAccessMode.READ_WRITE)
public class MarkerTest {

@BeforeEach
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@

import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.simple.SimpleLoggerContextFactory;
import org.apache.logging.log4j.test.junit.Log4jStaticResources;
import org.apache.logging.log4j.test.junit.LoggerContextFactoryExtension;
import org.apache.logging.log4j.test.junit.Resources;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.junit.jupiter.api.parallel.ResourceLock;

@ResourceLock(Resources.LOG_MANAGER)
@ResourceLock(Log4jStaticResources.LOG_MANAGER)
public class TestConfiguratorError {

@RegisterExtension
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
import org.apache.logging.log4j.status.StatusConsoleListener;
import org.apache.logging.log4j.status.StatusListener;
import org.apache.logging.log4j.status.StatusLogger;
import org.apache.logging.log4j.test.junit.Resources;
import org.apache.logging.log4j.test.junit.Log4jStaticResources;
import org.apache.logging.log4j.test.junit.SetTestProperty;
import org.apache.logging.log4j.test.junit.UsingTestProperties;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.ResourceLock;
import org.opentest4j.AssertionFailedError;

@UsingTestProperties
@ResourceLock(Resources.STATUS_LOGGER)
@ResourceLock(Log4jStaticResources.STATUS_LOGGER)
public class XmlConfigurationPropsTest {

private static final String CONFIG_NAME = "XmlConfigurationPropsTest";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import org.apache.logging.log4j.core.config.Configurator;
import org.apache.logging.log4j.core.test.appender.ListAppender;
import org.apache.logging.log4j.test.TestProperties;
import org.apache.logging.log4j.test.junit.Resources;
import org.apache.logging.log4j.test.junit.Log4jStaticResources;
import org.apache.logging.log4j.test.junit.UsingTestProperties;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
Expand All @@ -46,8 +46,8 @@
* Unit test for simple App.
*/
@UsingTestProperties
@ResourceLock(Resources.THREAD_CONTEXT)
@ResourceLock(Resources.LOG_MANAGER)
@ResourceLock(Log4jStaticResources.THREAD_CONTEXT)
@ResourceLock(Log4jStaticResources.LOG_MANAGER)
public class MutableThreadContextMapFilterTest implements MutableThreadContextMapFilter.FilterConfigUpdateListener {

static final String CONFIG = "MutableThreadContextMapFilterTest.xml";
Expand Down

0 comments on commit 557e621

Please sign in to comment.