diff options
| author | Rajith Muditha Attapattu <rajith@apache.org> | 2010-04-22 00:03:56 +0000 |
|---|---|---|
| committer | Rajith Muditha Attapattu <rajith@apache.org> | 2010-04-22 00:03:56 +0000 |
| commit | b70c5f38dca07d23edead557ec0a2a2ce585c23e (patch) | |
| tree | d4a17d9b249adac7b64b2f69c5fdf16c0641c2d9 /qpid/java/common/src/test | |
| parent | ecbb521e43eb4f5e2041bfee32f5d0479b2a9aad (diff) | |
| download | qpid-python-b70c5f38dca07d23edead557ec0a2a2ce585c23e.tar.gz | |
QPID-2498
Committing a patch from Emmanuel Bourg
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@936575 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/common/src/test')
| -rw-r--r-- | qpid/java/common/src/test/java/org/apache/qpid/transport/ConnectionTest.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/qpid/java/common/src/test/java/org/apache/qpid/transport/ConnectionTest.java b/qpid/java/common/src/test/java/org/apache/qpid/transport/ConnectionTest.java index 6554b135f5..0ca4a0c659 100644 --- a/qpid/java/common/src/test/java/org/apache/qpid/transport/ConnectionTest.java +++ b/qpid/java/common/src/test/java/org/apache/qpid/transport/ConnectionTest.java @@ -22,8 +22,6 @@ package org.apache.qpid.transport; import org.apache.mina.util.AvailablePortFinder; -import org.apache.qpid.util.concurrent.Condition; - import org.apache.qpid.transport.network.ConnectionBinding; import org.apache.qpid.transport.network.io.IoAcceptor; import org.apache.qpid.transport.util.Logger; @@ -34,6 +32,8 @@ import junit.framework.TestCase; import java.util.ArrayList; import java.util.List; import java.util.Collections; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; import java.io.IOException; import static org.apache.qpid.transport.Option.*; @@ -157,7 +157,7 @@ public class ConnectionTest extends TestCase implements SessionListener null, msg, sync ? SYNC : NONE); } - private Connection connect(final Condition closed) + private Connection connect(final CountDownLatch closed) { Connection conn = new Connection(); conn.addConnectionListener(new ConnectionListener() @@ -171,7 +171,7 @@ public class ConnectionTest extends TestCase implements SessionListener { if (closed != null) { - closed.set(); + closed.countDown(); } } }); @@ -188,7 +188,7 @@ public class ConnectionTest extends TestCase implements SessionListener // Start server as 0-9 to froce a ProtocolVersionException startServer(new ProtocolHeader(1, 0, 9)); - Condition closed = new Condition(); + CountDownLatch closed = new CountDownLatch(1); try { @@ -249,13 +249,13 @@ public class ConnectionTest extends TestCase implements SessionListener { startServer(); - Condition closed = new Condition(); + CountDownLatch closed = new CountDownLatch(1); Connection conn = connect(closed); Session ssn = conn.createSession(1); send(ssn, "CLOSE"); - if (!closed.get(3000)) + if (!closed.await(3, TimeUnit.SECONDS)) { fail("never got notified of connection close"); } |
