You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by mi...@apache.org on 2015/09/29 15:59:12 UTC

logging-log4j2 git commit: Fix log config in test

Repository: logging-log4j2
Updated Branches:
  refs/heads/master 3f87e7acd -> 887058519


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/88705851
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/88705851
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/88705851

Branch: refs/heads/master
Commit: 8870585199b54986c51b1b064b06f86985e14228
Parents: 3f87e7a
Author: Mikael Ståldal <mi...@magine.com>
Authored: Tue Sep 29 15:59:00 2015 +0200
Committer: Mikael Ståldal <mi...@magine.com>
Committed: Tue Sep 29 15:59:00 2015 +0200

----------------------------------------------------------------------
 .../appender/AsyncAppenderShutdownTimeoutTest.java | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/88705851/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 {