activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1212337 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ3567Test.java
Date Fri, 09 Dec 2011 11:39:05 GMT
Author: gtully
Date: Fri Dec  9 11:39:05 2011
New Revision: 1212337

URL: http://svn.apache.org/viewvc?rev=1212337&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-3628 - updated patch applied with thanks

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ3567Test.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ3567Test.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ3567Test.java?rev=1212337&r1=1212336&r2=1212337&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ3567Test.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/AMQ3567Test.java Fri
Dec  9 11:39:05 2011
@@ -41,6 +41,7 @@ import org.apache.log4j.Layout;
 import org.apache.log4j.Level;
 import org.apache.log4j.PatternLayout;
 import org.apache.log4j.WriterAppender;
+import org.apache.log4j.Appender;
 import org.apache.log4j.spi.LoggingEvent;
 import org.junit.Before;
 import org.junit.Test;
@@ -80,7 +81,7 @@ public class AMQ3567Test {
         org.apache.log4j.Logger log4jLogger = org.apache.log4j.Logger.getLogger("org.apache.activemq.util.ServiceSupport");
         final AtomicBoolean failed = new AtomicBoolean(false);
 
-        log4jLogger.addAppender(new DefaultTestAppender() {
+        Appender appender = new DefaultTestAppender() {
             @Override
             public void doAppend(LoggingEvent event) {
                 if (event.getThrowableInformation() != null) {
@@ -93,7 +94,8 @@ public class AMQ3567Test {
                     }
                 }
             }
-        });
+        };
+        log4jLogger.addAppender(appender);
         
         Level level = log4jLogger.getLevel();
         log4jLogger.setLevel(Level.DEBUG);
@@ -109,6 +111,7 @@ public class AMQ3567Test {
 
         } finally {
             log4jLogger.setLevel(level);
+            log4jLogger.removeAppender(appender);
         }
     }
 



Mime
View raw message