activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r380220 [2/2] - in /incubator/activemq/trunk/openwire-dotnet: src/OpenWire.Client/ src/OpenWire.Client/Commands/ src/OpenWire.Client/Core/ tests/OpenWire.Client/
Date Thu, 23 Feb 2006 20:36:18 GMT
Added: incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/CommandTest.cs
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/CommandTest.cs?rev=380220&view=auto
==============================================================================
--- incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/CommandTest.cs (added)
+++ incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/CommandTest.cs Thu Feb
23 12:36:12 2006
@@ -0,0 +1,45 @@
+using NUnit.Framework;
+using OpenWire.Client.Commands;
+using System.Collections;
+
+namespace OpenWire.Client
+{
+    [TestFixture]
+    public class CommandTest
+    {
+        
+        [Test]
+        public void TestCommand()
+        {
+            ConsumerId value1 = new ConsumerId();
+            value1.ConnectionId = "abc";
+            value1.SessionId = 123;
+            value1.Value = 456;
+            
+            ConsumerId value2 = new ConsumerId();
+            value2.ConnectionId = "abc";
+            value2.SessionId = 123;
+            value2.Value = 456;
+            
+            ConsumerId value3 = new ConsumerId();
+            value3.ConnectionId = "abc";
+            value3.SessionId = 123;
+            value3.Value = 457;
+            
+            Assert.AreEqual(value1, value2, "value1 and value2 should be equal");
+            Assert.AreEqual(value1.GetHashCode(), value2.GetHashCode(), "value1 and value2
hash codes should be equal");
+            
+            Assert.IsTrue(!value1.Equals(value3), "value1 and value3 should not be equal");
+            Assert.IsTrue(!value3.Equals(value2), "value3 and value2 should not be equal");
+            
+            // now lets test an IDictionary
+            IDictionary dictionary = new Hashtable();
+            dictionary[value1] = value3;
+            
+            // now lets lookup with a copy
+            object actual = dictionary[value2];
+            
+            Assert.AreEqual(value3, actual, "Should have found item in Map using value2 as
a key");
+        }
+    }
+}

Modified: incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/TestMain.cs
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/TestMain.cs?rev=380220&r1=380219&r2=380220&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/TestMain.cs (original)
+++ incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/TestMain.cs Thu Feb 23
12:36:12 2006
@@ -3,6 +3,7 @@
 
 using OpenWire.Client;
 using OpenWire.Client.Core;
+using OpenWire.Client.Commands;
 
 namespace openwire_dotnet
 {
@@ -32,10 +33,14 @@
                     
                     IMessageProducer producer = session.CreateProducer(destination);
                     string expected = "Hello World!";
+                    
+                    
                     ITextMessage request = session.CreateTextMessage(expected);
+                    
                     producer.Send(request);
                     
-                    ITextMessage message = (ITextMessage) consumer.Receive();
+                    Console.WriteLine("### About to receive message...");
+                    ActiveMQTextMessage message = (ActiveMQTextMessage) consumer.Receive();
                     if (message == null)
                     {
                         Console.WriteLine("### No message!!");



Mime
View raw message