activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgo...@apache.org
Subject svn commit: r915017 - in /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp: TestMain.cs TestMainAsync.cs
Date Mon, 22 Feb 2010 19:02:01 GMT
Author: jgomes
Date: Mon Feb 22 19:02:00 2010
New Revision: 915017

URL: http://svn.apache.org/viewvc?rev=915017&view=rev
Log:
Updated sample files.

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

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/TestMain.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/TestMain.cs?rev=915017&r1=915016&r2=915017&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/TestMain.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/TestMain.cs Mon Feb
22 19:02:00 2010
@@ -32,7 +32,7 @@
     {
         // Example connection strings:
         //    activemq:tcp://activemqhost:61616
-        //    activemq:tcp://activemqhost:61613?transport.wireformat=stomp
+        //    stomp:tcp://activemqhost:61613
         //    ems:tcp://tibcohost:7222
         //    msmq://localhost
 
@@ -50,14 +50,25 @@
              //
              // Hard coded destinations:
              //    IDestination destination = session.GetQueue("FOO.BAR");
+             //    Debug.Assert(destination is IQueue);
              //    IDestination destination = session.GetTopic("FOO.BAR");
+             //    Debug.Assert(destination is ITopic);
              //
              // Embedded destination type in the name:
              //    IDestination destination = SessionUtil.GetDestination(session, "queue://FOO.BAR");
+             //    Debug.Assert(destination is IQueue);
              //    IDestination destination = SessionUtil.GetDestination(session, "topic://FOO.BAR");
+             //    Debug.Assert(destination is ITopic);
              //
              // Defaults to queue if type is not specified:
              //    IDestination destination = SessionUtil.GetDestination(session, "FOO.BAR");
+             //    Debug.Assert(destination is IQueue);
+             //
+             // .NET 3.5 Supports Extension methods for a simplified syntax:
+             //    IDestination destination = session.GetDestination("queue://FOO.BAR");
+             //    Debug.Assert(destination is IQueue);
+             //    IDestination destination = session.GetDestination("topic://FOO.BAR");
+             //    Debug.Assert(destination is ITopic);
 
             IDestination destination = SessionUtil.GetDestination(session, "queue://FOO.BAR");
             Console.WriteLine("Using destination: " + destination);
@@ -66,6 +77,8 @@
             using(IMessageConsumer consumer = session.CreateConsumer(destination))
             using(IMessageProducer producer = session.CreateProducer(destination))
             {
+                // Start the connection so that messages will be processed.
+                connection.Start();
                 producer.Persistent = true;
 
                 // Send a message

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/TestMainAsync.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/TestMainAsync.cs?rev=915017&r1=915016&r2=915017&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/TestMainAsync.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/test/csharp/TestMainAsync.cs Mon
Feb 22 19:02:00 2010
@@ -37,7 +37,7 @@
     {
         // Example connection strings:
         //    activemq:tcp://activemqhost:61616
-        //    activemq:tcp://activemqhost:61613?transport.wireformat=stomp
+        //    stomp:tcp://activemqhost:61613
         //    ems:tcp://tibcohost:7222
         //    msmq://localhost
 
@@ -55,14 +55,25 @@
              //
              // Hard coded destinations:
              //    IDestination destination = session.GetQueue("FOO.BAR");
+             //    Debug.Assert(destination is IQueue);
              //    IDestination destination = session.GetTopic("FOO.BAR");
+             //    Debug.Assert(destination is ITopic);
              //
              // Embedded destination type in the name:
              //    IDestination destination = SessionUtil.GetDestination(session, "queue://FOO.BAR");
+             //    Debug.Assert(destination is IQueue);
              //    IDestination destination = SessionUtil.GetDestination(session, "topic://FOO.BAR");
+             //    Debug.Assert(destination is ITopic);
              //
              // Defaults to queue if type is not specified:
              //    IDestination destination = SessionUtil.GetDestination(session, "FOO.BAR");
+             //    Debug.Assert(destination is IQueue);
+             //
+             // .NET 3.5 Supports Extension methods for a simplified syntax:
+             //    IDestination destination = session.GetDestination("queue://FOO.BAR");
+             //    Debug.Assert(destination is IQueue);
+             //    IDestination destination = session.GetDestination("topic://FOO.BAR");
+             //    Debug.Assert(destination is ITopic);
 
             IDestination destination = SessionUtil.GetDestination(session, "queue://FOO.BAR");
             Console.WriteLine("Using destination: " + destination);
@@ -71,7 +82,8 @@
             using(IMessageConsumer consumer = session.CreateConsumer(destination))
             using(IMessageProducer producer = session.CreateProducer(destination))
             {
-                connection.Start();     // Must start the connection for async messaging.
+                // Start the connection so that messages will be processed.
+                connection.Start();
                 producer.Persistent = true;
                 producer.RequestTimeout = receiveTimeout;
                 consumer.Listener += new MessageListener(OnMessage);



Mime
View raw message