activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgo...@apache.org
Subject svn commit: r771975 - /activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/ConsumerTest.cs
Date Tue, 05 May 2009 19:28:37 GMT
Author: jgomes
Date: Tue May  5 19:28:37 2009
New Revision: 771975

URL: http://svn.apache.org/viewvc?rev=771975&view=rev
Log:
Minor reformat.

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

Modified: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/ConsumerTest.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/ConsumerTest.cs?rev=771975&r1=771974&r2=771975&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/ConsumerTest.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/ConsumerTest.cs Tue May  5 19:28:37
2009
@@ -147,42 +147,42 @@
 			}
 		}
 
-        [Test]
-        public void TestSyncReceiveConsumerClose()
-        {
-            // Launch a thread to perform IMessageConsumer.Receive().
-            // If it doesn't fail in less than three seconds, no exception was thrown.
-            Thread receiveThread = new Thread(new ThreadStart(TimeoutConsumerThreadProc));
-            using (IConnection connection = CreateConnection(TEST_CLIENT_ID))
-            {
-                connection.Start();
-                using (ISession session = connection.CreateSession(AcknowledgementMode.AutoAcknowledge))
-                {
-                    ITemporaryQueue queue = session.CreateTemporaryQueue();
-                    using (this.timeoutConsumer = session.CreateConsumer(queue))
-                    {
-                        receiveThread.Start();
-                        if (receiveThread.Join(3000))
-                        {
-                            Assert.Fail("IMessageConsumer.Receive() returned without blocking.
 Test failed.");
-                        }
-                        else
-                        {
-                            // Kill the thread - otherwise it'll sit in Receive() until a
message arrives.
-                            this.timeoutConsumer.Close();
-                            receiveThread.Join(10000);
-                            if (receiveThread.IsAlive)
-                            {
-                                // Kill the thread - otherwise it'll sit in Receive() until
a message arrives.
-                                receiveThread.Interrupt();
-                                Assert.Fail("IMessageConsumer.Receive() thread is still alive,
close should have killed it.");
-                            }
-                        }
-                    }
-                }
-            }
-        }
+		[Test]
+		public void TestSyncReceiveConsumerClose()
+		{
+			// Launch a thread to perform IMessageConsumer.Receive().
+			// If it doesn't fail in less than three seconds, no exception was thrown.
+			Thread receiveThread = new Thread(new ThreadStart(TimeoutConsumerThreadProc));
+			using (IConnection connection = CreateConnection(TEST_CLIENT_ID))
+			{
+				connection.Start();
+				using (ISession session = connection.CreateSession(AcknowledgementMode.AutoAcknowledge))
+				{
+					ITemporaryQueue queue = session.CreateTemporaryQueue();
+					using (this.timeoutConsumer = session.CreateConsumer(queue))
+					{
+						receiveThread.Start();
+						if (receiveThread.Join(3000))
+						{
+							Assert.Fail("IMessageConsumer.Receive() returned without blocking.  Test failed.");
+						}
+						else
+						{
+							// Kill the thread - otherwise it'll sit in Receive() until a message arrives.
+							this.timeoutConsumer.Close();
+							receiveThread.Join(10000);
+							if (receiveThread.IsAlive)
+							{
+								// Kill the thread - otherwise it'll sit in Receive() until a message arrives.
+								receiveThread.Interrupt();
+								Assert.Fail("IMessageConsumer.Receive() thread is still alive, close should have
killed it.");
+							}
+						}
+					}
+				}
+			}
+		}
 #endif
 
-    }
+	}
 }



Mime
View raw message