You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2013/11/14 17:01:13 UTC

svn commit: r1541946 - in /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x: ./ src/main/csharp/ src/test/csharp/

Author: tabish
Date: Thu Nov 14 16:01:13 2013
New Revision: 1541946

URL: http://svn.apache.org/r1541946
Log:
https://issues.apache.org/jira/browse/AMQNET-463

Fix using item property instead of Add

Modified:
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/   (props changed)
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/main/csharp/MessageConsumer.cs
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/test/csharp/DtcBasicTransactionsTest.cs
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/test/csharp/DtcConsumerTransactionsTest.cs
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/test/csharp/DtcProducerTransactionsTest.cs
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/test/csharp/DtcTransactionsTestSupport.cs

Propchange: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/
------------------------------------------------------------------------------
  Merged /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk:r1538073-1541943

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/main/csharp/MessageConsumer.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/main/csharp/MessageConsumer.cs?rev=1541946&r1=1541945&r2=1541946&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/main/csharp/MessageConsumer.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/main/csharp/MessageConsumer.cs Thu Nov 14 16:01:13 2013
@@ -751,7 +751,7 @@ namespace Apache.NMS.ActiveMQ
 	                            }
 	                            foreach (MessageDispatch delivered in dispatchedMessages) 
 								{
-	                                this.previouslyDeliveredMessages.Add(delivered.Message.MessageId, false);
+	                                this.previouslyDeliveredMessages[delivered.Message.MessageId] = false;
 	                            }
 	                        } 
 							else 
