activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r896707 - in /activemq/activemq-dotnet/Apache.NMS.Stomp/trunk: ./ src/test/csharp/
Date Wed, 06 Jan 2010 22:55:53 GMT
Author: tabish
Date: Wed Jan  6 22:55:53 2010
New Revision: 896707

URL: http://svn.apache.org/viewvc?rev=896707&view=rev
Log:
Add the following test cases

ExclusiveConsumer
IndividualAck
MessageListenerRedelivery
StompRedeliveryPolicyTest

Added:
    activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/test/csharp/ExclusiveConsumerTest.cs   (with props)
    activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/test/csharp/IndividualAckTest.cs   (with props)
    activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/test/csharp/MessageListenerRedeliveryTest.cs   (with props)
    activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/test/csharp/StompRedeliveryPolicyTest.cs   (with props)
Modified:
    activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/vs2008-stomp-test.csproj

Added: activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/test/csharp/ExclusiveConsumerTest.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/test/csharp/ExclusiveConsumerTest.cs?rev=896707&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/test/csharp/ExclusiveConsumerTest.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/test/csharp/ExclusiveConsumerTest.cs Wed Jan  6 22:55:53 2010
@@ -0,0 +1,362 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Threading;
+using Apache.NMS.Test;
+using Apache.NMS.Stomp;
+using Apache.NMS.Stomp.Commands;
+using NUnit.Framework;
+using NUnit.Framework.Extensions;
+
+namespace Apache.NMS.Stomp.Test
+{
+    [TestFixture]
+    public class ExclusiveConsumerTest : NMSTestSupport
+    {
+        protected static string DESTINATION_NAME = "TestDestination";
+        protected static string TEST_CLIENT_ID = "ExclusiveConsumerTestClientId";
+
+        private IConnection createConnection(bool start)
+        {
+            IConnection conn = CreateConnection(TEST_CLIENT_ID);
+            if(start)
+            {
+                conn.Start();
+            }
+
+            return conn;
+        }
+
+        [Test]
+        public void TestExclusiveConsumerSelectedCreatedFirst()
+        {
+            IConnection conn = createConnection(true);
+
+            ISession exclusiveSession = null;
+            ISession fallbackSession = null;
+            ISession senderSession = null;
+
+            try
+            {
+                exclusiveSession = conn.CreateSession(AcknowledgementMode.AutoAcknowledge);
+                fallbackSession = conn.CreateSession(AcknowledgementMode.AutoAcknowledge);
+                senderSession = conn.CreateSession(AcknowledgementMode.AutoAcknowledge);
+
+                IQueue exclusiveQueue = exclusiveSession.GetQueue("TEST.QUEUE1?consumer.exclusive=true");
+                IMessageConsumer exclusiveConsumer = exclusiveSession.CreateConsumer(exclusiveQueue);
+
+                IQueue fallbackQueue = fallbackSession.GetQueue("TEST.QUEUE1");
+                IMessageConsumer fallbackConsumer = fallbackSession.CreateConsumer(fallbackQueue);
+
+                IQueue senderQueue = senderSession.GetQueue("TEST.QUEUE1");
+
+                IMessageProducer producer = senderSession.CreateProducer(senderQueue);
+
+                IMessage msg = senderSession.CreateTextMessage("test");
+                producer.DeliveryMode = MsgDeliveryMode.NonPersistent;
+                producer.Send(msg);
+                Thread.Sleep(500);
+
+                // Verify exclusive consumer receives the message.
+                Assert.IsNotNull(exclusiveConsumer.Receive(TimeSpan.FromMilliseconds(1000)));
+                Assert.IsNull(fallbackConsumer.Receive(TimeSpan.FromMilliseconds(1000)));
+            }
+            finally
+            {
+                fallbackSession.Close();
+                senderSession.Close();
+                conn.Close();
+            }
+        }
+
+        [Test]
+        public void TestExclusiveConsumerSelectedCreatedAfter()
+        {
+            IConnection conn = createConnection(true);
+
+            ISession exclusiveSession = null;
+            ISession fallbackSession = null;
+            ISession senderSession = null;
+
+            try
+            {
+                exclusiveSession = conn.CreateSession(AcknowledgementMode.AutoAcknowledge);
+                fallbackSession = conn.CreateSession(AcknowledgementMode.AutoAcknowledge);
+                senderSession = conn.CreateSession(AcknowledgementMode.AutoAcknowledge);
+
+                IQueue fallbackQueue = fallbackSession.GetQueue("TEST.QUEUE5");
+                IMessageConsumer fallbackConsumer = fallbackSession.CreateConsumer(fallbackQueue);
+
+                IQueue exclusiveQueue = exclusiveSession.GetQueue("TEST.QUEUE5?consumer.exclusive=true");
+                IMessageConsumer exclusiveConsumer = exclusiveSession.CreateConsumer(exclusiveQueue);
+
+                IQueue senderQueue = senderSession.GetQueue("TEST.QUEUE5");
+
+                IMessageProducer producer = senderSession.CreateProducer(senderQueue);
+
+                IMessage msg = senderSession.CreateTextMessage("test");
+                producer.DeliveryMode = MsgDeliveryMode.NonPersistent;
+                producer.Send(msg);
+                Thread.Sleep(500);
+
+                // Verify exclusive consumer receives the message.
+                Assert.IsNotNull(exclusiveConsumer.Receive(TimeSpan.FromMilliseconds(1000)));
+                Assert.IsNull(fallbackConsumer.Receive(TimeSpan.FromMilliseconds(1000)));
+            }
+            finally
+            {
+                fallbackSession.Close();
+                senderSession.Close();
+                conn.Close();
+            }
+        }
+
+        [Test]
+        public void TestFailoverToAnotherExclusiveConsumerCreatedFirst()
+        {
+            IConnection conn = createConnection(true);
+
+            ISession exclusiveSession1 = null;
+            ISession exclusiveSession2 = null;
+            ISession fallbackSession = null;
+            ISession senderSession = null;
+
+            try
+            {
+                exclusiveSession1 = conn.CreateSession(AcknowledgementMode.AutoAcknowledge);
+                exclusiveSession2 = conn.CreateSession(AcknowledgementMode.AutoAcknowledge);
+                fallbackSession = conn.CreateSession(AcknowledgementMode.AutoAcknowledge);
+                senderSession = conn.CreateSession(AcknowledgementMode.AutoAcknowledge);
+
+                // This creates the exclusive consumer first which avoids AMQ-1024
+                // bug.
+                IQueue exclusiveQueue = exclusiveSession1.GetQueue("TEST.QUEUE2?consumer.exclusive=true");
+
+                IMessageConsumer exclusiveConsumer1 = exclusiveSession1.CreateConsumer(exclusiveQueue);
+                IMessageConsumer exclusiveConsumer2 = exclusiveSession2.CreateConsumer(exclusiveQueue);
+
+                IQueue fallbackQueue = fallbackSession.GetQueue("TEST.QUEUE2");
+                IMessageConsumer fallbackConsumer = fallbackSession.CreateConsumer(fallbackQueue);
+
+                IQueue senderQueue = senderSession.GetQueue("TEST.QUEUE2");
+
+                IMessageProducer producer = senderSession.CreateProducer(senderQueue);
+                producer.DeliveryMode = MsgDeliveryMode.NonPersistent;
+
+                IMessage msg = senderSession.CreateTextMessage("test");
+                producer.Send(msg);
+                Thread.Sleep(500);
+
+                // Verify exclusive consumer receives the message.
+                Assert.IsNotNull(exclusiveConsumer1.Receive(TimeSpan.FromMilliseconds(1000)));
+                Assert.IsNull(exclusiveConsumer2.Receive(TimeSpan.FromMilliseconds(1000)));
+                Assert.IsNull(fallbackConsumer.Receive(TimeSpan.FromMilliseconds(1000)));
+
+                // Close the exclusive consumer to verify the non-exclusive consumer
+                // takes over
+                exclusiveConsumer1.Close();
+
+                producer.Send(msg);
+                producer.Send(msg);
+
+                Assert.IsNotNull(exclusiveConsumer2.Receive(TimeSpan.FromMilliseconds(1000)));
+                Assert.IsNull(fallbackConsumer.Receive(TimeSpan.FromMilliseconds(1000)));
+            }
+            finally
+            {
+                fallbackSession.Close();
+                senderSession.Close();
+                conn.Close();
+            }
+        }
+
+        [Test]
+        public void TestFailoverToAnotherExclusiveConsumerCreatedAfter()
+        {
+            IConnection conn = createConnection(true);
+
+            ISession exclusiveSession1 = null;
+            ISession exclusiveSession2 = null;
+            ISession fallbackSession = null;
+            ISession senderSession = null;
+
+            try
+            {
+                exclusiveSession1 = conn.CreateSession(AcknowledgementMode.AutoAcknowledge);
+                exclusiveSession2 = conn.CreateSession(AcknowledgementMode.AutoAcknowledge);
+                fallbackSession = conn.CreateSession(AcknowledgementMode.AutoAcknowledge);
+                senderSession = conn.CreateSession(AcknowledgementMode.AutoAcknowledge);
+
+                // This creates the exclusive consumer first which avoids AMQ-1024
+                // bug.
+                IQueue exclusiveQueue = exclusiveSession1.GetQueue("TEST.QUEUE6?consumer.exclusive=true");
+                IMessageConsumer exclusiveConsumer1 = exclusiveSession1.CreateConsumer(exclusiveQueue);
+
+                IQueue fallbackQueue = fallbackSession.GetQueue("TEST.QUEUE6");
+                IMessageConsumer fallbackConsumer = fallbackSession.CreateConsumer(fallbackQueue);
+
+                IMessageConsumer exclusiveConsumer2 = exclusiveSession2.CreateConsumer(exclusiveQueue);
+
+                IQueue senderQueue = senderSession.GetQueue("TEST.QUEUE6");
+
+                IMessageProducer producer = senderSession.CreateProducer(senderQueue);
+                producer.DeliveryMode = MsgDeliveryMode.NonPersistent;
+
+                IMessage msg = senderSession.CreateTextMessage("test");
+                producer.Send(msg);
+                Thread.Sleep(500);
+
+                // Verify exclusive consumer receives the message.
+                Assert.IsNotNull(exclusiveConsumer1.Receive(TimeSpan.FromMilliseconds(1000)));
+                Assert.IsNull(exclusiveConsumer2.Receive(TimeSpan.FromMilliseconds(1000)));
+                Assert.IsNull(fallbackConsumer.Receive(TimeSpan.FromMilliseconds(1000)));
+
+                // Close the exclusive consumer to verify the non-exclusive consumer
+                // takes over
+                exclusiveConsumer1.Close();
+
+                producer.Send(msg);
+                producer.Send(msg);
+
+                Assert.IsNotNull(exclusiveConsumer2.Receive(TimeSpan.FromMilliseconds(1000)));
+                Assert.IsNull(fallbackConsumer.Receive(TimeSpan.FromMilliseconds(1000)));
+            }
+            finally
+            {
+                fallbackSession.Close();
+                senderSession.Close();
+                conn.Close();
+            }
+        }
+
+        [Test]
+        public void TestFailoverToNonExclusiveConsumer()
+        {
+            IConnection conn = createConnection(true);
+
+            ISession exclusiveSession = null;
+            ISession fallbackSession = null;
+            ISession senderSession = null;
+
+            try
+            {
+                exclusiveSession = conn.CreateSession(AcknowledgementMode.AutoAcknowledge);
+                fallbackSession = conn.CreateSession(AcknowledgementMode.AutoAcknowledge);
+                senderSession = conn.CreateSession(AcknowledgementMode.AutoAcknowledge);
+
+                // This creates the exclusive consumer first which avoids AMQ-1024
+                // bug.
+                IQueue exclusiveQueue = exclusiveSession.GetQueue("TEST.QUEUE3?consumer.exclusive=true");
+                IMessageConsumer exclusiveConsumer = exclusiveSession.CreateConsumer(exclusiveQueue);
+
+                IQueue fallbackQueue = fallbackSession.GetQueue("TEST.QUEUE3");
+                IMessageConsumer fallbackConsumer = fallbackSession.CreateConsumer(fallbackQueue);
+
+                IQueue senderQueue = senderSession.GetQueue("TEST.QUEUE3");
+
+                IMessageProducer producer = senderSession.CreateProducer(senderQueue);
+                producer.DeliveryMode = MsgDeliveryMode.NonPersistent;
+
+                IMessage msg = senderSession.CreateTextMessage("test");
+                producer.Send(msg);
+                Thread.Sleep(500);
+
+                // Verify exclusive consumer receives the message.
+                Assert.IsNotNull(exclusiveConsumer.Receive(TimeSpan.FromMilliseconds(1000)));
+                Assert.IsNull(fallbackConsumer.Receive(TimeSpan.FromMilliseconds(1000)));
+
+                // Close the exclusive consumer to verify the non-exclusive consumer
+                // takes over
+                exclusiveConsumer.Close();
+
+                producer.Send(msg);
+
+                Assert.IsNotNull(fallbackConsumer.Receive(TimeSpan.FromMilliseconds(1000)));
+
+            }
+            finally
+            {
+                fallbackSession.Close();
+                senderSession.Close();
+                conn.Close();
+            }
+        }
+
+        [Test]
+        public void TestFallbackToExclusiveConsumer()
+        {
+            IConnection conn = createConnection(true);
+
+            ISession exclusiveSession = null;
+            ISession fallbackSession = null;
+            ISession senderSession = null;
+
+            try
+            {
+                exclusiveSession = conn.CreateSession(AcknowledgementMode.AutoAcknowledge);
+                fallbackSession = conn.CreateSession(AcknowledgementMode.AutoAcknowledge);
+                senderSession = conn.CreateSession(AcknowledgementMode.AutoAcknowledge);
+
+                // This creates the exclusive consumer first which avoids AMQ-1024
+                // bug.
+                IQueue exclusiveQueue = exclusiveSession.GetQueue("TEST.QUEUE4?consumer.exclusive=true");
+                IMessageConsumer exclusiveConsumer = exclusiveSession.CreateConsumer(exclusiveQueue);
+
+                IQueue fallbackQueue = fallbackSession.GetQueue("TEST.QUEUE4");
+                IMessageConsumer fallbackConsumer = fallbackSession.CreateConsumer(fallbackQueue);
+
+                IQueue senderQueue = senderSession.GetQueue("TEST.QUEUE4");
+
+                IMessageProducer producer = senderSession.CreateProducer(senderQueue);
+                producer.DeliveryMode = MsgDeliveryMode.NonPersistent;
+
+                IMessage msg = senderSession.CreateTextMessage("test");
+                producer.Send(msg);
+                Thread.Sleep(500);
+
+                // Verify exclusive consumer receives the message.
+                Assert.IsNotNull(exclusiveConsumer.Receive(TimeSpan.FromMilliseconds(1000)));
+                Assert.IsNull(fallbackConsumer.Receive(TimeSpan.FromMilliseconds(1000)));
+
+                // Close the exclusive consumer to verify the non-exclusive consumer
+                // takes over
+                exclusiveConsumer.Close();
+
+                producer.Send(msg);
+
+                // Verify other non-exclusive consumer receices the message.
+                Assert.IsNotNull(fallbackConsumer.Receive(TimeSpan.FromMilliseconds(1000)));
+
+                // Create exclusive consumer to determine if it will start receiving
+                // the messages.
+                exclusiveConsumer = exclusiveSession.CreateConsumer(exclusiveQueue);
+
+                producer.Send(msg);
+                Assert.IsNotNull(exclusiveConsumer.Receive(TimeSpan.FromMilliseconds(1000)));
+                Assert.IsNull(fallbackConsumer.Receive(TimeSpan.FromMilliseconds(1000)));
+            }
+            finally
+            {
+                fallbackSession.Close();
+                senderSession.Close();
+                conn.Close();
+            }
+        }
+
+    }
+}

