summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Gemmell <robbie@apache.org>2011-03-28 09:58:41 +0000
committerRobert Gemmell <robbie@apache.org>2011-03-28 09:58:41 +0000
commitd49e5f7e894e972e789693790c4edf09486af889 (patch)
tree5b8ca85d59c3d58d1819f9763705df0af4376206
parentdd1621a65a5cbc02de76d96a5752d9023adf9fc8 (diff)
downloadqpid-python-d49e5f7e894e972e789693790c4edf09486af889.tar.gz
QPID-3166: updates based on review feedback from Keith Wall
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/0.5.x-dev@1086168 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/server/queue/MultipleTransactedBatchProducerTest.java50
1 files changed, 24 insertions, 26 deletions
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/MultipleTransactedBatchProducerTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/MultipleTransactedBatchProducerTest.java
index cfa03931c6..bf473fb30f 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/MultipleTransactedBatchProducerTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/MultipleTransactedBatchProducerTest.java
@@ -34,29 +34,6 @@ import javax.jms.Session;
import org.apache.log4j.Logger;
import org.apache.qpid.test.utils.QpidTestCase;
-/**
- * MultipleTransactedBatchProducerTest
- *
- * Summary:
- * When there are multiple producers submitting batches of messages to a given
- * queue using transacted sessions, it is highly probable that concurrent
- * enqueue() activity will occur and attempt delivery of their message to the
- * same subscription. In this scenario it is likely that one of the attempts
- * will succeed and the other will result in use of the deliverAsync() method
- * to start a queue Runner and ensure delivery of the message.
- *
- * A defect within the processQueue() method used by the Runner would mean that
- * delivery of these messages may not occur, should the Runner stop before all
- * messages have been processed. Such a defect was discovered and found to be
- * most visible when Selectors are used such that one and only one subscription
- * can/will accept any given message, but multiple subscriptions are present,
- * and one of the earlier subscriptions receives more messages than the others.
- *
- * This test is to validate that the processQueue() method is able to correctly
- * deliver all of the messages present for asynchronous delivery to subscriptions,
- * by utilising multiple batch transacted producers to create the scenario and
- * ensure all messages are received by a consumer.
- */
public class MultipleTransactedBatchProducerTest extends QpidTestCase
{
private static final Logger _logger = Logger.getLogger(MultipleTransactedBatchProducerTest.class);
@@ -70,7 +47,7 @@ public class MultipleTransactedBatchProducerTest extends QpidTestCase
private CountDownLatch _receivedLatch;
private String _queueName;
- private String _failMsg;
+ private transient String _failMsg;
public void setUp() throws Exception
{
@@ -83,6 +60,26 @@ public class MultipleTransactedBatchProducerTest extends QpidTestCase
_failMsg = null;
}
+ /**
+ * When there are multiple producers submitting batches of messages to a given
+ * queue using transacted sessions, it is highly probable that concurrent
+ * enqueue() activity will occur and attempt delivery of their message to the
+ * same subscription. In this scenario it is likely that one of the attempts
+ * will succeed and the other will result in use of the deliverAsync() method
+ * to start a queue Runner and ensure delivery of the message.
+ *
+ * A defect within the processQueue() method used by the Runner would mean that
+ * delivery of these messages may not occur, should the Runner stop before all
+ * messages have been processed. Such a defect was discovered and found to be
+ * most visible when Selectors are used such that one and only one subscription
+ * can/will accept any given message, but multiple subscriptions are present,
+ * and one of the earlier subscriptions receives more messages than the others.
+ *
+ * This test is to validate that the processQueue() method is able to correctly
+ * deliver all of the messages present for asynchronous delivery to subscriptions,
+ * by utilising multiple batch transacted producers to create the scenario and
+ * ensure all messages are received by a consumer.
+ */
public void testMultipleBatchedProducersWithMultipleConsumersUsingSelectors() throws Exception
{
String selector1 = ("(\"" + _queueName +"\" % " + NUM_CONSUMERS + ") = 0");
@@ -130,7 +127,6 @@ public class MultipleTransactedBatchProducerTest extends QpidTestCase
assertNull("Test failed because: " + String.valueOf(_failMsg), _failMsg);
assertTrue("Some of the messages were not all recieved in the given timeframe, remaining count was: "+_receivedLatch.getCount(),
result);
-
}
@Override
@@ -138,7 +134,9 @@ public class MultipleTransactedBatchProducerTest extends QpidTestCase
{
Message message = super.createNextMessage(session,msgCount);
- //bias at least 50% of the messages to the first consumers selector
+ //bias at least 50% of the messages to the first consumers selector because
+ //the issue presents itself primarily when an earlier subscription completes
+ //delivery after the later subscriptions
int val;
if (msgCount % 2 == 0)
{