summaryrefslogtreecommitdiffstats
path: root/jrt/tests
diff options
context:
space:
mode:
Diffstat (limited to 'jrt/tests')
-rw-r--r--jrt/tests/com/yahoo/jrt/ConnectTest.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/jrt/tests/com/yahoo/jrt/ConnectTest.java b/jrt/tests/com/yahoo/jrt/ConnectTest.java
index ae3c07eef69..6ad7198f310 100644
--- a/jrt/tests/com/yahoo/jrt/ConnectTest.java
+++ b/jrt/tests/com/yahoo/jrt/ConnectTest.java
@@ -12,23 +12,26 @@ public class ConnectTest {
Test.Orb client = new Test.Orb(new Transport());
Acceptor acceptor = server.listen(new Spec(0));
- Target target = client.connect(new Spec("localhost", acceptor.port()));
+ Connection target = (Connection) client.connect(new Spec("localhost", acceptor.port()));
for (int i = 0; i < 100; i++) {
- if (target.isValid()) {
+ if (target.isConnected()) {
break;
}
try { Thread.sleep(100); } catch (InterruptedException e) {}
}
- assertTrue(target.isValid());
+ assertTrue(target.isConnected());
+
target.close();
+
for (int i = 0; i < 100; i++) {
- if (!target.isValid()) {
+ if (!target.isClosed()) {
break;
}
try { Thread.sleep(100); } catch (InterruptedException e) {}
}
- assertFalse(target.isValid());
+ assertFalse(target.isClosed());
+
acceptor.shutdown().join();
client.transport().shutdown().join();
server.transport().shutdown().join();