Propchange: activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/test/csharp/ExclusiveConsumerTest.cs
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/test/csharp/ExclusiveConsumerTest.cs
------------------------------------------------------------------------------
    svn:executable = *

Added: activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/test/csharp/IndividualAckTest.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/test/csharp/IndividualAckTest.cs?rev=896707&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/test/csharp/IndividualAckTest.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/test/csharp/IndividualAckTest.cs Wed Jan  6 22:55:53 2010
@@ -0,0 +1,266 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Threading;
+using Apache.NMS;
+using Apache.NMS.Util;
+using Apache.NMS.Test;
+using Apache.NMS.Stomp.Commands;
+using NUnit.Framework;
+using NUnit.Framework.Extensions;
+
+namespace Apache.NMS.Stomp.Test
+{
+    [TestFixture]
+    public class IndividualAckTest : NMSTestSupport
+    {
+        private IConnection connection;
+
+        [SetUp]
+        public override void SetUp()
+        {
+            base.SetUp();
+
+            connection = CreateConnection();
+            connection.Start();
+        }
+
+        [TearDown]
+        public override void TearDown()
+        {
+            connection.Close();
+            base.TearDown();
+        }
+
+        [Test]
+        public void TestAckedMessageAreConsumed()
+        {
+            ISession session = connection.CreateSession(AcknowledgementMode.IndividualAcknowledge);
+            ITemporaryQueue queue = session.CreateTemporaryQueue();
+            IMessageProducer producer = session.CreateProducer(queue);
+            producer.Send(session.CreateTextMessage("Hello"));
+
+            // Consume the message...
+            IMessageConsumer consumer = session.CreateConsumer(queue);
+            IMessage msg = consumer.Receive(TimeSpan.FromMilliseconds(1000));
+            Assert.IsNotNull(msg);
+            msg.Acknowledge();
+
+            // Reset the session.
+            session.Close();
+            session = connection.CreateSession(AcknowledgementMode.IndividualAcknowledge);
+
+            // Attempt to Consume the message...
+            consumer = session.CreateConsumer(queue);
+            msg = consumer.Receive(TimeSpan.FromMilliseconds(1000));
+            Assert.IsNull(msg);
+
+            session.Close();
+        }
+
+        //[Test]
+        public void TestLastMessageAcked()
+        {
+            ISession session = connection.CreateSession(AcknowledgementMode.IndividualAcknowledge);
+            ITemporaryQueue queue = session.CreateTemporaryQueue();
+            IMessageProducer producer = session.CreateProducer(queue);
+            ITextMessage msg1 = session.CreateTextMessage("msg1");
+            ITextMessage msg2 = session.CreateTextMessage("msg2");
+            ITextMessage msg3 = session.CreateTextMessage("msg3");
+            producer.Send(msg1);
+            producer.Send(msg2);
+            producer.Send(msg3);
+
+            // Consume the message...
+            IMessageConsumer consumer = session.CreateConsumer(queue);
+            IMessage msg = consumer.Receive(TimeSpan.FromMilliseconds(1000));
+            Assert.IsNotNull(msg);
+            msg = consumer.Receive(TimeSpan.FromMilliseconds(1000));
+            Assert.IsNotNull(msg);
+            msg = consumer.Receive(TimeSpan.FromMilliseconds(1000));
+            Assert.IsNotNull(msg);
+            msg.Acknowledge();
+
+            // Reset the session.
+            session.Close();
+            session = connection.CreateSession(AcknowledgementMode.IndividualAcknowledge);
+
+            // Attempt to Consume the message...
+            consumer = session.CreateConsumer(queue);
+            msg = consumer.Receive(TimeSpan.FromMilliseconds(1000));
+            Assert.IsNotNull(msg);
+            Assert.AreEqual(msg1,msg);
+            msg = consumer.Receive(TimeSpan.FromMilliseconds(1000));
+            Assert.IsNotNull(msg);
+            Assert.AreEqual(msg2,msg);
+            msg = consumer.Receive(TimeSpan.FromMilliseconds(1000));
+            Assert.IsNull(msg);
+            session.Close();
+        }
+
+        [Test]
+        public void TestUnAckedMessageAreNotConsumedOnSessionClose()
+        {
+            ISession session = connection.CreateSession(AcknowledgementMode.IndividualAcknowledge);
+            ITemporaryQueue queue = session.CreateTemporaryQueue();
+            IMessageProducer producer = session.CreateProducer(queue);
+            producer.Send(session.CreateTextMessage("Hello"));
+
+            // Consume the message...
+            IMessageConsumer consumer = session.CreateConsumer(queue);
+            IMessage msg = consumer.Receive(TimeSpan.FromMilliseconds(1000));
+            Assert.IsNotNull(msg);
+            // Don't ack the message.
+
+            // Reset the session.  This should cause the unacknowledged message to be re-delivered.
+            session.Close();
+            session = connection.CreateSession(AcknowledgementMode.IndividualAcknowledge);
+
+            // Attempt to Consume the message...
+            consumer = session.CreateConsumer(queue);
+            msg = consumer.Receive(TimeSpan.FromMilliseconds(2000));
+            Assert.IsNotNull(msg);
+            msg.Acknowledge();
+
+            session.Close();
+        }
+
+        [Test]
+        public void TestIndividualAcknowledgeMultiMessages_AcknowledgeFirstTest()
+        {
+            ISession session = connection.CreateSession(AcknowledgementMode.IndividualAcknowledge);
+
+            // Push 2 messages to queue
+            ITemporaryQueue queue = session.CreateTemporaryQueue();
+            IMessageProducer producer = session.CreateProducer(queue);
+
+            ITextMessage msg = session.CreateTextMessage("test 1");
+            producer.Send(msg, MsgDeliveryMode.Persistent, MsgPriority.Normal, TimeSpan.MinValue);
+            msg = session.CreateTextMessage("test 2");
+            producer.Send(msg, MsgDeliveryMode.Persistent, MsgPriority.Normal, TimeSpan.MinValue);
+            producer.Close();
+
+            IMessageConsumer consumer = session.CreateConsumer(queue);
+
+            // Read the first message
+            ITextMessage fetchedMessage1 = (ITextMessage) consumer.Receive(TimeSpan.FromMilliseconds(2000));
+            Assert.IsNotNull(fetchedMessage1);
+            Assert.AreEqual("test 1", fetchedMessage1.Text);
+
+            // Read the second message
+            ITextMessage fetchedMessage2 = (ITextMessage) consumer.Receive(TimeSpan.FromMilliseconds(2000));
+            Assert.IsNotNull(fetchedMessage2);
+            Assert.AreEqual("test 2", fetchedMessage2.Text);
+
+            // Acknowledge first message
+            fetchedMessage1.Acknowledge();
+
+            consumer.Close();
+
+            // Read first message a second time
+            consumer = session.CreateConsumer(queue);
+            fetchedMessage1 = (ITextMessage) consumer.Receive(TimeSpan.FromMilliseconds(2000));
+            Assert.IsNotNull(fetchedMessage1);
+            Assert.AreEqual("test 2", fetchedMessage1.Text);
+
+            // Try to read second message a second time
+            fetchedMessage2 = (ITextMessage) consumer.Receive(TimeSpan.FromMilliseconds(2000));
+            Assert.IsNull(fetchedMessage2);
+            consumer.Close();
+        }
+
+        [Test]
+        public void TestManyMessageAckedAfterMessageConsumption()
+        {
+            int messageCount = 20;
+            IMessage msg;
+
+            ISession session = connection.CreateSession(AcknowledgementMode.IndividualAcknowledge);
+            ITemporaryQueue queue = session.CreateTemporaryQueue();
+            IMessageProducer producer = session.CreateProducer(queue);
+            for(int i = 0; i < messageCount; i++)
+            {
+                msg = session.CreateTextMessage("msg" + i);
+                producer.Send(msg);
+            }
+
+            // Consume the message...
+            IMessageConsumer consumer = session.CreateConsumer(queue);
+            for(int i = 0; i < messageCount; i++)
+            {
+                msg = consumer.Receive(TimeSpan.FromMilliseconds(1000));
+                Assert.IsNotNull(msg);
+                msg.Acknowledge();
+            }
+            msg = consumer.Receive(TimeSpan.FromMilliseconds(1000));
+            Assert.IsNull(msg);
+
+            // Reset the session.
+            session.Close();
+            session = connection.CreateSession(AcknowledgementMode.IndividualAcknowledge);
+
+            // Attempt to Consume the message...
+            consumer = session.CreateConsumer(queue);
+            msg = consumer.Receive(TimeSpan.FromMilliseconds(1000));
+            Assert.IsNull(msg);
+            session.Close();
+        }
+
+        [Test]
+        public void TestManyMessageAckedAfterAllConsumption()
+        {
+            int messageCount = 20;
+            IMessage msg;
+
+            ISession session = connection.CreateSession(AcknowledgementMode.IndividualAcknowledge);
+            ITemporaryQueue queue = session.CreateTemporaryQueue();
+            IMessageProducer producer = session.CreateProducer(queue);
+            for(int i = 0; i < messageCount; i++)
+            {
+                msg = session.CreateTextMessage("msg" + i);
+                producer.Send(msg);
+            }
+
+            // Consume the message...
+            IMessageConsumer consumer = session.CreateConsumer(queue);
+            IMessage[] consumedMessages = new IMessage[messageCount];
+            for(int i = 0; i < messageCount; i++)
+            {
+                msg = consumer.Receive(TimeSpan.FromMilliseconds(1000));
+                Assert.IsNotNull(msg);
+                consumedMessages[i] = msg;
+            }
+            for(int i = 0; i < messageCount; i++)
+            {
+                consumedMessages[i].Acknowledge();
+            }
+            msg = consumer.Receive(TimeSpan.FromMilliseconds(1000));
+            Assert.IsNull(msg);
+
+            // Reset the session.
+            session.Close();
+            session = connection.CreateSession(AcknowledgementMode.IndividualAcknowledge);
+
+            // Attempt to Consume the message...
+            consumer = session.CreateConsumer(queue);
+            msg = consumer.Receive(TimeSpan.FromMilliseconds(1000));
+            Assert.IsNull(msg);
+            session.Close();
+        }
+    }
+}

