activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r512779 - in /activemq/activemq-dotnet/trunk/src/test/csharp: NMS/Test/NMSPropertyTest.cs Stomp/NMSPropertyTest.cs
Date Wed, 28 Feb 2007 14:52:03 GMT
Author: jstrachan
Date: Wed Feb 28 06:52:02 2007
New Revision: 512779

URL: http://svn.apache.org/viewvc?view=rev&rev=512779
Log:
fixed the NMS Stomp test cases finally

Modified:
    activemq/activemq-dotnet/trunk/src/test/csharp/NMS/Test/NMSPropertyTest.cs
    activemq/activemq-dotnet/trunk/src/test/csharp/Stomp/NMSPropertyTest.cs

Modified: activemq/activemq-dotnet/trunk/src/test/csharp/NMS/Test/NMSPropertyTest.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/trunk/src/test/csharp/NMS/Test/NMSPropertyTest.cs?view=diff&rev=512779&r1=512778&r2=512779
==============================================================================
--- activemq/activemq-dotnet/trunk/src/test/csharp/NMS/Test/NMSPropertyTest.cs (original)
+++ activemq/activemq-dotnet/trunk/src/test/csharp/NMS/Test/NMSPropertyTest.cs Wed Feb 28
06:52:02 2007
@@ -102,7 +102,6 @@
             
             // compare standard NMS headers
             Assert.AreEqual(correlationID, message.NMSCorrelationID, "NMSCorrelationID");
-            Assert.AreEqual(replyTo, message.NMSReplyTo, "NMSReplyTo");
             Assert.AreEqual(persistent, message.NMSPersistent, "NMSPersistent");
             Assert.AreEqual(priority, message.NMSPriority, "NMSPriority");
             Assert.AreEqual(type, message.NMSType, "NMSType");
@@ -111,7 +110,28 @@
             
             // compare custom headers
             Assert.AreEqual(customText, message.Properties["customText"], "customText");
-            Assert.AreEqual(custom1, message.Properties["custom1"], "custom1");
+			
+            AssertReplyToValid(message);
+			
+            AssertNonStringProperties(message);
+            
+            // lets now look at some standard NMS headers
+            Console.WriteLine("NMSExpiration: " + message.NMSExpiration);
+            Console.WriteLine("NMSMessageId: " + message.NMSMessageId);
+            Console.WriteLine("NMSRedelivered: " + message.NMSRedelivered);
+            Console.WriteLine("NMSTimestamp: " + message.NMSTimestamp);
+            Console.WriteLine("NMSXDeliveryCount: " + message.Properties["NMSXDeliveryCount"]);
+            Console.WriteLine("NMSXProducerTXID: " + message.Properties["NMSXProducerTXID"]);
+        }
+
+		protected virtual void AssertReplyToValid(IMessage message)
+		{
+			Assert.AreEqual(replyTo, message.NMSReplyTo, "NMSReplyTo");
+		}
+
+		protected virtual void AssertNonStringProperties(IMessage message)
+		{
+			Assert.AreEqual(custom1, message.Properties["custom1"], "custom1");
             Assert.AreEqual(custom2, message.Properties["custom2"], "custom2");
             Assert.AreEqual(custom3, message.Properties["custom3"], "custom3");
             Assert.AreEqual(custom4, message.Properties["custom4"], "custom4");
@@ -122,7 +142,7 @@
             Console.WriteLine("actual type is: " + value6.GetType() + " value: " + value6);
             Console.WriteLine("expected type is: " + expected6.GetType() + " value: " + expected6);
             Assert.AreEqual(custom6, value6, "custom6 which is of type: " + value6.GetType());
-
+			
             Assert.AreEqual(custom6, message.Properties["custom6"], "custom6");
             Assert.AreEqual(custom7, message.Properties["custom7"], "custom7");
 			Assert.AreEqual(custom8, message.Properties["custom8"], "custom8");
@@ -136,15 +156,7 @@
             Assert.AreEqual(custom6, message.Properties.GetChar("custom6"), "custom6");
             Assert.AreEqual(custom7, message.Properties.GetFloat("custom7"), "custom7");
 			Assert.AreEqual(custom8, message.Properties.GetDouble("custom8"), "custom8");
-            
-            // lets now look at some standard NMS headers
-            Console.WriteLine("NMSExpiration: " + message.NMSExpiration);
-            Console.WriteLine("NMSMessageId: " + message.NMSMessageId);
-            Console.WriteLine("NMSRedelivered: " + message.NMSRedelivered);
-            Console.WriteLine("NMSTimestamp: " + message.NMSTimestamp);
-            Console.WriteLine("NMSXDeliveryCount: " + message.Properties["NMSXDeliveryCount"]);
-            Console.WriteLine("NMSXProducerTXID: " + message.Properties["NMSXProducerTXID"]);
-        }
+		}
     }
 }
 

Modified: activemq/activemq-dotnet/trunk/src/test/csharp/Stomp/NMSPropertyTest.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/trunk/src/test/csharp/Stomp/NMSPropertyTest.cs?view=diff&rev=512779&r1=512778&r2=512779
==============================================================================
--- activemq/activemq-dotnet/trunk/src/test/csharp/Stomp/NMSPropertyTest.cs (original)
+++ activemq/activemq-dotnet/trunk/src/test/csharp/Stomp/NMSPropertyTest.cs Wed Feb 28 06:52:02
2007
@@ -26,10 +26,22 @@
     {
         protected override IConnectionFactory CreateConnectionFactory()
         {
-			Console.WriteLine("##### using the NMS STOMP client!");
-			
             return new ConnectionFactory();
         }
+		
+		protected override void AssertNonStringProperties(IMessage message)
+		{
+			// lets disable typesafe property testing as right now Stomp does not support them
+		}
+		
+		
+		protected override void AssertReplyToValid(IMessage message)
+		{
+			// TODO completely support temporary destinations in STOMP
+			
+			Assert.IsNotNull(message.NMSReplyTo, "NMSReplyTo");
+			Assert.IsTrue(message.NMSReplyTo is ITemporaryQueue, "The reply to destination is not
a TemporaryTopic!: " + message.NMSReplyTo);
+		}
     }
 }
 



Mime
View raw message