@@ -822,7 +822,7 @@ namespace Apache.NMS.ActiveMQ
 								{
 	                                if (previouslyDeliveredMessages != null) 
 									{
-	                                    previouslyDeliveredMessages.Add(dispatch.Message.MessageId, true);
+	                                    previouslyDeliveredMessages[dispatch.Message.MessageId] = true;
 	                                } 
 									else 
 									{

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/test/csharp/DtcBasicTransactionsTest.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/test/csharp/DtcBasicTransactionsTest.cs?rev=1541946&r1=1541945&r2=1541946&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/test/csharp/DtcBasicTransactionsTest.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/test/csharp/DtcBasicTransactionsTest.cs Thu Nov 14 16:01:13 2013
@@ -31,15 +31,15 @@ namespace Apache.NMS.ActiveMQ.Test
         {
             base.SetUp();
 
-            this.factory = new NetTxConnectionFactory(ReplaceEnvVar(connectionURI));
-            this.factory.ConfiguredResourceManagerId = Guid.NewGuid().ToString();
+            this.dtcFactory = new NetTxConnectionFactory(ReplaceEnvVar(connectionURI));
+            this.dtcFactory.ConfiguredResourceManagerId = Guid.NewGuid().ToString();
         }
 
         [Test]
         [ExpectedException("Apache.NMS.NMSException")]
         public void TestSessionCreateFailsWithInvalidLogLocation()
         {
-            using (INetTxConnection connection = factory.CreateNetTxConnection())
+            using (INetTxConnection connection = dtcFactory.CreateNetTxConnection())
             {
                 connection.ExceptionListener += this.OnException;
                 connection.Start();
@@ -57,7 +57,7 @@ namespace Apache.NMS.ActiveMQ.Test
             // Test initialize - Fills in DB with data to send.
             PrepareDatabase();
 
-            using (INetTxConnection connection = factory.CreateNetTxConnection())
+            using (INetTxConnection connection = dtcFactory.CreateNetTxConnection())
             {
                 connection.ExceptionListener += this.OnException;
                 connection.Start();
@@ -81,7 +81,7 @@ namespace Apache.NMS.ActiveMQ.Test
             PurgeDatabase();
             PurgeAndFillQueue();
 
-            using (INetTxConnection connection = factory.CreateNetTxConnection())
+            using (INetTxConnection connection = dtcFactory.CreateNetTxConnection())
             {
                 connection.ExceptionListener += this.OnException;
                 connection.Start();

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/test/csharp/DtcConsumerTransactionsTest.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/test/csharp/DtcConsumerTransactionsTest.cs?rev=1541946&r1=1541945&r2=1541946&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/test/csharp/DtcConsumerTransactionsTest.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/test/csharp/DtcConsumerTransactionsTest.cs Thu Nov 14 16:01:13 2013
@@ -36,8 +36,8 @@ namespace Apache.NMS.ActiveMQ.Test
         {
             base.SetUp();
 
-            this.factory = new NetTxConnectionFactory(ReplaceEnvVar(connectionURI));
-            this.factory.ConfiguredResourceManagerId = Guid.NewGuid().ToString();
+            this.dtcFactory = new NetTxConnectionFactory(ReplaceEnvVar(connectionURI));
+            this.dtcFactory.ConfiguredResourceManagerId = Guid.NewGuid().ToString();
         }
 
         [Test]
@@ -48,7 +48,7 @@ namespace Apache.NMS.ActiveMQ.Test
             PurgeAndFillQueue();
 
             // receive just one
-            using (INetTxConnection connection = factory.CreateNetTxConnection())
+            using (INetTxConnection connection = dtcFactory.CreateNetTxConnection())
             {
                 connection.Start();
 
@@ -111,7 +111,7 @@ namespace Apache.NMS.ActiveMQ.Test
             PurgeDatabase();
             PurgeAndFillQueue(messageCount);
 
-            using (INetTxConnection connection = factory.CreateNetTxConnection())
+            using (INetTxConnection connection = dtcFactory.CreateNetTxConnection())
             {
                 connection.Start();
 
@@ -182,7 +182,7 @@ namespace Apache.NMS.ActiveMQ.Test
             PurgeDatabase();
             PurgeAndFillQueue(messageCount);
 
-            using (INetTxConnection connection = factory.CreateNetTxConnection())
+            using (INetTxConnection connection = dtcFactory.CreateNetTxConnection())
             {
                 connection.Start();
 
@@ -252,7 +252,7 @@ namespace Apache.NMS.ActiveMQ.Test
             PurgeDatabase();
             PurgeAndFillQueue(messageCount);
 
-            using (INetTxConnection connection = factory.CreateNetTxConnection())
+            using (INetTxConnection connection = dtcFactory.CreateNetTxConnection())
             {
                 // allow no redelivery so that message immediatly goes to the DLQ if first read fails
                 connection.RedeliveryPolicy.MaximumRedeliveries = 0;
@@ -319,7 +319,7 @@ namespace Apache.NMS.ActiveMQ.Test
             PurgeDatabase();
             PurgeAndFillQueue();
 
-            using (INetTxConnection connection = factory.CreateNetTxConnection())
+            using (INetTxConnection connection = dtcFactory.CreateNetTxConnection())
             {
                 connection.ExceptionListener += this.OnException;
                 connection.Start();
@@ -351,7 +351,7 @@ namespace Apache.NMS.ActiveMQ.Test
             PurgeDatabase();
             PurgeAndFillQueue();
 
-            using (INetTxConnection connection = factory.CreateNetTxConnection())
+            using (INetTxConnection connection = dtcFactory.CreateNetTxConnection())
             {
                 connection.ExceptionListener += this.OnException;
                 connection.Start();
@@ -383,7 +383,7 @@ namespace Apache.NMS.ActiveMQ.Test
             PurgeDatabase();
             PurgeAndFillQueue(5 * MSG_COUNT);
 
-            using (INetTxConnection connection = factory.CreateNetTxConnection())
+            using (INetTxConnection connection = dtcFactory.CreateNetTxConnection())
             {
                 connection.ExceptionListener += this.OnException;
                 connection.Start();
@@ -411,7 +411,7 @@ namespace Apache.NMS.ActiveMQ.Test
             string newConnectionUri =
                 connectionURI + "?nms.RecoveryPolicy.RecoveryLogger.Location=" + logLocation +
                                 "&nms.configuredResourceManagerId=" + 
-                                factory.ConfiguredResourceManagerId;
+                                dtcFactory.ConfiguredResourceManagerId;
 
             // Test initialize - Fills in queue with data to send and clears the DB.
             PurgeDatabase();
@@ -424,9 +424,9 @@ namespace Apache.NMS.ActiveMQ.Test
 
             Directory.CreateDirectory(logLocation);
 
-            factory = new NetTxConnectionFactory(ReplaceEnvVar(newConnectionUri));
+            dtcFactory = new NetTxConnectionFactory(ReplaceEnvVar(newConnectionUri));
 
-            using (INetTxConnection connection = factory.CreateNetTxConnection())
+            using (INetTxConnection connection = dtcFactory.CreateNetTxConnection())
             {
                 connection.ExceptionListener += this.OnException;
                 connection.Start();
@@ -460,7 +460,7 @@ namespace Apache.NMS.ActiveMQ.Test
             PurgeDatabase();
             PurgeAndFillQueue();
 
-            using (INetTxConnection connection = factory.CreateNetTxConnection())
+            using (INetTxConnection connection = dtcFactory.CreateNetTxConnection())
             {
                 connection.ExceptionListener += this.OnException;
                 connection.Start();
@@ -485,7 +485,7 @@ namespace Apache.NMS.ActiveMQ.Test
             PurgeDatabase();
             PurgeAndFillQueue();
 
-            using (INetTxConnection connection = factory.CreateNetTxConnection())
+            using (INetTxConnection connection = dtcFactory.CreateNetTxConnection())
             {
                 connection.ExceptionListener += this.OnException;
                 connection.Start();
@@ -515,7 +515,7 @@ namespace Apache.NMS.ActiveMQ.Test
             PurgeDatabase();
             PurgeAndFillQueue();
 
-            using (INetTxConnection connection = factory.CreateNetTxConnection())
+            using (INetTxConnection connection = dtcFactory.CreateNetTxConnection())
             {
                 ITransport transport = (connection as Connection).ITransport;
                 TcpFaultyTransport tcpFaulty = transport.Narrow(typeof(TcpFaultyTransport)) as TcpFaultyTransport;
@@ -548,7 +548,7 @@ namespace Apache.NMS.ActiveMQ.Test
             PurgeDatabase();
             PurgeAndFillQueue();
 
-            using (INetTxConnection connection = factory.CreateNetTxConnection())
+            using (INetTxConnection connection = dtcFactory.CreateNetTxConnection())
             {
                 ITransport transport = (connection as Connection).ITransport;
                 TcpFaultyTransport tcpFaulty = transport.Narrow(typeof(TcpFaultyTransport)) as TcpFaultyTransport;
@@ -586,7 +586,7 @@ namespace Apache.NMS.ActiveMQ.Test
 
             var enlistment = new TestSinglePhaseCommit();
 
-            using (INetTxConnection connection = factory.CreateNetTxConnection())
+            using (INetTxConnection connection = dtcFactory.CreateNetTxConnection())
             {
                 connection.Start();
 
@@ -667,7 +667,7 @@ namespace Apache.NMS.ActiveMQ.Test
             PurgeDatabase();
             PurgeAndFillQueue(MSG_COUNT * BATCH_COUNT);
 
-            using (INetTxConnection connection = factory.CreateNetTxConnection())
+            using (INetTxConnection connection = dtcFactory.CreateNetTxConnection())
             using (NetTxSession session = connection.CreateNetTxSession() as NetTxSession)
             {
                 IQueue queue = session.GetQueue(testQueueName);

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/test/csharp/DtcProducerTransactionsTest.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/test/csharp/DtcProducerTransactionsTest.cs?rev=1541946&r1=1541945&r2=1541946&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/test/csharp/DtcProducerTransactionsTest.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/test/csharp/DtcProducerTransactionsTest.cs Thu Nov 14 16:01:13 2013
@@ -34,8 +34,8 @@ namespace Apache.NMS.ActiveMQ.Test
         {
             base.SetUp();
 
-            this.factory = new NetTxConnectionFactory(ReplaceEnvVar(connectionURI));
-            this.factory.ConfiguredResourceManagerId = Guid.NewGuid().ToString();
+            this.dtcFactory = new NetTxConnectionFactory(ReplaceEnvVar(connectionURI));
+            this.dtcFactory.ConfiguredResourceManagerId = Guid.NewGuid().ToString();
         }
 
         [Test]
@@ -44,7 +44,7 @@ namespace Apache.NMS.ActiveMQ.Test
             // Test initialize - Fills in DB with data to send.
             PrepareDatabase();
 
-            using (INetTxConnection connection = factory.CreateNetTxConnection())
+            using (INetTxConnection connection = dtcFactory.CreateNetTxConnection())
             {
                 connection.ExceptionListener += this.OnException;
                 connection.Start();
@@ -76,7 +76,7 @@ namespace Apache.NMS.ActiveMQ.Test
             // Test initialize - Fills in DB with data to send.
             PrepareDatabase();
 
-            using (INetTxConnection connection = factory.CreateNetTxConnection())
+            using (INetTxConnection connection = dtcFactory.CreateNetTxConnection())
             {
                 connection.ExceptionListener += this.OnException;
                 connection.Start();
@@ -107,11 +107,11 @@ namespace Apache.NMS.ActiveMQ.Test
             // Test initialize - Fills in DB with data to send.
             PrepareDatabase();
 
-            NetTxConnectionFactory netTxFactory = factory;
+            NetTxConnectionFactory netTxFactory = dtcFactory;
             RecoveryFileLogger logger = netTxFactory.RecoveryPolicy.RecoveryLogger as RecoveryFileLogger;
             string logDirectory = logger.Location;
 
-            using (INetTxConnection connection = factory.CreateNetTxConnection())
+            using (INetTxConnection connection = dtcFactory.CreateNetTxConnection())
             {
                 connection.ExceptionListener += this.OnException;
                 connection.Start();
@@ -151,11 +151,11 @@ namespace Apache.NMS.ActiveMQ.Test
             string newConnectionUri = 
                 connectionURI + "?nms.RecoveryPolicy.RecoveryLoggerType=harness" +
                                 "&nms.configuredResourceManagerId=" +
-                                factory.ConfiguredResourceManagerId;
+                                dtcFactory.ConfiguredResourceManagerId;
 
-            factory = new NetTxConnectionFactory(ReplaceEnvVar(newConnectionUri));
+            dtcFactory = new NetTxConnectionFactory(ReplaceEnvVar(newConnectionUri));
 
-            using (INetTxConnection connection = factory.CreateNetTxConnection())
+            using (INetTxConnection connection = dtcFactory.CreateNetTxConnection())
             {
                 IRecoveryLogger logger = (connection as NetTxConnection).RecoveryPolicy.RecoveryLogger;
                 Assert.IsNotNull(logger);
@@ -185,7 +185,7 @@ namespace Apache.NMS.ActiveMQ.Test
             // Test initialize - Fills in DB with data to send.
             PrepareDatabase();
 
-            using (INetTxConnection connection = factory.CreateNetTxConnection())
+            using (INetTxConnection connection = dtcFactory.CreateNetTxConnection())
             {
                 connection.ExceptionListener += this.OnException;
                 connection.Start();
@@ -213,7 +213,7 @@ namespace Apache.NMS.ActiveMQ.Test
             // Test initialize - Fills in DB with data to send.
             PrepareDatabase();
 
-            using (INetTxConnection connection = factory.CreateNetTxConnection())
+            using (INetTxConnection connection = dtcFactory.CreateNetTxConnection())
             {
                 connection.ExceptionListener += this.OnException;
                 connection.Start();
@@ -241,7 +241,7 @@ namespace Apache.NMS.ActiveMQ.Test
             // Test initialize - Fills in DB with data to send.
             PrepareDatabase();
 
-            using (INetTxConnection connection = factory.CreateNetTxConnection())
+            using (INetTxConnection connection = dtcFactory.CreateNetTxConnection())
             {
                 connection.ExceptionListener += this.OnException;
                 connection.Start();
@@ -264,7 +264,7 @@ namespace Apache.NMS.ActiveMQ.Test
             // Test initialize - Fills in DB with data to send.
             PrepareDatabase();
 
-            using (INetTxConnection connection = factory.CreateNetTxConnection())
+            using (INetTxConnection connection = dtcFactory.CreateNetTxConnection())
             {
                 connection.ExceptionListener += this.OnException;
                 connection.Start();
@@ -292,7 +292,7 @@ namespace Apache.NMS.ActiveMQ.Test
         [Test]
         public void TestIterativeTransactedProduceWithDBDelete()
         {
-            using (INetTxConnection connection = factory.CreateNetTxConnection())
+            using (INetTxConnection connection = dtcFactory.CreateNetTxConnection())
             {
                 connection.ExceptionListener += this.OnException;
                 connection.Start();

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/test/csharp/DtcTransactionsTestSupport.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/test/csharp/DtcTransactionsTestSupport.cs?rev=1541946&r1=1541945&r2=1541946&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/test/csharp/DtcTransactionsTestSupport.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.6.x/src/test/csharp/DtcTransactionsTestSupport.cs Thu Nov 14 16:01:13 2013
@@ -48,7 +48,7 @@ namespace Apache.NMS.ActiveMQ.Test
     {
         protected const int MSG_COUNT = 5;
         protected string nonExistantPath;
-        protected NetTxConnectionFactory factory;
+        protected NetTxConnectionFactory dtcFactory;
         
         private ITrace oldTracer;
 
@@ -326,7 +326,7 @@ namespace Apache.NMS.ActiveMQ.Test
 
         protected void VerifyBrokerQueueCount(int expectedCount, string connectionUri)
         {           
-            using (INetTxConnection connection = factory.CreateNetTxConnection())
+            using (INetTxConnection connection = dtcFactory.CreateNetTxConnection())
             {
                 // check messages are present in the queue
                 using (INetTxSession session = connection.CreateNetTxSession())
@@ -398,7 +398,7 @@ namespace Apache.NMS.ActiveMQ.Test
 
         protected void VerifyBrokerHasMessagesInQueue(string connectionURI)
         {
-            using (INetTxConnection connection = factory.CreateNetTxConnection())
+            using (INetTxConnection connection = dtcFactory.CreateNetTxConnection())
             {
                 // check messages are present in the queue
                 using (INetTxSession session = connection.CreateNetTxSession())