fixing a small test leak

TearDown is supposed to remove the getRootLogger(), at the same place it was 
added.
This appender was living the entire life cycle of the JVM after this test.


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/f2837bac
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/f2837bac
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/f2837bac

Branch: refs/heads/master
Commit: f2837bac037569d77660c9f997b07918e02d5671
Parents: 0a16138
Author: Clebert Suconic <[email protected]>
Authored: Wed Apr 8 10:29:13 2015 -0400
Committer: Clebert Suconic <[email protected]>
Committed: Wed Apr 8 10:33:42 2015 -0400

----------------------------------------------------------------------
 .../test/java/org/apache/activemq/bugs/AMQ3779Test.java   | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/f2837bac/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ3779Test.java
----------------------------------------------------------------------
diff --git 
a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ3779Test.java 
b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ3779Test.java
index e068a4c..a076f03 100644
--- 
a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ3779Test.java
+++ 
b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ3779Test.java
@@ -17,14 +17,11 @@
 
 package org.apache.activemq.bugs;
 
-import static org.junit.Assert.assertTrue;
-
-import java.util.concurrent.atomic.AtomicBoolean;
-
 import javax.jms.Connection;
 import javax.jms.DeliveryMode;
 import javax.jms.MessageProducer;
 import javax.jms.Session;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.broker.BrokerService;
@@ -37,6 +34,8 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.junit.Assert.assertTrue;
+
 public class AMQ3779Test {
 
     private static final Logger LOG = Logger.getLogger(AMQ3779Test.class);
@@ -84,8 +83,9 @@ public class AMQ3779Test {
                 brokerService.waitUntilStopped();
             }
         } finally {
-            LOG.removeAppender(appender);
+           Logger.getRootLogger().removeAppender(appender);
         }
+
     }
 
     @Test(timeout = 60000)

Reply via email to