summaryrefslogtreecommitdiff
path: root/qpid/java/client
diff options
context:
space:
mode:
authorArnaud Simon <arnaudsimon@apache.org>2007-10-23 16:47:22 +0000
committerArnaud Simon <arnaudsimon@apache.org>2007-10-23 16:47:22 +0000
commit6bde6cb059fff2eb1dd4c50fe634727845b636e5 (patch)
treeb741224d77ce2ff86be01074deef4def95d8e1db /qpid/java/client
parent409a61121233fdd7b454db3ff87c806b691749f8 (diff)
downloadqpid-python-6bde6cb059fff2eb1dd4c50fe634727845b636e5.tar.gz
cahnged for setting the consumer before the producer
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@587552 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/client')
-rw-r--r--qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/connection/ConnectionStartTest.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/connection/ConnectionStartTest.java b/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/connection/ConnectionStartTest.java
index e115821755..e2d3832cc9 100644
--- a/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/connection/ConnectionStartTest.java
+++ b/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/connection/ConnectionStartTest.java
@@ -60,14 +60,15 @@ public class ConnectionStartTest extends QpidTestCase
MessageProducer pub = pubSess.createProducer(queue);
- pub.send(pubSess.createTextMessage("Initial Message"));
-
_connection = (AMQConnection) getConnection("guest", "guest");
_consumerSess = _connection.createSession(false, AMQSession.AUTO_ACKNOWLEDGE);
_consumer = _consumerSess.createConsumer(queue);
+ //publish after queue is created to ensure it can be routed as expected
+ pub.send(pubSess.createTextMessage("Initial Message"));
+
pubCon.close();
}
@@ -82,7 +83,7 @@ public class ConnectionStartTest extends QpidTestCase
{
_connection.close();
}
-
+
public void testSimpleReceiveConnection()
{
try
@@ -90,9 +91,9 @@ public class ConnectionStartTest extends QpidTestCase
assertTrue("Connection should not be started", !_connection.started());
//Note that this next line will start the dispatcher in the session
// should really not be called before _connection start
- assertTrue("There should not be messages waiting for the consumer", _consumer.receiveNoWait() == null);
+ //assertTrue("There should not be messages waiting for the consumer", _consumer.receiveNoWait() == null);
_connection.start();
- assertTrue("There should be messages waiting for the consumer", _consumer.receive(10*1000) == null);
+ assertTrue("There should be messages waiting for the consumer", _consumer.receive(10*1000) != null);
assertTrue("Connection should be started", _connection.started());
}
@@ -110,7 +111,7 @@ public class ConnectionStartTest extends QpidTestCase
try
{
assertTrue("Connection should not be started", !_connection.started());
- _consumerSess.setMessageListener(new MessageListener()
+ _consumer.setMessageListener(new MessageListener()
{
public void onMessage(Message message)
{
@@ -133,7 +134,7 @@ public class ConnectionStartTest extends QpidTestCase
try
{
- _gotMessage.await(1000, TimeUnit.MILLISECONDS);
+ assertTrue("Listener was never called", _gotMessage.await(10 * 1000, TimeUnit.MILLISECONDS));
}
catch (InterruptedException e)
{