remove extraneous printStacks from activemq-core test run console, stacks are now in the test log

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@707590 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2008-10-24 09:45:58 +00:00
parent c96cdf04d2
commit 8b34eacc26
3 changed files with 18 additions and 3 deletions

View File

@ -484,7 +484,9 @@ public abstract class DemandForwardingBridgeSupport implements NetworkBridge {
}
}
} catch (Throwable e) {
e.printStackTrace();
if (LOG.isDebugEnabled()) {
LOG.debug("Exception processing remote command: " + command, e);
}
serviceRemoteException(e);
}
}

View File

@ -357,7 +357,7 @@ public class JMSConsumerTest extends JmsTestSupport {
done2.countDown();
}
} catch (Throwable e) {
e.printStackTrace();
LOG.info("unexpected ex onMessage: ", e);
}
}
});

View File

@ -36,7 +36,7 @@ public class PooledTaskRunnerTest extends TestCase {
@Override
protected void setUp() throws Exception {
super.setUp();
executor = Executors.newCachedThreadPool();
executor = Executors.newCachedThreadPool(new IgnoreUncaughtExceptionThreadFactory());
}
@Override
@ -149,4 +149,17 @@ public class PooledTaskRunnerTest extends TestCase {
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
}
}
}