Fix log config in test
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/aa83df3b Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/aa83df3b Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/aa83df3b Branch: refs/heads/LOG4J2-1136 Commit: aa83df3b235d8c8dd786874834110ed7fcb69520 Parents: 9eb9d1e Author: Mikael Ståldal <[email protected]> Authored: Tue Sep 29 15:59:00 2015 +0200 Committer: Ralph Goers <[email protected]> Committed: Sat Oct 3 23:08:04 2015 -0700 ---------------------------------------------------------------------- .../appender/AsyncAppenderShutdownTimeoutTest.java | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/aa83df3b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/AsyncAppenderShutdownTimeoutTest.java ---------------------------------------------------------------------- diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/AsyncAppenderShutdownTimeoutTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/AsyncAppenderShutdownTimeoutTest.java index 7b66a43..8e9a73d 100644 --- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/AsyncAppenderShutdownTimeoutTest.java +++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/AsyncAppenderShutdownTimeoutTest.java @@ -19,26 +19,17 @@ package org.apache.logging.log4j.core.appender; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.core.LoggerContext; -import org.apache.logging.log4j.core.config.ConfigurationFactory; -import org.junit.AfterClass; -import org.junit.BeforeClass; +import org.apache.logging.log4j.junit.LoggerContextRule; +import org.junit.ClassRule; import org.junit.Test; /** * */ public class AsyncAppenderShutdownTimeoutTest { - private static final String CONFIG = "log4j-asynch-shutdownTimeout.xml"; - @BeforeClass - public static void setupClass() { - System.setProperty(ConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG); - } - - @AfterClass - public static void cleanupClass() { - System.clearProperty(ConfigurationFactory.CONFIGURATION_FILE_PROPERTY); - } + @ClassRule + public static LoggerContextRule init = new LoggerContextRule("log4j-asynch-shutdownTimeout.xml"); @Test(timeout = 2000) public void shutdownTest() throws Exception {
