You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by jg...@apache.org on 2008/05/29 18:38:49 UTC

svn commit: r661387 - in /activemq/activemq-dotnet/Apache.NMS/trunk: src/test/csharp/ConnectionTest.cs vs2005-nms-test.csproj

Author: jgomes
Date: Thu May 29 09:38:49 2008
New Revision: 661387

URL: http://svn.apache.org/viewvc?rev=661387&view=rev
Log:
Move ConnectionTest.cs to abstract base test class so that all providers can be tested for this condition.
Fixes [AMQNET-84]. (See https://issues.apache.org/activemq/browse/AMQNET-84)

Added:
    activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/ConnectionTest.cs
Modified:
    activemq/activemq-dotnet/Apache.NMS/trunk/vs2005-nms-test.csproj

Added: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/ConnectionTest.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/ConnectionTest.cs?rev=661387&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/ConnectionTest.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/ConnectionTest.cs Thu May 29 09:38:49 2008
@@ -0,0 +1,46 @@
+/*
+ * 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 NUnit.Framework;
+
+namespace Apache.NMS.Test
+{
+	[TestFixture]
+	public abstract class ConnectionTest : NMSTestSupport
+	{
+		/// <summary>
+		/// Verify that it is possible to create multiple connections to the broker.
+		/// There was a bug in the connection factory which set the clientId member which made
+		/// it impossible to create an additional connection.
+		/// </summary>
+		[Test]
+		public void TwoConnections()
+		{
+			IConnection connection1 = Factory.CreateConnection();
+			connection1.Start();
+
+			IConnection connection2 = Factory.CreateConnection();
+			connection2.Start();
+
+			connection1.Stop();
+			connection1.Dispose();
+			connection2.Stop();
+			connection2.Dispose();
+			// with the bug present we'll get an exception in connection2.start()
+		}
+	}
+}

Modified: activemq/activemq-dotnet/Apache.NMS/trunk/vs2005-nms-test.csproj
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/vs2005-nms-test.csproj?rev=661387&r1=661386&r2=661387&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/vs2005-nms-test.csproj (original)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/vs2005-nms-test.csproj Thu May 29 09:38:49 2008
@@ -45,6 +45,7 @@
       <SubType>Code</SubType>
     </Compile>
     <Compile Include="src\test\csharp\CommonAssemblyInfo.cs" />
+    <Compile Include="src\test\csharp\ConnectionTest.cs" />
     <Compile Include="src\test\csharp\ConsumerTest.cs">
       <SubType>Code</SubType>
     </Compile>