Author: jgomes Date: Thu May 29 09:07:50 2008 New Revision: 661374 URL: http://svn.apache.org/viewvc?rev=661374&view=rev Log: Test case contribution from StefanL. Fixes [AMQNET-84]. (See https://issues.apache.org/activemq/browse/AMQNET-84) Added: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/ConnectionTest.cs Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/vs2005-activemq-test.csproj Added: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/ConnectionTest.cs URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/ConnectionTest.cs?rev=661374&view=auto ============================================================================== --- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/ConnectionTest.cs (added) +++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/ConnectionTest.cs Thu May 29 09:07:50 2008 @@ -0,0 +1,47 @@ +?/* + * 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 Apache.NMS; +using NUnit.Framework; + +namespace Apache.NMS.ActiveMQ.Test +{ + [TestFixture] + public class ConnectionTest + { + /// + /// 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. + /// + [Test] + public void TwoConnections() + { + Apache.NMS.IConnectionFactory connectionFactory = new Apache.NMS.ActiveMQ.ConnectionFactory(new Uri("tcp://localhost:61616")); + Apache.NMS.IConnection connection1 = connectionFactory.CreateConnection(); + connection1.Start(); + Apache.NMS.IConnection connection2 = connectionFactory.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.ActiveMQ/trunk/vs2005-activemq-test.csproj URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/vs2005-activemq-test.csproj?rev=661374&r1=661373&r2=661374&view=diff ============================================================================== --- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/vs2005-activemq-test.csproj (original) +++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/vs2005-activemq-test.csproj Thu May 29 09:07:50 2008 @@ -43,6 +43,7 @@ Code + @@ -84,4 +85,4 @@ - \ No newline at end of file +