Issue #2542 - Log exception stackTraces instead of printing
replaces some usages of printStackTrace with logging in ConnectorTimeoutTest to avoid printing out the stack trace on passing tests Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
parent
04c1447f88
commit
0664893022
|
@ -43,6 +43,8 @@ import org.eclipse.jetty.server.handler.AbstractHandler;
|
||||||
import org.eclipse.jetty.toolchain.test.AdvancedRunner;
|
import org.eclipse.jetty.toolchain.test.AdvancedRunner;
|
||||||
import org.eclipse.jetty.toolchain.test.TestTracker;
|
import org.eclipse.jetty.toolchain.test.TestTracker;
|
||||||
import org.eclipse.jetty.util.IO;
|
import org.eclipse.jetty.util.IO;
|
||||||
|
import org.eclipse.jetty.util.log.Log;
|
||||||
|
import org.eclipse.jetty.util.log.Logger;
|
||||||
import org.eclipse.jetty.util.log.StacklessLogging;
|
import org.eclipse.jetty.util.log.StacklessLogging;
|
||||||
import org.hamcrest.Matchers;
|
import org.hamcrest.Matchers;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
|
@ -55,6 +57,8 @@ import org.junit.runner.RunWith;
|
||||||
@RunWith(AdvancedRunner.class)
|
@RunWith(AdvancedRunner.class)
|
||||||
public abstract class ConnectorTimeoutTest extends HttpServerTestFixture
|
public abstract class ConnectorTimeoutTest extends HttpServerTestFixture
|
||||||
{
|
{
|
||||||
|
protected static final Logger LOG = Log.getLogger(ConnectorTimeoutTest.class);
|
||||||
|
|
||||||
@Rule
|
@Rule
|
||||||
public TestTracker tracker = new TestTracker();
|
public TestTracker tracker = new TestTracker();
|
||||||
|
|
||||||
|
@ -610,11 +614,17 @@ public abstract class ConnectorTimeoutTest extends HttpServerTestFixture
|
||||||
}
|
}
|
||||||
catch(SSLException e)
|
catch(SSLException e)
|
||||||
{
|
{
|
||||||
e.printStackTrace();
|
if(LOG.isDebugEnabled())
|
||||||
|
LOG.debug(e);
|
||||||
|
else
|
||||||
|
LOG.info(e.getMessage());
|
||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
{
|
{
|
||||||
e.printStackTrace();
|
if(LOG.isDebugEnabled())
|
||||||
|
LOG.debug(e);
|
||||||
|
else
|
||||||
|
LOG.info(e.getMessage());
|
||||||
}
|
}
|
||||||
Assert.assertTrue(TimeUnit.NANOSECONDS.toMillis(System.nanoTime()) - start < maximumTestRuntime);
|
Assert.assertTrue(TimeUnit.NANOSECONDS.toMillis(System.nanoTime()) - start < maximumTestRuntime);
|
||||||
|
|
||||||
|
@ -639,11 +649,17 @@ public abstract class ConnectorTimeoutTest extends HttpServerTestFixture
|
||||||
}
|
}
|
||||||
catch(SSLException e)
|
catch(SSLException e)
|
||||||
{
|
{
|
||||||
e.printStackTrace();
|
if(LOG.isDebugEnabled())
|
||||||
|
LOG.debug(e);
|
||||||
|
else
|
||||||
|
LOG.info(e.getMessage());
|
||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
{
|
{
|
||||||
e.printStackTrace();
|
if(LOG.isDebugEnabled())
|
||||||
|
LOG.debug(e);
|
||||||
|
else
|
||||||
|
LOG.info(e.getMessage());
|
||||||
}
|
}
|
||||||
Assert.assertTrue(TimeUnit.NANOSECONDS.toMillis(System.nanoTime()) - start < maximumTestRuntime);
|
Assert.assertTrue(TimeUnit.NANOSECONDS.toMillis(System.nanoTime()) - start < maximumTestRuntime);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue