summaryrefslogtreecommitdiff
path: root/dotnet/Qpid.Integration.Tests/testcases/ProducerMultiConsumerTest.cs
diff options
context:
space:
mode:
Diffstat (limited to 'dotnet/Qpid.Integration.Tests/testcases/ProducerMultiConsumerTest.cs')
-rw-r--r--dotnet/Qpid.Integration.Tests/testcases/ProducerMultiConsumerTest.cs8
1 files changed, 5 insertions, 3 deletions
diff --git a/dotnet/Qpid.Integration.Tests/testcases/ProducerMultiConsumerTest.cs b/dotnet/Qpid.Integration.Tests/testcases/ProducerMultiConsumerTest.cs
index 43e60f94a0..7a4bf29cf6 100644
--- a/dotnet/Qpid.Integration.Tests/testcases/ProducerMultiConsumerTest.cs
+++ b/dotnet/Qpid.Integration.Tests/testcases/ProducerMultiConsumerTest.cs
@@ -81,6 +81,8 @@ namespace Apache.Qpid.Integration.Tests.testcases
{
try
{
+ // Close all end points for producer and consumers.
+ // Producer is on 0, and consumers on 1 .. n, so loop is from 0 to n inclusive.
for (int i = 0; i <= CONSUMER_COUNT; i++)
{
CloseEndPoint(i);
@@ -101,7 +103,7 @@ namespace Apache.Qpid.Integration.Tests.testcases
{
SetUpEndPoint(i, false, true, TEST_ROUTING_KEY + testId, AcknowledgeMode.AutoAcknowledge, false, ExchangeNameDefaults.TOPIC,
true, false, null);
- testConsumer[i].OnMessage = new MessageReceivedDelegate(OnMessage);
+ testConsumer[i].OnMessage += new MessageReceivedDelegate(OnMessage);
}
// Create an end-point to publish to the test topic.
@@ -130,7 +132,7 @@ namespace Apache.Qpid.Integration.Tests.testcases
{
SetUpEndPoint(i, false, true, TEST_ROUTING_KEY + testId, AcknowledgeMode.AutoAcknowledge, false, ExchangeNameDefaults.DIRECT,
true, false, null);
- testConsumer[i].OnMessage = new MessageReceivedDelegate(OnMessage);
+ testConsumer[i].OnMessage += new MessageReceivedDelegate(OnMessage);
}
// Create an end-point to publish to the test topic.
@@ -155,7 +157,7 @@ namespace Apache.Qpid.Integration.Tests.testcases
{
int newCount = Interlocked.Increment(ref _messageReceivedCount);
- if (newCount > expectedMessageCount)
+ if (newCount >= expectedMessageCount)
{
allReceived = true;
_finishedEvent.Set();