activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1000507 - in /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src: main/csharp/Connection.cs main/csharp/ConnectionFactory.cs test/csharp/ConnectionFactoryTest.cs
Date Thu, 23 Sep 2010 15:52:09 GMT
Author: tabish
Date: Thu Sep 23 15:52:08 2010
New Revision: 1000507

URL: http://svn.apache.org/viewvc?rev=1000507&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQNET-281

Fix error in CreateSession URI parsing, adds a test to ensure this is fixed.  

Modified:
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/ConnectionFactory.cs
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/ConnectionFactoryTest.cs

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs?rev=1000507&r1=1000506&r2=1000507&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs Thu Sep
23 15:52:08 2010
@@ -440,10 +440,14 @@ namespace Apache.NMS.ActiveMQ
             Session session = new Session(this, info, sessionAcknowledgementMode, this.dispatchAsync);
 
             // Set propertieDs on session using parameters prefixed with "session."
-			StringDictionary options = URISupport.ParseQuery(this.brokerUri.Query);
-			options = URISupport.GetProperties(options, "session.");
-            URISupport.SetProperties(session, options);
-
+			if(!String.IsNullOrEmpty(brokerUri.Query) && !brokerUri.OriginalString.EndsWith(")"))
+			{
+				string query = brokerUri.Query.Substring(brokerUri.Query.LastIndexOf(")") + 1);					

+				StringDictionary options = URISupport.ParseQuery(query);
+				options = URISupport.GetProperties(options, "session.");
+	            URISupport.SetProperties(session, options);
+			}
+			
 			session.ConsumerTransformer = this.ConsumerTransformer;
 			session.ProducerTransformer = this.ProducerTransformer;
 

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/ConnectionFactory.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/ConnectionFactory.cs?rev=1000507&r1=1000506&r2=1000507&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/ConnectionFactory.cs
(original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/ConnectionFactory.cs
Thu Sep 23 15:52:08 2010
@@ -163,6 +163,8 @@ namespace Apache.NMS.ActiveMQ
 			get { return brokerUri; }
 			set
 			{
+				Tracer.Info("BrokerUri set = " + value.OriginalString);
+				
 				brokerUri = new Uri(URISupport.StripPrefix(value.OriginalString, "activemq:"));
 				
 				if(!String.IsNullOrEmpty(brokerUri.Query) && !brokerUri.OriginalString.EndsWith(")"))

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/ConnectionFactoryTest.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/ConnectionFactoryTest.cs?rev=1000507&r1=1000506&r2=1000507&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/ConnectionFactoryTest.cs
(original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/ConnectionFactoryTest.cs
Thu Sep 23 15:52:08 2010
@@ -52,6 +52,23 @@ namespace Apache.NMS.ActiveMQ.Test
 				using(IConnection connection = factory.CreateConnection("", ""))
 				{
 					Assert.IsNotNull(connection);
+					
+					using(ISession session = connection.CreateSession())
+					{
+						IDestination destination = session.CreateTemporaryTopic();
+						using(IMessageProducer producer = session.CreateProducer(destination))
+						{
+							producer.Close();
+						}
+						
+						using(IMessageConsumer consumer = session.CreateConsumer(destination))
+						{
+							consumer.Close();
+						}
+						
+						session.Close();
+					}
+					
 					connection.Close();
 				}
 			}
@@ -62,6 +79,23 @@ namespace Apache.NMS.ActiveMQ.Test
 				using(IConnection connection = factory.CreateConnection("", ""))
 				{
 					Assert.IsNotNull(connection);
+
+					using(ISession session = connection.CreateSession())
+					{
+						IDestination destination = session.CreateTemporaryTopic();
+						using(IMessageProducer producer = session.CreateProducer(destination))
+						{
+							producer.Close();
+						}
+						
+						using(IMessageConsumer consumer = session.CreateConsumer(destination))
+						{
+							consumer.Close();
+						}
+						
+						session.Close();
+					}
+					
 					connection.Close();
 				}
 			}



Mime
View raw message