Propchange: activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/test/csharp/IndividualAckTest.cs
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/test/csharp/IndividualAckTest.cs
------------------------------------------------------------------------------
    svn:executable = *

Added: activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/test/csharp/MessageListenerRedeliveryTest.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/test/csharp/MessageListenerRedeliveryTest.cs?rev=896707&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/test/csharp/MessageListenerRedeliveryTest.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/test/csharp/MessageListenerRedeliveryTest.cs Wed Jan  6 22:55:53 2010
@@ -0,0 +1,135 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Threading;
+using Apache.NMS;
+using Apache.NMS.Policies;
+using Apache.NMS.Util;
+using Apache.NMS.Stomp;
+using Apache.NMS.Test;
+using NUnit.Framework;
+using NUnit.Framework.Extensions;
+
+namespace Apache.NMS.Stomp.Test
+{
+    [TestFixture]
+    public class MessageListenerRedeliveryTest : NMSTestSupport
+    {
+        private Connection connection;
+        private int counter;
+        private ISession session;
+
+        [SetUp]
+        public override void SetUp()
+        {
+            this.connection = (Connection) CreateConnection();
+            this.connection.RedeliveryPolicy = GetRedeliveryPolicy();
+
+            this.counter = 0;
+        }
+
+        [TearDown]
+        public override void TearDown()
+        {
+            this.session = null;
+
+            if(this.connection != null)
+            {
+                this.connection.Close();
+                this.connection = null;
+            }
+
+            base.TearDown();
+        }
+
+        protected IRedeliveryPolicy GetRedeliveryPolicy()
+        {
+            RedeliveryPolicy redeliveryPolicy = new RedeliveryPolicy();
+            redeliveryPolicy.InitialRedeliveryDelay = 1000;
+            redeliveryPolicy.MaximumRedeliveries = 3;
+            redeliveryPolicy.BackOffMultiplier = (short)2;
+            redeliveryPolicy.UseExponentialBackOff = true;
+            return redeliveryPolicy;
+        }
+
+        private void OnMessageListener(IMessage message)
+        {
+            counter++;
+            if(this.counter <= 4)
+            {
+                session.Rollback();
+            }
+            else
+            {
+                message.Acknowledge();
+                session.Commit();
+            }
+        }
+
+        [Test]
+        public void TestQueueRollbackConsumerListener()
+        {
+            connection.Start();
+
+            this.session = connection.CreateSession(AcknowledgementMode.Transactional);
+            ITemporaryQueue queue = session.CreateTemporaryQueue();
+            IMessageProducer producer = session.CreateProducer(queue);
+            IMessage message = session.CreateTextMessage("Test Message");
+            producer.Send(message);
+            session.Commit();
+
+            IMessageConsumer consumer = session.CreateConsumer(queue);
+
+            consumer.Listener += new MessageListener(OnMessageListener);
+
+            Thread.Sleep(500);
+
+            // first try.. should get 2 since there is no delay on the
+            // first redeliver..
+            Assert.AreEqual(2, counter);
+
+            Thread.Sleep(1000);
+
+            // 2nd redeliver (redelivery after 1 sec)
+            Assert.AreEqual(3, counter);
+
+            Thread.Sleep(2000);
+
+            // 3rd redeliver (redelivery after 2 seconds) - it should give up after
+            // that
+            Assert.AreEqual(4, counter);
+
+            // create new message
+            producer.Send(session.CreateTextMessage("Test Message Again"));
+            session.Commit();
+
+            Thread.Sleep(500);
+
+            // it should be committed, so no redelivery
+            Assert.AreEqual(5, counter);
+
+            Thread.Sleep(1500);
+
+            // no redelivery, counter should still be 5
+            Assert.AreEqual(5, counter);
+
+            session.Close();
+        }
+
+    }
+}

