Author: jgomes
Date: Tue Aug  5 10:08:20 2008
New Revision: 682794

URL: http://svn.apache.org/viewvc?rev=682794&view=rev
Log:
Refactored unit tests to load external configuration that can be customized for 
a run-time environment without having to modify and recompile the unit test 
code.
Fixes [AMQNET-92]. (See https://issues.apache.org/activemq/browse/AMQNET-92)

Added:
    activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/nmsprovider-test.config
    
activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/test/csharp/InheritedTests.cs
Removed:
    
activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/test/csharp/NMSConnectionFactoryTest.cs
Modified:
    activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Session.cs
    
activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/test/csharp/ProducerTest.cs
    activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/vs2008-msmq-test.csproj

Added: activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/nmsprovider-test.config
URL: 
http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/nmsprovider-test.config?rev=682794&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/nmsprovider-test.config 
(added)
+++ activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/nmsprovider-test.config Tue 
Aug  5 10:08:20 2008
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+* 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.
+-->
+<configuration>
+       <defaultURI value="msmq://localhost">
+               <factoryParams>
+                       <param type="string" value="NMSTestClient"/>
+               </factoryParams>
+               <userName value="guest"/>
+               <passWord value="guest"/>
+       </defaultURI>
+</configuration>

Modified: 
activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Session.cs
URL: 
http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Session.cs?rev=682794&r1=682793&r2=682794&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Session.cs 
(original)
+++ activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Session.cs 
Tue Aug  5 10:08:20 2008
@@ -91,7 +91,7 @@
                {
                        if(selector != null)
                        {
-                               throw new NotImplementedException("Selectors 
are not supported by MSQM");
+                               throw new NotImplementedException("Selectors 
are not supported by MSMQ");
                        }
                        MessageQueue queue = 
MessageConverter.ToMsmqDestination(destination);
             return new MessageConsumer(this, acknowledgementMode, queue);
@@ -120,17 +120,17 @@
         
         public ITopic GetTopic(string name)
         {
-            throw new NotImplementedException("Topics are not supported by 
MSQM");
+            throw new NotImplementedException("Topics are not supported by 
MSMQ");
         }
         
         public ITemporaryQueue CreateTemporaryQueue()
         {
-            throw new NotImplementedException("Tempoary Queues are not 
supported by MSQM");
+            throw new NotImplementedException("Tempoary Queues are not 
supported by MSMQ");
         }
         
         public ITemporaryTopic CreateTemporaryTopic()
         {
-            throw new NotImplementedException("Tempoary Topics are not 
supported by MSQM");
+            throw new NotImplementedException("Tempoary Topics are not 
supported by MSMQ");
         }
         
         public IMessage CreateMessage()

Added: 
activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/test/csharp/InheritedTests.cs
URL: 
http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/test/csharp/InheritedTests.cs?rev=682794&view=auto
==============================================================================
--- 
activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/test/csharp/InheritedTests.cs
 (added)
+++ 
activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/test/csharp/InheritedTests.cs
 Tue Aug  5 10:08:20 2008
@@ -0,0 +1,75 @@
+/*
+ * 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 NUnit.Framework;
+
+namespace Apache.NMS.MSMQ.Test
+{
+       [TestFixture]
+       public class AsyncConsumeTest : Apache.NMS.Test.AsyncConsumeTest
+       {
+       }
+
+       [TestFixture]
+       public class BadConsumeTest : Apache.NMS.Test.BadConsumeTest
+       {
+       }
+
+       [TestFixture]
+       public class BytesMessageTest : Apache.NMS.Test.BytesMessageTest
+       {
+       }
+
+       [TestFixture]
+       public class ConnectionTest : Apache.NMS.Test.ConnectionTest
+       {
+       }
+
+       [TestFixture]
+       public class ConsumerTest : Apache.NMS.Test.ConsumerTest
+       {
+       }
+
+       [TestFixture]
+       public class DurableTest : Apache.NMS.Test.DurableTest
+       {
+       }
+
+       [TestFixture]
+       public class MapMessageTest : Apache.NMS.Test.MapMessageTest
+       {
+       }
+
+       [TestFixture]
+       public class NMSPropertyTest : Apache.NMS.Test.NMSPropertyTest
+       {
+       }
+
+       [TestFixture]
+       public class TemporaryQueueTest : Apache.NMS.Test.TemporaryQueueTest
+       {
+       }
+
+       [TestFixture]
+       public class TextMessage : Apache.NMS.Test.TextMessage
+       {
+       }
+
+       [TestFixture]
+       public class TransactionTest : Apache.NMS.Test.TransactionTest
+       {
+       }
+}

Modified: 
activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/test/csharp/ProducerTest.cs
URL: 
http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/test/csharp/ProducerTest.cs?rev=682794&r1=682793&r2=682794&view=diff
==============================================================================
--- 
activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/test/csharp/ProducerTest.cs 
(original)
+++ 
activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/test/csharp/ProducerTest.cs 
Tue Aug  5 10:08:20 2008
@@ -22,24 +22,6 @@
        [TestFixture]
     public class ProducerTest : NMS.Test.NMSTestSupport
     {
-                               
-               [SetUp]
-        override public void SetUp()
-        {
-                       base.SetUp();
-        }
-               
-        [TearDown]
-        override public void TearDown()
-        {
-                       base.TearDown();
-        }
-
-        override protected IConnectionFactory CreateConnectionFactory()
-        {
-            return new ConnectionFactory();
-        }
-           
         protected override string CreateDestinationName()
         {
             return ".\\Private$\\" + GetType().Name;
@@ -55,12 +37,6 @@
             ITextMessage message = Session.CreateTextMessage("1st");
 //            message.Properties["color"] =  "red";
             producer.Send(message);
-            
-            
         }
-                               
     }
 }
-
-
-

Modified: activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/vs2008-msmq-test.csproj
URL: 
http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/vs2008-msmq-test.csproj?rev=682794&r1=682793&r2=682794&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/vs2008-msmq-test.csproj 
(original)
+++ activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/vs2008-msmq-test.csproj Tue 
Aug  5 10:08:20 2008
@@ -51,17 +51,14 @@
     <DebugType>full</DebugType>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="nunit.framework, Version=2.2.0.0, Culture=neutral, 
PublicKeyToken=96d09a1eb7f44a77">
-      <SpecificVersion>False</SpecificVersion>
-      
<HintPath>$(USERPROFILE)\.nant\repository\org.nunit\nunit\2.2.8\all\nunit.framework.dll</HintPath>
-    </Reference>
+    <Reference Include="nunit.framework, Version=2.4.7.0, Culture=neutral, 
PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL" />
     <Reference Include="System" />
     <Reference Include="System.Messaging" />
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
     <Compile Include="src\test\csharp\CommonAssemblyInfo.cs" />
-    <Compile Include="src\test\csharp\NMSConnectionFactoryTest.cs" />
+    <Compile Include="src\test\csharp\InheritedTests.cs" />
     <Compile Include="src\test\csharp\ProducerTest.cs">
       <SubType>Code</SubType>
     </Compile>
@@ -102,6 +99,9 @@
   </ItemGroup>
   <ItemGroup>
     <None Include="activemq-dotnet.snk" />
+    <Content Include="nmsprovider-test.config">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
   </ItemGroup>
   <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
 </Project>
\ No newline at end of file


Reply via email to