diff options
Diffstat (limited to 'jdisc_core/src/test/java/com/yahoo/jdisc/handler/ThreadedRequestHandlerTestCase.java')
-rw-r--r-- | jdisc_core/src/test/java/com/yahoo/jdisc/handler/ThreadedRequestHandlerTestCase.java | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/jdisc_core/src/test/java/com/yahoo/jdisc/handler/ThreadedRequestHandlerTestCase.java b/jdisc_core/src/test/java/com/yahoo/jdisc/handler/ThreadedRequestHandlerTestCase.java index f639877b87b..63a6d310208 100644 --- a/jdisc_core/src/test/java/com/yahoo/jdisc/handler/ThreadedRequestHandlerTestCase.java +++ b/jdisc_core/src/test/java/com/yahoo/jdisc/handler/ThreadedRequestHandlerTestCase.java @@ -6,7 +6,7 @@ import com.yahoo.jdisc.Response; import com.yahoo.jdisc.application.ContainerBuilder; import com.yahoo.jdisc.service.CurrentContainer; import com.yahoo.jdisc.test.TestDriver; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.net.URI; import java.nio.ByteBuffer; @@ -18,12 +18,12 @@ import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; /** * @author Simon Thoresen Hult @@ -31,7 +31,7 @@ import static org.junit.Assert.fail; public class ThreadedRequestHandlerTestCase { @Test - public void requireThatNullExecutorThrowsException() { + void requireThatNullExecutorThrowsException() { try { new ThreadedRequestHandler(null) { @@ -47,7 +47,7 @@ public class ThreadedRequestHandlerTestCase { } @Test - public void requireThatAccessorWork() { + void requireThatAccessorWork() { MyRequestHandler requestHandler = new MyRequestHandler(newExecutor()); requestHandler.setTimeout(1000, TimeUnit.MILLISECONDS); assertEquals(1000, requestHandler.getTimeout(TimeUnit.MILLISECONDS)); @@ -55,7 +55,7 @@ public class ThreadedRequestHandlerTestCase { } @Test - public void requireThatHandlerSetsRequestTimeout() throws InterruptedException { + void requireThatHandlerSetsRequestTimeout() throws InterruptedException { MyRequestHandler requestHandler = new MyRequestHandler(newExecutor()); requestHandler.setTimeout(600, TimeUnit.SECONDS); TestDriver driver = newTestDriver("http://localhost/", requestHandler); @@ -74,7 +74,7 @@ public class ThreadedRequestHandlerTestCase { } @Test - public void requireThatRequestAndResponseReachHandlers() throws InterruptedException { + void requireThatRequestAndResponseReachHandlers() throws InterruptedException { MyRequestHandler requestHandler = new MyRequestHandler(newExecutor()); TestDriver driver = newTestDriver("http://localhost/", requestHandler); @@ -99,18 +99,18 @@ public class ThreadedRequestHandlerTestCase { } @Test - public void requireThatNotImplementedHandlerDoesNotPreventShutdown() throws Exception { + void requireThatNotImplementedHandlerDoesNotPreventShutdown() throws Exception { TestDriver driver = newTestDriver("http://localhost/", new ThreadedRequestHandler(newExecutor()) { }); assertEquals(Response.Status.NOT_IMPLEMENTED, - dispatchRequest(driver, "http://localhost/", ByteBuffer.wrap(new byte[] { 69 })) - .get(600, TimeUnit.SECONDS).getStatus()); + dispatchRequest(driver, "http://localhost/", ByteBuffer.wrap(new byte[]{69})) + .get(600, TimeUnit.SECONDS).getStatus()); assertTrue(driver.close()); } @Test - public void requireThatThreadedRequestHandlerRetainsTheRequestUntilHandlerIsRun() throws Exception { + void requireThatThreadedRequestHandlerRetainsTheRequestUntilHandlerIsRun() throws Exception { final TestDriver driver = TestDriver.newSimpleApplicationInstanceWithoutOsgi(); ContainerBuilder builder = driver.newContainerBuilder(); final AtomicInteger baseRetainCount = new AtomicInteger(); @@ -130,7 +130,7 @@ public class ThreadedRequestHandlerTestCase { @Override public void handleRequest(Request request, ReadableContentChannel requestContent, - ResponseHandler responseHandler) { + ResponseHandler responseHandler) { try { entryLatch.await(600, TimeUnit.SECONDS); } catch (InterruptedException e) { |