Propchange: activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/test/csharp/MessageListenerRedeliveryTest.cs
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/test/csharp/MessageListenerRedeliveryTest.cs
------------------------------------------------------------------------------
    svn:executable = *

Added: activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/test/csharp/StompRedeliveryPolicyTest.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/test/csharp/StompRedeliveryPolicyTest.cs?rev=896707&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/test/csharp/StompRedeliveryPolicyTest.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/test/csharp/StompRedeliveryPolicyTest.cs Wed Jan  6 22:55:53 2010
@@ -0,0 +1,351 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Threading;
+using System.Collections.Generic;
+using Apache.NMS.Test;
+using Apache.NMS.Policies;
+using Apache.NMS.Stomp;
+using Apache.NMS.Stomp.Commands;
+using NUnit.Framework;
+using NUnit.Framework.Extensions;
+
+namespace Apache.NMS.Stomp.Test
+{
+    [TestFixture]
+    public class StompRedeliveryPolicyTest : NMSTestSupport
+    {
+        private const string DESTINATION_NAME = "RedeliveryPolicyTestDest";
+
+        [Test]
+        public void TestExponentialRedeliveryPolicyDelaysDeliveryOnRollback()
+        {
+            using(Connection connection = (Connection) CreateConnection())
+            {
+                IRedeliveryPolicy policy = connection.RedeliveryPolicy;
+                policy.InitialRedeliveryDelay = 500;
+                policy.BackOffMultiplier = 2;
+                policy.UseExponentialBackOff = true;
+                policy.UseCollisionAvoidance = false;
+
+                connection.Start();
+                ISession session = connection.CreateSession(AcknowledgementMode.Transactional);
+                IDestination destination = session.CreateTemporaryQueue();
+                IMessageProducer producer = session.CreateProducer(destination);
+
+                IMessageConsumer consumer = session.CreateConsumer(destination);
+
+                // Send the messages
+                producer.Send(session.CreateTextMessage("1st"));
+                producer.Send(session.CreateTextMessage("2nd"));
+                session.Commit();
+
+                ITextMessage m;
+                m = (ITextMessage)consumer.Receive(TimeSpan.FromMilliseconds(1000));
+                Assert.IsNotNull(m);
+                Assert.AreEqual("1st", m.Text);
+                session.Rollback();
+
+                // No delay on first Rollback..
+                m = (ITextMessage)consumer.Receive(TimeSpan.FromMilliseconds(100));
+                Assert.IsNotNull(m);
+                session.Rollback();
+
+                // Show subsequent re-delivery delay is incrementing.
+                m = (ITextMessage)consumer.Receive(TimeSpan.FromMilliseconds(100));
+                Assert.IsNull(m);
+
+                m = (ITextMessage)consumer.Receive(TimeSpan.FromMilliseconds(700));
+                Assert.IsNotNull(m);
+                Assert.AreEqual("1st", m.Text);
+                session.Rollback();
+
+                // Show re-delivery delay is incrementing exponentially
+                m = (ITextMessage)consumer.Receive(TimeSpan.FromMilliseconds(100));
+                Assert.IsNull(m);
+                m = (ITextMessage)consumer.Receive(TimeSpan.FromMilliseconds(500));
+                Assert.IsNull(m);
+                m = (ITextMessage)consumer.Receive(TimeSpan.FromMilliseconds(700));
+                Assert.IsNotNull(m);
+                Assert.AreEqual("1st", m.Text);
+            }
+        }
+
+        [Test]
+        public void TestNornalRedeliveryPolicyDelaysDeliveryOnRollback()
+        {
+            using(Connection connection = (Connection) CreateConnection())
+            {
+                IRedeliveryPolicy policy = connection.RedeliveryPolicy;
+                policy.InitialRedeliveryDelay = 500;
+                policy.UseExponentialBackOff = false;
+
+                connection.Start();
+                ISession session = connection.CreateSession(AcknowledgementMode.Transactional);
+                IDestination destination = session.CreateTemporaryQueue();
+
+                IMessageProducer producer = session.CreateProducer(destination);
+                IMessageConsumer consumer = session.CreateConsumer(destination);
+
+                // Send the messages
+                producer.Send(session.CreateTextMessage("1st"));
+                producer.Send(session.CreateTextMessage("2nd"));
+                session.Commit();
+
+                ITextMessage m;
+                m = (ITextMessage)consumer.Receive(TimeSpan.FromMilliseconds(1000));
+                Assert.IsNotNull(m);
+                Assert.AreEqual("1st", m.Text);
+                session.Rollback();
+
+                // No delay on first Rollback..
+                m = (ITextMessage)consumer.Receive(TimeSpan.FromMilliseconds(100));
+                Assert.IsNotNull(m);
+                session.Rollback();
+
+                // Show subsequent re-delivery delay is incrementing.
+                m = (ITextMessage)consumer.Receive(TimeSpan.FromMilliseconds(100));
+                Assert.IsNull(m);
+                m = (ITextMessage)consumer.Receive(TimeSpan.FromMilliseconds(700));
+                Assert.IsNotNull(m);
+                Assert.AreEqual("1st", m.Text);
+                session.Rollback();
+
+                // The message gets redelivered after 500 ms every time since
+                // we are not using exponential backoff.
+                m = (ITextMessage)consumer.Receive(TimeSpan.FromMilliseconds(100));
+                Assert.IsNull(m);
+                m = (ITextMessage)consumer.Receive(TimeSpan.FromMilliseconds(700));
+                Assert.IsNotNull(m);
+                Assert.AreEqual("1st", m.Text);
+            }
+        }
+
+        //[Test]
+        public void TestDLQHandling()
+        {
+            using(Connection connection = (Connection) CreateConnection())
+            {
+                IRedeliveryPolicy policy = connection.RedeliveryPolicy;
+                policy.InitialRedeliveryDelay = 100;
+                policy.UseExponentialBackOff = false;
+                policy.MaximumRedeliveries = 2;
+
+                connection.Start();
+                ISession session = connection.CreateSession(AcknowledgementMode.Transactional);
+                IDestination destination = session.CreateTemporaryQueue();
+                IMessageProducer producer = session.CreateProducer(destination);
+
+                IMessageConsumer consumer = session.CreateConsumer(destination);
+                IDestination dlq = session.GetQueue("ActiveMQ.DLQ");
+                IMessageConsumer dlqConsumer = session.CreateConsumer(dlq);
+
+                // Purge any messages already in the DLQ.
+                while(dlqConsumer.ReceiveNoWait() != null)
+                {
+                    session.Commit();
+                }
+
+                // Send the messages
+                producer.Send(session.CreateTextMessage("1st"));
+                producer.Send(session.CreateTextMessage("2nd"));
+                session.Commit();
+
+                ITextMessage m;
+                m = (ITextMessage)consumer.Receive(TimeSpan.FromMilliseconds(1000));
+                Assert.IsNotNull(m);
+                Assert.AreEqual("1st", m.Text);
+                session.Rollback();
+
+                m = (ITextMessage)consumer.Receive(TimeSpan.FromMilliseconds(1000));
+                Assert.IsNotNull(m);
+                Assert.AreEqual("1st", m.Text);
+                session.Rollback();
+
+                m = (ITextMessage)consumer.Receive(TimeSpan.FromMilliseconds(1000));
+                Assert.IsNotNull(m);
+                Assert.AreEqual("1st", m.Text);
+                session.Rollback();
+
+                // The last Rollback should cause the 1st message to get sent to the DLQ
+                m = (ITextMessage)consumer.Receive(TimeSpan.FromMilliseconds(1000));
+                Assert.IsNotNull(m);
+                Assert.AreEqual("2nd", m.Text);
+                session.Commit();
+
+                // We should be able to get the message off the DLQ now.
+                m = (ITextMessage)dlqConsumer.Receive(TimeSpan.FromMilliseconds(1000));
+                Assert.IsNotNull(m);
+                Assert.AreEqual("1st", m.Text);
+                session.Commit();
+            }
+        }
+
+        [Test]
+        public void TestInfiniteMaximumNumberOfRedeliveries()
+        {
+            using(Connection connection = (Connection) CreateConnection())
+            {
+                IRedeliveryPolicy policy = connection.RedeliveryPolicy;
+                policy.InitialRedeliveryDelay = 100;
+                policy.UseExponentialBackOff = false;
+                // let's set the maximum redeliveries to no maximum (ie. infinite)
+                policy.MaximumRedeliveries = -1;
+
+                connection.Start();
+                ISession session = connection.CreateSession(AcknowledgementMode.Transactional);
+                IDestination destination = session.CreateTemporaryQueue();
+                IMessageProducer producer = session.CreateProducer(destination);
+
+                IMessageConsumer consumer = session.CreateConsumer(destination);
+
+                // Send the messages
+                producer.Send(session.CreateTextMessage("1st"));
+                producer.Send(session.CreateTextMessage("2nd"));
+                session.Commit();
+
+                ITextMessage m;
+
+                m = (ITextMessage)consumer.Receive(TimeSpan.FromMilliseconds(1000));
+                Assert.IsNotNull(m);
+                Assert.AreEqual("1st", m.Text);
+                session.Rollback();
+
+                //we should be able to get the 1st message redelivered until a session.Commit is called
+                m = (ITextMessage)consumer.Receive(TimeSpan.FromMilliseconds(1000));
+                Assert.IsNotNull(m);
+                Assert.AreEqual("1st", m.Text);
+                session.Rollback();
+
+                m = (ITextMessage)consumer.Receive(TimeSpan.FromMilliseconds(1000));
+                Assert.IsNotNull(m);
+                Assert.AreEqual("1st", m.Text);
+                session.Rollback();
+
+                m = (ITextMessage)consumer.Receive(TimeSpan.FromMilliseconds(1000));
+                Assert.IsNotNull(m);
+                Assert.AreEqual("1st", m.Text);
+                session.Rollback();
+
+                m = (ITextMessage)consumer.Receive(TimeSpan.FromMilliseconds(1000));
+                Assert.IsNotNull(m);
+                Assert.AreEqual("1st", m.Text);
+                session.Rollback();
+
+                m = (ITextMessage)consumer.Receive(TimeSpan.FromMilliseconds(1000));
+                Assert.IsNotNull(m);
+                Assert.AreEqual("1st", m.Text);
+                session.Commit();
+
+                m = (ITextMessage)consumer.Receive(TimeSpan.FromMilliseconds(1000));
+                Assert.IsNotNull(m);
+                Assert.AreEqual("2nd", m.Text);
+                session.Commit();
+            }
+        }
+
+        [Test]
+        public void TestZeroMaximumNumberOfRedeliveries()
+        {
+            using(Connection connection = (Connection) CreateConnection())
+            {
+                IRedeliveryPolicy policy = connection.RedeliveryPolicy;
+                policy.InitialRedeliveryDelay = 100;
+                policy.UseExponentialBackOff = false;
+                //let's set the maximum redeliveries to 0
+                policy.MaximumRedeliveries = 0;
+
+                connection.Start();
+                ISession session = connection.CreateSession(AcknowledgementMode.Transactional);
+                IDestination destination = session.CreateTemporaryQueue();
+                IMessageProducer producer = session.CreateProducer(destination);
+
+                IMessageConsumer consumer = session.CreateConsumer(destination);
+
+                // Send the messages
+                producer.Send(session.CreateTextMessage("1st"));
+                producer.Send(session.CreateTextMessage("2nd"));
+                session.Commit();
+
+                ITextMessage m;
+                m = (ITextMessage)consumer.Receive(TimeSpan.FromMilliseconds(1000));
+                Assert.IsNotNull(m);
+                Assert.AreEqual("1st", m.Text);
+                session.Rollback();
+
+                //the 1st  message should not be redelivered since maximumRedeliveries is set to 0
+                m = (ITextMessage)consumer.Receive(TimeSpan.FromMilliseconds(1000));
+                Assert.IsNotNull(m);
+                Assert.AreEqual("2nd", m.Text);
+                session.Commit();
+            }
+        }
+
+        [Test]
+        public void TestURIForRedeliverPolicyHandling()
+        {
+            string uri1 = "stomp:tcp://${activemqhost}:61613" +
+                          "?nms.RedeliveryPolicy.BackOffMultiplier=10" +
+                          "&nms.RedeliveryPolicy.InitialRedeliveryDelay=2000" +
+                          "&nms.RedeliveryPolicy.UseExponentialBackOff=true" +
+                          "&nms.RedeliveryPolicy.UseCollisionAvoidance=true" +
+                          "&nms.RedeliveryPolicy.CollisionAvoidancePercent=20";
+
+            string uri2 = "stomp:tcp://${activemqhost}:61613" +
+                          "?nms.RedeliveryPolicy.backOffMultiplier=50" +
+                          "&nms.RedeliveryPolicy.initialRedeliveryDelay=4000" +
+                          "&nms.RedeliveryPolicy.useExponentialBackOff=false" +
+                          "&nms.RedeliveryPolicy.useCollisionAvoidance=false" +
+                          "&nms.RedeliveryPolicy.collisionAvoidancePercent=10";
+
+            NMSConnectionFactory factory = new NMSConnectionFactory(NMSTestSupport.ReplaceEnvVar(uri1));
+
+            Assert.IsNotNull(factory);
+            Assert.IsNotNull(factory.ConnectionFactory);
+            using(IConnection connection = factory.CreateConnection("", ""))
+            {
+                Assert.IsNotNull(connection);
+
+                Connection amqConnection = connection as Connection;
+
+                Assert.AreEqual(10, amqConnection.RedeliveryPolicy.BackOffMultiplier);
+                Assert.AreEqual(2000, amqConnection.RedeliveryPolicy.InitialRedeliveryDelay);
+                Assert.AreEqual(true, amqConnection.RedeliveryPolicy.UseExponentialBackOff);
+                Assert.AreEqual(true, amqConnection.RedeliveryPolicy.UseCollisionAvoidance);
+                Assert.AreEqual(20, amqConnection.RedeliveryPolicy.CollisionAvoidancePercent);
+            }
+
+            factory = new NMSConnectionFactory(NMSTestSupport.ReplaceEnvVar(uri2));
+
+            Assert.IsNotNull(factory);
+            Assert.IsNotNull(factory.ConnectionFactory);
+            using(IConnection connection = factory.CreateConnection("", ""))
+            {
+                Assert.IsNotNull(connection);
+
+                Connection amqConnection = connection as Connection;
+                Assert.AreEqual(50, amqConnection.RedeliveryPolicy.BackOffMultiplier);
+                Assert.AreEqual(4000, amqConnection.RedeliveryPolicy.InitialRedeliveryDelay);
+                Assert.AreEqual(false, amqConnection.RedeliveryPolicy.UseExponentialBackOff);
+                Assert.AreEqual(false, amqConnection.RedeliveryPolicy.UseCollisionAvoidance);
+                Assert.AreEqual(10, amqConnection.RedeliveryPolicy.CollisionAvoidancePercent);
+            }
+        }
+
+    }
+}

