This test did not clean up after itself and caused other tests to fail
in Eclipse.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/2741e01c
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/2741e01c
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/2741e01c

Branch: refs/heads/master
Commit: 2741e01c9728b21d0cd55ddd025f8bac2b2df073
Parents: a42b95b
Author: Gary Gregory <[email protected]>
Authored: Mon Nov 17 21:54:28 2014 -0500
Committer: Gary Gregory <[email protected]>
Committed: Mon Nov 17 21:54:28 2014 -0500

----------------------------------------------------------------------
 .../test/java/org/apache/log4j/VelocityTest.java | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/2741e01c/log4j-1.2-api/src/test/java/org/apache/log4j/VelocityTest.java
----------------------------------------------------------------------
diff --git a/log4j-1.2-api/src/test/java/org/apache/log4j/VelocityTest.java 
b/log4j-1.2-api/src/test/java/org/apache/log4j/VelocityTest.java
index 8d8bc1a..e595ab0 100644
--- a/log4j-1.2-api/src/test/java/org/apache/log4j/VelocityTest.java
+++ b/log4j-1.2-api/src/test/java/org/apache/log4j/VelocityTest.java
@@ -18,9 +18,15 @@ package org.apache.log4j;
 
 import java.io.StringWriter;
 
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.core.LoggerContext;
+import org.apache.logging.log4j.core.config.Configurator;
+import org.apache.logging.log4j.status.StatusLogger;
 import org.apache.velocity.Template;
 import org.apache.velocity.VelocityContext;
 import org.apache.velocity.app.Velocity;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
 import org.junit.Test;
 
 /**
@@ -28,6 +34,19 @@ import org.junit.Test;
  */
 public class VelocityTest {
 
+private static LoggerContext context;
+    
+    @BeforeClass
+    public static void setupClass() {
+        context = (LoggerContext) LogManager.getContext(false);
+    }
+
+    @AfterClass
+    public static void tearDownClass() {
+        Configurator.shutdown(context);
+        StatusLogger.getLogger().reset();
+    }    
+    
     @Test
     public void testVelocity() {
         Velocity.init();

Reply via email to