summaryrefslogtreecommitdiffstats
path: root/jrt/tests/com/yahoo/jrt/TimeoutTest.java
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@oath.com>2018-04-27 13:35:40 +0200
committerJon Bratseth <bratseth@oath.com>2018-04-27 13:35:40 +0200
commitd12f069567a99536c84598700ad4f00048936cde (patch)
tree61f04cddb5fe535694835497620cfdeb26a82dbf /jrt/tests/com/yahoo/jrt/TimeoutTest.java
parentd83814043998817d404b922e3050ce2006e8ec19 (diff)
Remove usage of junit.framework
Diffstat (limited to 'jrt/tests/com/yahoo/jrt/TimeoutTest.java')
-rw-r--r--jrt/tests/com/yahoo/jrt/TimeoutTest.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/jrt/tests/com/yahoo/jrt/TimeoutTest.java b/jrt/tests/com/yahoo/jrt/TimeoutTest.java
index ce9bb954d74..d1eb2a9895a 100644
--- a/jrt/tests/com/yahoo/jrt/TimeoutTest.java
+++ b/jrt/tests/com/yahoo/jrt/TimeoutTest.java
@@ -2,7 +2,13 @@
package com.yahoo.jrt;
-public class TimeoutTest extends junit.framework.TestCase {
+import org.junit.After;
+import org.junit.Before;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+public class TimeoutTest {
Supervisor server;
Acceptor acceptor;
@@ -10,10 +16,7 @@ public class TimeoutTest extends junit.framework.TestCase {
Target target;
Test.Barrier barrier;
- public TimeoutTest(String name) {
- super(name);
- }
-
+ @Before
public void setUp() throws ListenFailedException {
server = new Supervisor(new Transport());
client = new Supervisor(new Transport());
@@ -27,6 +30,7 @@ public class TimeoutTest extends junit.framework.TestCase {
barrier = new Test.Barrier();
}
+ @After
public void tearDown() {
target.close();
acceptor.shutdown().join();
@@ -42,6 +46,7 @@ public class TimeoutTest extends junit.framework.TestCase {
.get(1).asString()));
}
+ @org.junit.Test
public void testTimeout() {
Request req = new Request("concat");
req.parameters().add(new StringValue("abc"));
@@ -60,6 +65,7 @@ public class TimeoutTest extends junit.framework.TestCase {
assertEquals(0, req.returnValues().size());
}
+ @org.junit.Test
public void testNotTimeout() {
Request req = new Request("concat");
req.parameters().add(new StringValue("abc"));
@@ -75,4 +81,5 @@ public class TimeoutTest extends junit.framework.TestCase {
assertEquals(1, req.returnValues().size());
assertEquals("abcdef", req.returnValues().get(0).asString());
}
+
}