Suppress stacks during sweeper test

This commit is contained in:
Greg Wilkins 2016-07-07 08:32:36 +10:00
parent 8a12915dac
commit 322fe73869

View File

@ -21,6 +21,7 @@ package org.eclipse.jetty.util.thread;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import org.eclipse.jetty.util.log.StacklessLogging;
import org.junit.After; import org.junit.After;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Before; import org.junit.Before;
@ -90,6 +91,8 @@ public class SweeperTest
@Test @Test
public void testSweepThrows() throws Exception public void testSweepThrows() throws Exception
{
try(StacklessLogging scope = new StacklessLogging(Sweeper.class))
{ {
long period = 500; long period = 500;
final CountDownLatch taskLatch = new CountDownLatch(2); final CountDownLatch taskLatch = new CountDownLatch(2);
@ -111,7 +114,7 @@ public class SweeperTest
public boolean sweep() public boolean sweep()
{ {
sweepLatch.countDown(); sweepLatch.countDown();
throw new NullPointerException(); throw new NullPointerException("Test exception!");
} }
}); });
@ -121,4 +124,5 @@ public class SweeperTest
sweeper.stop(); sweeper.stop();
} }
}
} }