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 | 49902715d753ef740af36a47e9ee9e98c3735227 (patch) | |
tree | 5e04c4dd38e99a5100089a934596bec2bf70b3e5 /java/common/src/test | |
parent | efb0bd0b298dd086309fa409643737b4e3b8dab5 (diff) | |
download | qpid-python-49902715d753ef740af36a47e9ee9e98c3735227.tar.gz |
QPID-2508, Committing a patch from Emmanuel Bourg
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@936575 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/common/src/test')
-rw-r--r-- | java/common/src/test/java/org/apache/qpid/transport/ConnectionTest.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/java/common/src/test/java/org/apache/qpid/transport/ConnectionTest.java b/java/common/src/test/java/org/apache/qpid/transport/ConnectionTest.java index 6554b135f5..0ca4a0c659 100644 --- a/java/common/src/test/java/org/apache/qpid/transport/ConnectionTest.java +++ b/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"); } |