Propchange: activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/test/csharp/StompRedeliveryPolicyTest.cs
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/test/csharp/StompRedeliveryPolicyTest.cs
------------------------------------------------------------------------------
    svn:executable = *

Modified: activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/vs2008-stomp-test.csproj
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/vs2008-stomp-test.csproj?rev=896707&r1=896706&r2=896707&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/vs2008-stomp-test.csproj (original)
+++ activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/vs2008-stomp-test.csproj Wed Jan  6 22:55:53 2010
@@ -86,5 +86,10 @@
     <Compile Include="src\test\csharp\NMSPropertyTest.cs" />
     <Compile Include="src\test\csharp\TempDestinationTest.cs" />
     <Compile Include="src\test\csharp\TransactionTest.cs" />
+    <Compile Include="src\test\csharp\StompRedeliveryPolicyTest.cs" />
+    <Compile Include="src\test\csharp\IndividualAckTest.cs" />
+    <Compile Include="src\test\csharp\ExclusiveConsumerTest.cs" />
+    <Compile Include="src\test\csharp\Util\MessageDispatchChannelTest.cs" />
+    <Compile Include="src\test\csharp\MessageListenerRedeliveryTest.cs" />
   </ItemGroup>
 </Project>
\ No newline at end of file



Mime
View raw message