fixes to printed exception stack traces in tests

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
Lachlan Roberts 2018-05-29 17:54:16 +10:00
parent 4785662efa
commit 69aaabac24
4 changed files with 15 additions and 4 deletions

View File

@ -150,7 +150,10 @@ public abstract class SslBytesTest
}
catch (IOException x)
{
x.printStackTrace();
logger.warn(x.getClass() + ": " + x.getMessage());
if(logger.isDebugEnabled())
logger.debug(x);
}
}

View File

@ -835,7 +835,10 @@ public class SocketChannelEndPointTest
}
catch (InterruptedException | EofException e)
{
LOG.info(e);
if(LOG.isDebugEnabled())
LOG.debug(e);
else
LOG.info(e.getClass().getName());
}
catch (Exception e)
{

View File

@ -49,7 +49,11 @@ public abstract class TrackingSocket
protected void addError(Throwable t)
{
LOG.warn(t);
LOG.warn(t.getClass() + ": " + t.getMessage());
if(LOG.isDebugEnabled())
LOG.debug(t);
errorQueue.offer(t);
}

View File

@ -55,6 +55,7 @@ import org.eclipse.jetty.server.handler.AbstractHandler;
import org.eclipse.jetty.util.Callback;
import org.eclipse.jetty.util.IO;
import org.eclipse.jetty.util.log.StacklessLogging;
import org.eclipse.jetty.util.thread.QueuedThreadPool;
import org.hamcrest.Matchers;
import org.junit.Assert;
import org.junit.Assume;
@ -430,7 +431,7 @@ public class ServerTimeoutsTest extends AbstractTest
});
setServerIdleTimeout(idleTimeout);
try (StacklessLogging stackless = new StacklessLogging(HttpChannel.class))
try (StacklessLogging stackless = new StacklessLogging(HttpChannel.class, QueuedThreadPool.class))
{
DeferredContentProvider contentProvider = new DeferredContentProvider();
CountDownLatch resultLatch = new CountDownLatch(1);