diff options
| author | Aidan Skinner <aidan@apache.org> | 2008-05-07 14:09:16 +0000 |
|---|---|---|
| committer | Aidan Skinner <aidan@apache.org> | 2008-05-07 14:09:16 +0000 |
| commit | 9003422eef0d6b53e0448bc8f4c1f445094a43d9 (patch) | |
| tree | e00c460ce73539c9715c7c27f4250d5b4847829e /dotnet/Qpid.Integration.Tests/testcases | |
| parent | 372720db97414ef06e7830f6fc7621e08fe17a67 (diff) | |
| download | qpid-python-9003422eef0d6b53e0448bc8f4c1f445094a43d9.tar.gz | |
Merged revisions 653420-654109 via svnmerge from
https://svn.apache.org/repos/asf/incubator/qpid/branches/M2.x
........
r653447 | aidan | 2008-05-05 13:26:29 +0100 (Mon, 05 May 2008) | 1 line
Check if consumer is closed and dont reclose it
........
r653451 | aidan | 2008-05-05 13:29:15 +0100 (Mon, 05 May 2008) | 1 line
QPID-1022 Use synchronous writes to fix race conditions
........
r653452 | aidan | 2008-05-05 13:30:45 +0100 (Mon, 05 May 2008) | 1 line
QPID-1023 increase some timeouts
........
r653760 | aidan | 2008-05-06 13:40:34 +0100 (Tue, 06 May 2008) | 3 lines
QPID-1029: Generate temporary queue names using GUIDs to ensure uniqueness.
........
r654097 | aidan | 2008-05-07 14:25:38 +0100 (Wed, 07 May 2008) | 2 lines
QPID-952, QPID-951, QPID-1032 Fix failover, ensure that it is properly detected, that frames are replayed approrpiately and that failover does not timeout.
........
r654104 | aidan | 2008-05-07 14:46:51 +0100 (Wed, 07 May 2008) | 1 line
QPID-952 should have been part of previous commit
........
r654109 | aidan | 2008-05-07 14:56:09 +0100 (Wed, 07 May 2008) | 2 lines
QPID-1036 increase timeouts to more reasonable levels, ensure that durable queues are deleted when no longer needed
........
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@654113 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'dotnet/Qpid.Integration.Tests/testcases')
7 files changed, 52 insertions, 46 deletions
diff --git a/dotnet/Qpid.Integration.Tests/testcases/BaseMessagingTestFixture.cs b/dotnet/Qpid.Integration.Tests/testcases/BaseMessagingTestFixture.cs index f6d511034f..d4b61a2788 100644 --- a/dotnet/Qpid.Integration.Tests/testcases/BaseMessagingTestFixture.cs +++ b/dotnet/Qpid.Integration.Tests/testcases/BaseMessagingTestFixture.cs @@ -41,7 +41,7 @@ namespace Apache.Qpid.Integration.Tests.testcases private const string MESSAGE_DATA_BYTES = "-- Test Message -- Test Message -- Test Message -- Test Message -- Test Message ";
/// <summary> The default timeout in milliseconds to use on receives. </summary>
- private const long RECEIVE_WAIT = 500;
+ private const long RECEIVE_WAIT = 2000;
/// <summary> The default AMQ connection URL to use for tests. </summary>
public const string connectionUri = "amqp://guest:guest@test/test?brokerlist='tcp://localhost:5672'";
@@ -55,6 +55,9 @@ namespace Apache.Qpid.Integration.Tests.testcases /// <summary> Holds an array of channels for building mutiple test end-points. </summary>
protected IChannel[] testChannel = new IChannel[10];
+ /// <summary> Holds an array of queues for building mutiple test end-points. </summary>
+ protected String[] testQueue = new String[10];
+
/// <summary> Holds an array of producers for building mutiple test end-points. </summary>
protected IMessagePublisher[] testProducer = new IMessagePublisher[10];
@@ -65,7 +68,7 @@ namespace Apache.Qpid.Integration.Tests.testcases private static int uniqueId = 0;
/// <summary> Used to hold unique ids per test. </summary>
- protected int testId;
+ protected Guid testId;
/// <summary> Creates the test connection and channel. </summary>
[SetUp]
@@ -74,7 +77,7 @@ namespace Apache.Qpid.Integration.Tests.testcases log.Debug("public virtual void Init(): called");
// Set up a unique id for this test.
- testId = uniqueId++;
+ testId = System.Guid.NewGuid();
}
/// <summary>
@@ -144,6 +147,10 @@ namespace Apache.Qpid.Integration.Tests.testcases if (declareBind)
{
+ if (durable)
+ {
+ testQueue[n] = queueName;
+ }
testChannel[n].DeclareQueue(queueName, durable, true, true);
testChannel[n].Bind(queueName, exchangeName, routingKey);
}
@@ -167,6 +174,10 @@ namespace Apache.Qpid.Integration.Tests.testcases if (testConsumer[n] != null)
{
+ if (testQueue[n] != null)
+ {
+ testChannel[n].DeleteQueue(testQueue[n], false, false, true);
+ }
testConsumer[n].Close();
testConsumer[n].Dispose();
testConsumer[n] = null;
diff --git a/dotnet/Qpid.Integration.Tests/testcases/ChannelQueueTest.cs b/dotnet/Qpid.Integration.Tests/testcases/ChannelQueueTest.cs index 117dc200d3..e34864aefd 100644 --- a/dotnet/Qpid.Integration.Tests/testcases/ChannelQueueTest.cs +++ b/dotnet/Qpid.Integration.Tests/testcases/ChannelQueueTest.cs @@ -127,7 +127,7 @@ namespace Apache.Qpid.Integration.Tests.testcases .WithRoutingKey(_routingKey)
.Create();
_logger.Info("Publisher created...");
- SendTestMessage("Message 1");
+ SendTestMessage("DeleteNonEmptyQueue Message 1");
try
{
@@ -165,8 +165,8 @@ namespace Apache.Qpid.Integration.Tests.testcases .Create();
_logger.Info("Publisher created...");
- SendTestMessage("Message 1");
- SendTestMessage("Message 2");
+ SendTestMessage("DeleteQueueWithResponse Message 1");
+ SendTestMessage("DeleteQueueWithResponse Message 2");
// delete the queue, the server must respond
_channel.DeleteQueue(_queueName, false, false, false);
diff --git a/dotnet/Qpid.Integration.Tests/testcases/CommitRollbackTest.cs b/dotnet/Qpid.Integration.Tests/testcases/CommitRollbackTest.cs index aab279285e..1951a8a171 100644 --- a/dotnet/Qpid.Integration.Tests/testcases/CommitRollbackTest.cs +++ b/dotnet/Qpid.Integration.Tests/testcases/CommitRollbackTest.cs @@ -94,11 +94,11 @@ namespace Apache.Qpid.Integration.Tests.testcases public void TestCommittedSendReceived()
{
// Send messages.
- testProducer[0].Send(testChannel[0].CreateTextMessage("A"));
+ testProducer[0].Send(testChannel[0].CreateTextMessage("B"));
testChannel[0].Commit();
// Try to receive messages.
- ConsumeNMessagesOnly(1, "A", testConsumer[1]);
+ ConsumeNMessagesOnly(1, "B", testConsumer[1]);
testChannel[1].Commit();
}
@@ -107,11 +107,11 @@ namespace Apache.Qpid.Integration.Tests.testcases public void TestRolledBackSendNotReceived()
{
// Send messages.
- testProducer[0].Send(testChannel[0].CreateTextMessage("A"));
+ testProducer[0].Send(testChannel[0].CreateTextMessage("B"));
testChannel[0].Rollback();
// Try to receive messages.
- ConsumeNMessagesOnly(0, "A", testConsumer[1]);
+ ConsumeNMessagesOnly(0, "B", testConsumer[1]);
testChannel[1].Commit();
}
@@ -124,17 +124,17 @@ namespace Apache.Qpid.Integration.Tests.testcases true, false, null);
// Send messages.
- testProducer[0].Send(testChannel[0].CreateTextMessage("A"));
+ testProducer[0].Send(testChannel[0].CreateTextMessage("C"));
testChannel[0].Commit();
// Try to receive messages.
- ConsumeNMessagesOnly(1, "A", testConsumer[1]);
+ ConsumeNMessagesOnly(1, "C", testConsumer[1]);
// Close end-point 1 without committing the message, then re-open to consume again.
CloseEndPoint(1);
// Check that the message was released from the rolled back end-point an can be received on the alternative one instead.
- ConsumeNMessagesOnly(1, "A", testConsumer[2]);
+ ConsumeNMessagesOnly(1, "C", testConsumer[2]);
CloseEndPoint(2);
}
@@ -144,38 +144,33 @@ namespace Apache.Qpid.Integration.Tests.testcases public void TestCommittedReceiveNotRereceived()
{
// Send messages.
- testProducer[0].Send(testChannel[0].CreateTextMessage("A"));
+ testProducer[0].Send(testChannel[0].CreateTextMessage("D"));
testChannel[0].Commit();
// Try to receive messages.
- ConsumeNMessagesOnly(1, "A", testConsumer[1]);
+ ConsumeNMessagesOnly(1, "D", testConsumer[1]);
testChannel[1].Commit();
// Try to receive messages.
- ConsumeNMessagesOnly(0, "A", testConsumer[1]);
+ ConsumeNMessagesOnly(0, "D", testConsumer[1]);
}
/// <summary> Check that a rolled back receive can be re-received. </summary>
[Test]
public void TestRolledBackReceiveCanBeRereceived()
{
- // Create a third end-point as an alternative delivery route for the message.
- SetUpEndPoint(2, false, true, TEST_ROUTING_KEY + testId, AcknowledgeMode.AutoAcknowledge, true, ExchangeNameDefaults.DIRECT,
- true, false, null);
-
// Send messages.
- testProducer[0].Send(testChannel[0].CreateTextMessage("A"));
+ testProducer[0].Send(testChannel[0].CreateTextMessage("E"));
testChannel[0].Commit();
// Try to receive messages.
- ConsumeNMessagesOnly(1, "A", testConsumer[1]);
+ ConsumeNMessagesOnly(1, "E", testConsumer[1]);
testChannel[1].Rollback();
// Try to receive messages.
- ConsumeNMessagesOnly(1, "A", testConsumer[2]);
-
- CloseEndPoint(2);
+ ConsumeNMessagesOnly(1, "E", testConsumer[1]);
+
}
}
-}
\ No newline at end of file +}
diff --git a/dotnet/Qpid.Integration.Tests/testcases/DurableSubscriptionTest.cs b/dotnet/Qpid.Integration.Tests/testcases/DurableSubscriptionTest.cs index ceda19af3e..ac975100b1 100644 --- a/dotnet/Qpid.Integration.Tests/testcases/DurableSubscriptionTest.cs +++ b/dotnet/Qpid.Integration.Tests/testcases/DurableSubscriptionTest.cs @@ -99,7 +99,7 @@ namespace Apache.Qpid.Integration.Tests.testcases true, "TestSubscription" + testId);
ConsumeNMessagesOnly(1, "B", testConsumer[2]);
-
+
// Clean up any open consumers at the end of the test.
CloseEndPoint(2);
CloseEndPoint(1);
@@ -113,23 +113,23 @@ namespace Apache.Qpid.Integration.Tests.testcases SetUpEndPoint(0, true, false, TEST_ROUTING_KEY + testId, AcknowledgeMode.AutoAcknowledge, true, ExchangeNameDefaults.TOPIC,
true, false, null);
SetUpEndPoint(1, false, true, TEST_ROUTING_KEY + testId, AcknowledgeMode.AutoAcknowledge, true, ExchangeNameDefaults.TOPIC,
- true, false, null);
+ true, true, "foo"+testId);
// Send messages.
- testProducer[0].Send(testChannel[0].CreateTextMessage("A"));
+ testProducer[0].Send(testChannel[0].CreateTextMessage("C"));
testChannel[0].Commit();
// Try to receive messages, but don't commit them.
- ConsumeNMessagesOnly(1, "A", testConsumer[1]);
+ ConsumeNMessagesOnly(1, "C", testConsumer[1]);
// Close end-point 1 without committing the message, then re-open the subscription to consume again.
CloseEndPoint(1);
- SetUpEndPoint(1, false, true, TEST_ROUTING_KEY + testId, AcknowledgeMode.AutoAcknowledge, true, ExchangeNameDefaults.DIRECT,
- true, false, null);
+ SetUpEndPoint(1, false, true, TEST_ROUTING_KEY + testId, AcknowledgeMode.AutoAcknowledge, true, ExchangeNameDefaults.TOPIC,
+ true, true, "foo"+testId);
// Check that the message was released from the rolled back end-point an can be received on the alternative one instead.
- ConsumeNMessagesOnly(1, "A", testConsumer[1]);
-
+ ConsumeNMessagesOnly(1, "C", testConsumer[1]);
+ testChannel[1].Commit();
CloseEndPoint(1);
CloseEndPoint(0);
}
@@ -141,24 +141,24 @@ namespace Apache.Qpid.Integration.Tests.testcases SetUpEndPoint(0, true, false, TEST_ROUTING_KEY + testId, AcknowledgeMode.AutoAcknowledge, true, ExchangeNameDefaults.TOPIC,
true, false, null);
SetUpEndPoint(1, false, true, TEST_ROUTING_KEY + testId, AcknowledgeMode.AutoAcknowledge, true, ExchangeNameDefaults.TOPIC,
- true, false, null);
+ true, true, "foo"+testId);
// Send messages.
- testProducer[0].Send(testChannel[0].CreateTextMessage("A"));
+ testProducer[0].Send(testChannel[0].CreateTextMessage("D"));
testChannel[0].Commit();
// Try to receive messages, but roll them back.
- ConsumeNMessagesOnly(1, "A", testConsumer[1]);
+ ConsumeNMessagesOnly(1, "D", testConsumer[1]);
testChannel[1].Rollback();
// Close end-point 1 without committing the message, then re-open the subscription to consume again.
CloseEndPoint(1);
- SetUpEndPoint(1, false, true, TEST_ROUTING_KEY + testId, AcknowledgeMode.AutoAcknowledge, true, ExchangeNameDefaults.DIRECT,
- true, false, null);
+ SetUpEndPoint(1, false, true, TEST_ROUTING_KEY + testId, AcknowledgeMode.AutoAcknowledge, true, ExchangeNameDefaults.TOPIC,
+ true, true, "foo"+testId);
// Check that the message was released from the rolled back end-point an can be received on the alternative one instead.
- ConsumeNMessagesOnly(1, "A", testConsumer[1]);
-
+ ConsumeNMessagesOnly(1, "D", testConsumer[1]);
+ testChannel[1].Commit();
CloseEndPoint(1);
CloseEndPoint(0);
}
diff --git a/dotnet/Qpid.Integration.Tests/testcases/HeadersExchangeTest.cs b/dotnet/Qpid.Integration.Tests/testcases/HeadersExchangeTest.cs index 1ab8d79250..5e17cf1d2d 100644 --- a/dotnet/Qpid.Integration.Tests/testcases/HeadersExchangeTest.cs +++ b/dotnet/Qpid.Integration.Tests/testcases/HeadersExchangeTest.cs @@ -50,7 +50,7 @@ namespace Apache.Qpid.Integration.Tests.testcases private static ILog _logger = LogManager.GetLogger(typeof(HeadersExchangeTest));
/// <summary> Holds the default test timeout for broker communications before tests give up. </summary>
- private static readonly int TIMEOUT = 1000;
+ private static readonly int TIMEOUT = 2000;
/// <summary> Holds the name of the headers exchange to create to send test messages on. </summary>
private string _exchangeName = "ServiceQ1";
diff --git a/dotnet/Qpid.Integration.Tests/testcases/ProducerMultiConsumerTest.cs b/dotnet/Qpid.Integration.Tests/testcases/ProducerMultiConsumerTest.cs index 7a4bf29cf6..876e7c7bf7 100644 --- a/dotnet/Qpid.Integration.Tests/testcases/ProducerMultiConsumerTest.cs +++ b/dotnet/Qpid.Integration.Tests/testcases/ProducerMultiConsumerTest.cs @@ -117,7 +117,7 @@ namespace Apache.Qpid.Integration.Tests.testcases testProducer[0].Send(testChannel[0].CreateTextMessage("A"));
}
- _finishedEvent.WaitOne(new TimeSpan(0, 0, 0, 10), false);
+ _finishedEvent.WaitOne(new TimeSpan(0, 0, 0, 30), false);
// Check that all messages really were received.
Assert.IsTrue(allReceived, "All messages were not received, only got " + _messageReceivedCount + " but wanted " + expectedMessageCount);
@@ -139,14 +139,14 @@ namespace Apache.Qpid.Integration.Tests.testcases SetUpEndPoint(0, true, false, TEST_ROUTING_KEY + testId, AcknowledgeMode.AutoAcknowledge, false, ExchangeNameDefaults.DIRECT,
true, false, null);
- expectedMessageCount = MESSAGE_COUNT;
+ expectedMessageCount = (MESSAGE_COUNT * CONSUMER_COUNT);
for (int i = 0; i < MESSAGE_COUNT; i++)
{
testProducer[0].Send(testChannel[0].CreateTextMessage("A"));
}
- _finishedEvent.WaitOne(new TimeSpan(0, 0, 0, 10), false);
+ _finishedEvent.WaitOne(new TimeSpan(0, 0, 0, 30), false);
// Check that all messages really were received.
Assert.IsTrue(allReceived, "All messages were not received, only got: " + _messageReceivedCount + " but wanted " + expectedMessageCount);
diff --git a/dotnet/Qpid.Integration.Tests/testcases/SslConnectionTest.cs b/dotnet/Qpid.Integration.Tests/testcases/SslConnectionTest.cs index 950acbed9c..1c104d1451 100644 --- a/dotnet/Qpid.Integration.Tests/testcases/SslConnectionTest.cs +++ b/dotnet/Qpid.Integration.Tests/testcases/SslConnectionTest.cs @@ -39,7 +39,7 @@ namespace Apache.Qpid.Integration.Tests.testcases /// Make a test TLS connection to the broker
/// without using client-certificates
/// </summary>
- [Test]
+ //[Test]
public void DoSslConnection()
{
// because for tests we don't usually trust the server certificate
|
