activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1066510 - /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/NetTxConnectionFactoryTest.cs
Date Wed, 02 Feb 2011 16:01:57 GMT
Author: tabish
Date: Wed Feb  2 16:01:56 2011
New Revision: 1066510

URL: http://svn.apache.org/viewvc?rev=1066510&view=rev
Log:
Adds an additional test case.

Modified:
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/NetTxConnectionFactoryTest.cs

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/NetTxConnectionFactoryTest.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/NetTxConnectionFactoryTest.cs?rev=1066510&r1=1066509&r2=1066510&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/NetTxConnectionFactoryTest.cs
(original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/NetTxConnectionFactoryTest.cs
Wed Feb  2 16:01:56 2011
@@ -250,6 +250,35 @@ namespace Apache.NMS.ActiveMQ.Test
         }
 
         [Test]
+        [TestCase("/var/log/nms/recovery/", true)]
+        [TestCase("/var/temp/log/nms/recovery/", false)]
+        public void TestConfigureRecoveryPolicyLoggerUsingDefaultLogger(string location,
bool autoCreate)
+        {
+            string testuri = string.Format("activemq:tcp://${{activemqhost}}:61616" +
+                                           "?nms.RecoveryPolicy.RecoveryLogger.Location={0}"
+
+                                           "&nms.RecoveryPolicy.RecoveryLogger.AutoCreateLocation={1}",
+                                           location, autoCreate);
+
+            INetTxConnectionFactory factory = new NetTxConnectionFactory(NMSTestSupport.ReplaceEnvVar(testuri));
+
+            using(INetTxConnection connection = factory.CreateNetTxConnection())
+            {
+                NetTxConnection netTxConnection = connection as NetTxConnection;
+
+                Assert.IsNotNull(netTxConnection);
+                NetTxRecoveryPolicy policy = netTxConnection.RecoveryPolicy;
+
+                Assert.AreEqual("file", policy.RecoveryLoggerType);
+
+                RecoveryFileLogger logger = policy.RecoveryLogger as RecoveryFileLogger;
+
+                Assert.IsNotNull(logger);
+                Assert.AreEqual(location, logger.Location);
+                Assert.AreEqual(autoCreate, logger.AutoCreateLocation);
+            }
+        }
+		
+        [Test]
         [ExpectedException( "Apache.NMS.NMSException" )]
         public void TestConfigureRecoveryPolicyLoggerTypeWithInvalidType(
             [Values("tcp://${activemqhost}:61616?nms.RecoveryPolicy.RecoveryLoggerType=invalid")]



Mime
View raw message