Author: gtully
Date: Fri Oct 24 02:45:58 2008
New Revision: 707590

URL: http://svn.apache.org/viewvc?rev=707590&view=rev
Log:
remove extraneous printStacks from activemq-core test run console, stacks are 
now in the test log

Modified:
    
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
    
activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSConsumerTest.java
    
activemq/trunk/activemq-core/src/test/java/org/apache/activemq/thread/PooledTaskRunnerTest.java

Modified: 
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
URL: 
http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java?rev=707590&r1=707589&r2=707590&view=diff
==============================================================================
--- 
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
 (original)
+++ 
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
 Fri Oct 24 02:45:58 2008
@@ -484,7 +484,9 @@
                     }
                 }
             } catch (Throwable e) {
-               e.printStackTrace();
+                if (LOG.isDebugEnabled()) {
+                    LOG.debug("Exception processing remote command: " + 
command, e);
+                }
                 serviceRemoteException(e);
             }
         }

Modified: 
activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSConsumerTest.java
URL: 
http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSConsumerTest.java?rev=707590&r1=707589&r2=707590&view=diff
==============================================================================
--- 
activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSConsumerTest.java
 (original)
+++ 
activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSConsumerTest.java
 Fri Oct 24 02:45:58 2008
@@ -357,7 +357,7 @@
                         done2.countDown();
                     }
                 } catch (Throwable e) {
-                    e.printStackTrace();
+                    LOG.info("unexpected ex onMessage: ", e);
                 }
             }
         });

Modified: 
activemq/trunk/activemq-core/src/test/java/org/apache/activemq/thread/PooledTaskRunnerTest.java
URL: 
http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/thread/PooledTaskRunnerTest.java?rev=707590&r1=707589&r2=707590&view=diff
==============================================================================
--- 
activemq/trunk/activemq-core/src/test/java/org/apache/activemq/thread/PooledTaskRunnerTest.java
 (original)
+++ 
activemq/trunk/activemq-core/src/test/java/org/apache/activemq/thread/PooledTaskRunnerTest.java
 Fri Oct 24 02:45:58 2008
@@ -36,7 +36,7 @@
     @Override
     protected void setUp() throws Exception {
         super.setUp();
-        executor = Executors.newCachedThreadPool();
+        executor = Executors.newCachedThreadPool(new 
IgnoreUncaughtExceptionThreadFactory());
     }
 
     @Override
@@ -149,4 +149,17 @@
             fail( "TaskRunner did not shut down cleanly" );
         }
     }
+    
+    class IgnoreUncaughtExceptionThreadFactory implements ThreadFactory, 
Thread.UncaughtExceptionHandler {
+        ThreadFactory threadFactory = Executors.defaultThreadFactory();
+        public Thread newThread(Runnable r) {
+            Thread thread = threadFactory.newThread(r);
+            thread.setUncaughtExceptionHandler(this);
+            return thread;
+        }
+        
+        public void uncaughtException(Thread t, Throwable e) {
+            // ignore ie: no printStackTrace that would sully the test console
+         }
+    }
 }
\ No newline at end of file


Reply via email to