aboutsummaryrefslogtreecommitdiffstats
path: root/jrt/tests
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-02-24 13:39:34 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2022-02-24 13:39:34 +0100
commit3698abcfaf3402ec1031cedf0f44cc85af9a9ecf (patch)
tree76108bb57f32439b1e1c2f2f1f58e218c0961bf6 /jrt/tests
parentbaeeee73dc453a803376ac1bbc9e1c81813f7dcb (diff)
Add a synchronized isConnected() method on the Connection.
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();