2009-07-11 Michael Barker <mike@middlesoft.co.uk>
authorMichael Barker <mike@middlesoft.co.uk>
Mon, 13 Jul 2009 20:59:00 +0000 (20:59 -0000)
committerMichael Barker <mike@middlesoft.co.uk>
Mon, 13 Jul 2009 20:59:00 +0000 (20:59 -0000)
* MessageQueueException.cs: Removed MonoTODO.
* MessageBaseTest.cs: Moved from Mono.Messaging.Test
* MessageEnumeratorTest.cs: Moved from Mono.Messaging.Test
* MessageTest.cs: Used using aliases to prevent namespace clashes.
* AdminTest.cs: Remove unused variables.
* AsyncPeekTest.cs: Remove unused variables.
* AsyncReceiveTest.cs: Remove unused variables.
* MessageFactory.cs: Switched to DateTime.UtcNow.
* RabbitMQMessageQueue.cs: Removed some unecessary references to realm.
* RabbitMQMessagingProvider.cs: Removed some unecessary references to realm.
Changed volatile field to use Interlocked.Increment (++i is not thread safe).
* Mono.Messaging.RabbitMQ_test.dll.sources: Moved MessageEnumeratorTest.cs
and MessageBaseTest.cs from Mono.Messaging.Test.
* MessageBaseTest.cs: Moved to Mono.Messaging.RabbitMQ.Test
* MessageEnumeratorTest.cs: Moved to Mono.Messaging.RabbitMQ.Test
* MessagingProviderLocator.cs:  Removed unessecary fields, made fields
readonly and some formatting changes.
* Mono.Messaging_test.dll.sources:  Moved MessageBaseTest.cs and
MessageEnumeratorTest.cs to Mono.Messaging.RabbitMQ.Test.

svn path=/trunk/mcs/; revision=137816

26 files changed:
1  2 
mcs/class/Makefile
mcs/class/Mono.Messaging.RabbitMQ/Assembly/AssemblyInfo.cs
mcs/class/Mono.Messaging.RabbitMQ/ChangeLog
mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ/ChangeLog
mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ/MessageFactory.cs
mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ/RabbitMQMessageQueue.cs
mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ/RabbitMQMessagingProvider.cs
mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ_test.dll.sources
mcs/class/Mono.Messaging.RabbitMQ/Test/Mono.Messaging.RabbitMQ/AdminTest.cs
mcs/class/Mono.Messaging.RabbitMQ/Test/Mono.Messaging.RabbitMQ/AsyncPeekTest.cs
mcs/class/Mono.Messaging.RabbitMQ/Test/Mono.Messaging.RabbitMQ/AsyncReceiveTest.cs
mcs/class/Mono.Messaging.RabbitMQ/Test/Mono.Messaging.RabbitMQ/BasicMessagingTest.cs
mcs/class/Mono.Messaging.RabbitMQ/Test/Mono.Messaging.RabbitMQ/ChangeLog
mcs/class/Mono.Messaging.RabbitMQ/Test/Mono.Messaging.RabbitMQ/MessageBaseTest.cs
mcs/class/Mono.Messaging.RabbitMQ/Test/Mono.Messaging.RabbitMQ/MessageEnumeratorExceptionTest.cs
mcs/class/Mono.Messaging.RabbitMQ/Test/Mono.Messaging.RabbitMQ/MessageTest.cs
mcs/class/Mono.Messaging.RabbitMQ/Test/Mono.Messaging.RabbitMQ/XmlMessageFormatterTest.cs
mcs/class/Mono.Messaging/ChangeLog
mcs/class/Mono.Messaging/Mono.Messaging/ChangeLog
mcs/class/Mono.Messaging/Mono.Messaging/MessagingProviderLocator.cs
mcs/class/Mono.Messaging/Mono.Messaging_test.dll.sources
mcs/class/Mono.Messaging/Test/Mono.Messaging/ChangeLog
mcs/class/Mono.Messaging/Test/Mono.Messaging/MessageBaseTest.cs
mcs/class/Mono.Messaging/Test/Mono.Messaging/MessageEnumeratorExceptionTest.cs
mcs/class/System.Messaging/System.Messaging/ChangeLog
mcs/class/System.Messaging/System.Messaging/MessageQueueException.cs

index 5bbdc71b6c5fff4d7c8b618f4bf347dbe1266333,7055b6f9ec09041b2d8c997208767490dd38c314..441bae50e7846679b5fbc8957747c1a870f15803
@@@ -77,7 -77,7 +77,6 @@@ common_dirs := 
        RabbitMQ.Client                 \
        Mono.Messaging                  \
        System.Messaging                \
--      Mono.Messaging.RabbitMQ         \
        System.ServiceProcess           \
        System.Drawing.Design           \
        System.Design                   \
@@@ -120,8 -119,8 +119,9 @@@ net_2_0_dirs := 
        Mono.Management                 \
        Mono.Options                    \
        Mono.Simd                       \
--      Mono.Tasklets
 -      
++      Mono.Tasklets       \
++      Mono.Messaging.RabbitMQ
 +
  net_2_0_only_dirs := \
        System.Web.Extensions_1.0       \
        System.Web.Extensions.Design_1.0
index 0cdccf6c4ede5e5265f7ba35931cdcbd350a2324,0cdccf6c4ede5e5265f7ba35931cdcbd350a2324..ed35d9aa8d18bf32aee2fbc61668015e5d7d0c14
@@@ -53,7 -53,7 +53,7 @@@ using System.Runtime.InteropServices
  
  [assembly: ComVisible (false)]
  
--[assembly: CLSCompliant (true)]
++[assembly: CLSCompliant (false)]
  [assembly: AssemblyDelaySign (true)]
  [assembly: AssemblyKeyFile("../msfinal.pub")]
  
index 7812d3ee03d9b68ae6a35bef3fe2943d5354619a,7812d3ee03d9b68ae6a35bef3fe2943d5354619a..76528499b656896bf04b059dead67b5073d67c49
@@@ -1,3 -1,3 +1,8 @@@
++2009-07-11  Michael Barker  <mike@middlesoft.co.uk>
++
++      * Mono.Messaging.RabbitMQ_test.dll.sources: Moved MessageEnumeratorTest.cs
++      and MessageBaseTest.cs from Mono.Messaging.Test.
++
  2009-01-05  Michael Barker  <mike@middlesoft.co.uk>
  
        * Makefile: Added nunit.mocks to test build
index c2caba20d623e3825fb7edb02d74bdab83ccb4f7,c2caba20d623e3825fb7edb02d74bdab83ccb4f7..e9c111dd57c85a594d34b6f3c5c6b19938c79a0e
@@@ -1,3 -1,3 +1,10 @@@
++2009-07-11  Michael Barker  <mike@middlesoft.co.uk>
++
++      * MessageFactory.cs: Switched to DateTime.UtcNow.
++      * RabbitMQMessageQueue.cs: Removed some unecessary references to realm.
++      * RabbitMQMessagingProvider.cs: Removed some unecessary references to realm.
++      Changed volatile field to use Interlocked.Increment (++i is not thread safe).
++
  2009-05-23  Michael Barker  <mike@middlesoft.co.uk>
  
        * MessageFactory.cs: Moved TimeSpanToInt32 method to here.
index cdf57dd7d6ad82e1940eccb552786eb8db71e500,cdf57dd7d6ad82e1940eccb552786eb8db71e500..fa9d44d5f4c58dc015b825573a4f89ab8b4a8079
@@@ -85,7 -85,7 +85,7 @@@ namespace Mono.Messaging.RabbitMQ 
                        if (msg.CorrelationId != null)
                                mb.Properties.CorrelationId = msg.CorrelationId;
                        // TODO: Change to DateTime.UtcNow??
--                      mb.Properties.Timestamp = MessageFactory.DateTimeToAmqpTimestamp (DateTime.Now);
++                      mb.Properties.Timestamp = MessageFactory.DateTimeToAmqpTimestamp (DateTime.UtcNow);
                        Hashtable headers = new Hashtable ();
                        
                        headers[SENDER_VERSION_KEY] = msg.SenderVersion;
index ef2f6461df1c669199bf834a4bb5de7604e6a9c2,ef2f6461df1c669199bf834a4bb5de7604e6a9c2..03069f252ad13439387c841a38f1d57c6566ad6a
@@@ -62,7 -62,7 +62,6 @@@ namespace Mono.Messaging.RabbitMQ 
                private QueueReference qRef = QueueReference.DEFAULT;
                private readonly RabbitMQMessagingProvider provider;
                private readonly MessageFactory helper;
--              private readonly string realm;
                private readonly bool transactional;
                
                public RabbitMQMessageQueue (RabbitMQMessagingProvider provider,
                public RabbitMQMessageQueue (RabbitMQMessagingProvider provider,
                                             QueueReference qRef, 
                                             bool transactional)
--                      : this (provider, "/data", qRef, transactional)
--              {
--              }
--              
--              public RabbitMQMessageQueue (RabbitMQMessagingProvider provider,
--                                           string realm, QueueReference qRef,
--                                           bool transactional)
                {
                        this.provider = provider;
                        this.helper = new MessageFactory (provider);
--                      this.realm = realm;
                        this.qRef = qRef;
                        this.transactional = transactional;
                }
                        // No-op (Queue are currently stateless)
                }
                
--              public static void Delete (string realm, QueueReference qRef)
++              public static void Delete (QueueReference qRef)
                {
                        ConnectionFactory cf = new ConnectionFactory ();
                        
index 45445659d0ee41ab743f4316069a2c4424d5ce26,45445659d0ee41ab743f4316069a2c4424d5ce26..90aaf7101a5bc2fea16a53781416ff040a2eba2e
@@@ -40,9 -40,9 +40,8 @@@ namespace Mono.Messaging.RabbitMQ 
  
        public class RabbitMQMessagingProvider : IMessagingProvider {
                
--              private volatile uint txCounter = 0;
++              private int txCounter = 0;
                private readonly uint localIp;
--              private static readonly string DEFAULT_REALM = "/data";
                
                public RabbitMQMessagingProvider()
                {
                
                public IMessageQueueTransaction CreateMessageQueueTransaction ()
                {
--                      string txId = localIp.ToString () + (++txCounter).ToString (); 
++                      Interlocked.Increment (ref txCounter);
++                      string txId = localIp.ToString () + txCounter.ToString (); 
                        return new RabbitMQMessageQueueTransaction (txId);
                }
                
                public void DeleteQueue (QueueReference qRef)
                {
--                      RabbitMQMessageQueue.Delete (DEFAULT_REALM, qRef);
++                      RabbitMQMessageQueue.Delete (qRef);
                }
                
                private readonly IDictionary queues = new Hashtable ();
index 13e7409ef08c029014f11be5e9c28960b0eb2040,13e7409ef08c029014f11be5e9c28960b0eb2040..3ba70c17b486f8ccd501dfecbb6b8bcefeeb5748
@@@ -12,4 -12,4 +12,6 @@@ Mono.Messaging.RabbitMQ/AsyncPeekTest.c
  Mono.Messaging.RabbitMQ/BinaryMessageFormatterTest.cs
  Mono.Messaging.RabbitMQ/XmlMessageFormatterTest.cs
  Mono.Messaging.RabbitMQ/TestUtils.cs
--Mono.Messaging.RabbitMQ/MessageTest.cs
++Mono.Messaging.RabbitMQ/MessageTest.cs
++Mono.Messaging.RabbitMQ/MessageBaseTest.cs
++Mono.Messaging.RabbitMQ/MessageEnumeratorExceptionTest.cs
index 612f401988de7df3259e765ba536cf04b916b236,612f401988de7df3259e765ba536cf04b916b236..954cdf4bb86e971c08afb57e3d4bfe2d6026223e
@@@ -109,7 -109,7 +109,7 @@@ namespace MonoTests.Mono.Messaging.Rabb
                        q.Send (m3);
                        q.Send (m4);
                        
--                      Message received = q.Receive ();                        
++                      q.Receive ();                   
                        q.Purge ();
                        q.Receive (new TimeSpan (0, 0, 2));
                }
                        
                        q.Send (m1);
                        
--                      Message received = q.Receive ();
++                      q.Receive ();
  
                        MessageQueue.Delete(@".\private$\delete-queue");
                }
index 9663aa63ef713ba420b3a65e4a60fb8e4d2cae69,9663aa63ef713ba420b3a65e4a60fb8e4d2cae69..ae4b2d868516a63c2a0f5f57e8aa41d6377b7359
@@@ -134,7 -134,7 +134,7 @@@ namespace MonoTests.Mono.Messaging.Rabb
                        MessageQueue q = MQUtil.GetQueue (@".\private$\async-peek-5");
                        IAsyncResult result = q.BeginPeek (new TimeSpan (0, 0, 2));
                        result.AsyncWaitHandle.WaitOne ();
--                      Message rMsg = q.EndPeek (result);
++                      q.EndPeek (result);
                }               
        }
  }
index e7febea3c2a6ac5264e90316be1213df9189cff7,e7febea3c2a6ac5264e90316be1213df9189cff7..1027a7e47f260c5e7db222d3d5ea5e47ea0ad485
@@@ -134,7 -134,7 +134,7 @@@ namespace MonoTests.Mono.Messaging.Rabb
                        MessageQueue q = MQUtil.GetQueue (@".\private$\async-peek-5");
                        IAsyncResult result = q.BeginReceive (new TimeSpan (0, 0, 2));
                        result.AsyncWaitHandle.WaitOne ();
--                      Message rMsg = q.EndReceive (result);
++                      q.EndReceive (result);
                }               
        }
  }
index 57e02307c4157b903a3caa7a235d7a958af91c9e,57e02307c4157b903a3caa7a235d7a958af91c9e..3d2e3805baad853da4d486c94731ed0c62f27826
@@@ -118,7 -118,7 +118,7 @@@ namespace MonoTests.Mono.Messaging.Rabb
                                Assert.IsNotNull (pi, "Property not defined: " + property);
                                object o = pi.GetValue (m, null);
                                Assert.Fail (property + ": " + o);
--                      } catch (InvalidOperationException e) {
++                      } catch (InvalidOperationException) {
                        } catch (TargetInvocationException e) {
                                Assert.AreEqual (typeof (InvalidOperationException), 
                                                 e.InnerException.GetType ());
                                Assert.IsNotNull(pi, "Property not defined: " + property);
                                pi.SetValue(m, null, null);
                                Assert.Fail(property);
--                      } catch (InvalidOperationException e) {
++                      } catch (InvalidOperationException) {
                        } catch (TargetInvocationException e) {
                                Assert.AreEqual(exceptionType,
                                                e.InnerException.GetType(),
index 8de774bbb81de120f9f803958b1545ddc69805a5,8de774bbb81de120f9f803958b1545ddc69805a5..90a48b0e0e8636d0bb0b70c5f19f300c7f531598
@@@ -1,3 -1,3 +1,12 @@@
++2009-07-11  Michael Barker  <mike@middlesoft.co.uk>
++
++      * MessageBaseTest.cs: Moved from Mono.Messaging.Test
++      * MessageEnumeratorTest.cs: Moved from Mono.Messaging.Test
++      * MessageTest.cs: Used using aliases to prevent namespace clashes.
++      * AdminTest.cs: Remove unused variables.
++      * AsyncPeekTest.cs: Remove unused variables.
++      * AsyncReceiveTest.cs: Remove unused variables.
++      
  2009-05-23  Michael Barker  <mike@middlesoft.co.uk>
  
        * MessageEnumeratorTest.cs:  Added tests for timeout methods.
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..868448d88f1ea4d0d8489ac28c835ac05a772f1b
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,119 @@@
++//
++// Mono.Messaging.RabbitMQ
++//
++// Authors:
++//      Michael Barker (mike@middlesoft.co.uk)
++//
++// (C) 2008 Michael Barker
++//
++
++//
++// Permission is hereby granted, free of charge, to any person obtaining
++// a copy of this software and associated documentation files (the
++// "Software"), to deal in the Software without restriction, including
++// without limitation the rights to use, copy, modify, merge, publish,
++// distribute, sublicense, and/or sell copies of the Software, and to
++// permit persons to whom the Software is furnished to do so, subject to
++// the following conditions:
++// 
++// The above copyright notice and this permission notice shall be
++// included in all copies or substantial portions of the Software.
++// 
++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++//
++
++using System;
++using System.Messaging;
++using System.Reflection;
++using Mono.Messaging;
++
++using SystemAcknowledgeTypes = System.Messaging.AcknowledgeTypes;
++using SystemCryptographicProviderType = System.Messaging.CryptographicProviderType;
++using SystemEncryptionAlgorithm = System.Messaging.EncryptionAlgorithm;
++using SystemHashAlgorithm = System.Messaging.HashAlgorithm;
++using SystemMessagePriority = System.Messaging.MessagePriority;
++
++using NUnit.Framework;
++
++namespace MonoTests.Mono.Messaging {
++
++      [TestFixture]
++      public class MessageBaseTest {
++              
++              [Test]
++              public void CheckDefaultValues ()
++              {
++            Type[] types = { 
++                typeof (IMessage), typeof (object), typeof (IMessageFormatter)
++            };
++                
++            ConstructorInfo ci = typeof (Message).GetConstructor (
++                BindingFlags.NonPublic | BindingFlags.Instance, 
++                Type.DefaultBinder, types, new ParameterModifier[0]);
++                
++            if (ci == null)
++                throw new Exception ("ConstructorInfo is null");
++            
++            Message m = (Message) ci.Invoke (new object[] { new MessageBase (), null, null });
++                      
++                      Assert.IsNull (m.Body, "Body default should be Null");
++                      Assert.IsNull (m.Formatter, "Formatter default should null");
++                      
++                      Assert.AreEqual (SystemAcknowledgeTypes.None, 
++                                      m.AcknowledgeType, 
++                                      "AcknowledgeType default should be None");
++                      Assert.AreEqual (null, m.AdministrationQueue, 
++                                      "AdministrationQueue default should be null");
++                      Assert.AreEqual (0, m.AppSpecific, "AppSpecific default should be 0");
++                      Assert.AreEqual (true, m.AttachSenderId, "AttachSenderId default should be true");
++                      Assert.AreEqual ("Microsoft Base Cryptographic Provider, Ver. 1.0", m.AuthenticationProviderName, 
++                                      "AuthenticationProviderName should default to \"Microsoft Base Cryptographic Provider, Ver. 1.0\"");
++                      Assert.AreEqual (SystemCryptographicProviderType.RsaFull, 
++                                      m.AuthenticationProviderType, 
++                                      "AuthenticationProviderType should default to RsaFull");
++                      Assert.AreEqual (null, m.BodyStream, "BodyStream should default to null");
++                      Assert.AreEqual (Guid.Empty, m.ConnectorType, "ConnectorType should default to empty");
++                      Assert.AreEqual (null, m.CorrelationId, "CorrelationId should default to null");
++                      Assert.AreEqual (new byte[0], m.DestinationSymmetricKey, 
++                                      "DestinationSymmetricKey should default to an empty array");
++                      Assert.AreEqual (new byte[0], m.DigitalSignature,
++                                      "DigitalSignature default to an empty array");
++                      Assert.AreEqual (SystemEncryptionAlgorithm.Rc2,
++                                      m.EncryptionAlgorithm,
++                                      "EncryptionAlgorithm should default to Rc2");
++                      Assert.AreEqual (new byte[0], m.Extension, 
++                                      "Extension should default to an empty array");
++                      Assert.AreEqual (SystemHashAlgorithm.Sha, m.HashAlgorithm, 
++                                      "HashAlgorithm should default to Sha");
++                      Assert.AreEqual (Guid.Empty.ToString () + "\\0", m.Id, "Id should default to Guid.Empty");
++                      Assert.AreEqual ("", m.Label, "Label should default to \"\"");
++                      Assert.AreEqual (false, m.IsFirstInTransaction, "IsFirstInTransaction should default to false");
++                      Assert.AreEqual (false, m.IsLastInTransaction, "IsLastInTransaction should default to false");
++                      Assert.AreEqual (SystemMessagePriority.Normal, m.Priority,
++                                      "Priority should default to Normal");
++                      Assert.AreEqual (false, m.Recoverable, "Recoverable should default to false");
++                      Assert.AreEqual (null, m.ResponseQueue, "ResponseQueue should default to null");
++                      //Assert.AreEqual (null, m.SecurityContext, "SecurityContext should default to null");
++                      Assert.AreEqual (new byte[0], m.SenderCertificate, 
++                                      "SenderCertificate should default to an empty array");
++                      Assert.AreEqual (Message.InfiniteTimeout, m.TimeToBeReceived,
++                                      "TimeToBeReceived should default to InfiniteTimeout");
++                      Assert.AreEqual (Message.InfiniteTimeout, m.TimeToReachQueue,
++                                      "TimeToReadQueue should default to InfiniteTimeout");
++                      Assert.AreEqual (false, m.UseAuthentication, 
++                                      "UseAuthentication should default to false");
++                      Assert.AreEqual (false, m.UseDeadLetterQueue,
++                                      "UseDeadLetterQueue should default to false");
++                      Assert.AreEqual (false, m.UseEncryption, "Encryption should default to false");
++                      Assert.AreEqual (false, m.UseJournalQueue, 
++                                      "UseJournalQueue should default to false");
++                      Assert.AreEqual (false, m.UseTracing, "UseTracing should default to false");
++              }
++      }
++}
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..c3507ed1865ec2539adce30f5d53920f0fcaf569
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,109 @@@
++//\r
++// MessageEnumeratorTest.cs -\r
++//    NUnit Test Cases for MessageEnumerator\r
++//\r
++// Author:\r
++//    Michael Barker  <mike@middlesoft.co.uk>\r
++//\r
++// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)\r
++//\r
++// Permission is hereby granted, free of charge, to any person obtaining\r
++// a copy of this software and associated documentation files (the\r
++// "Software"), to deal in the Software without restriction, including\r
++// without limitation the rights to use, copy, modify, merge, publish,\r
++// distribute, sublicense, and/or sell copies of the Software, and to\r
++// permit persons to whom the Software is furnished to do so, subject to\r
++// the following conditions:\r
++// \r
++// The above copyright notice and this permission notice shall be\r
++// included in all copies or substantial portions of the Software.\r
++// \r
++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
++// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
++// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
++// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
++// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
++// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
++// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
++//\r
++using System;\r
++using System.Security;\r
++using System.Security.Permissions;
++using System.Reflection;
++
++using Mono.Messaging;
++
++using SystemMessageEnumerator = System.Messaging.MessageEnumerator;
++using SystemMessageQueueException = System.Messaging.MessageQueueException;
++using SystemIMessageFormatter = System.Messaging.IMessageFormatter;
++
++using NUnit.Framework;
++using NUnit.Mocks;\r
++\r
++\r
++namespace MonoTests.Mono.Messaging {\r
++      
++      [TestFixture]\r
++      public class MessageEnumeratorExceptionTest
++      {
++              private DynamicMock mockME;
++              
++              [SetUp]
++              public void Init ()
++              {
++                      mockME = new DynamicMock (typeof (IMessageEnumerator));
++              }
++
++              [Test]
++              [ExpectedException(typeof(SystemMessageQueueException))]
++              public void RemoveCurrentThrowsConnectionException ()
++              {
++                      mockME.ExpectAndThrow ("RemoveCurrent", new ConnectionException (QueueReference.DEFAULT), null);
++                      SystemMessageEnumerator me = CreateEnumerator ((IMessageEnumerator) mockME.MockInstance);
++                      me.RemoveCurrent ();
++              }
++              
++              [Test]
++              [ExpectedException(typeof(InvalidOperationException))]
++              public void RemoveCurrentThrowsMessageUnavailableException ()
++              {
++                      mockME.ExpectAndThrow ("RemoveCurrent", new MessageUnavailableException (), null);
++                      SystemMessageEnumerator me = CreateEnumerator ((IMessageEnumerator) mockME.MockInstance);
++                      me.RemoveCurrent ();
++              }               
++              
++              [Test]
++              [ExpectedException(typeof(SystemMessageQueueException))]
++              public void RemoveCurrentThrowsMonoMessagingException ()
++              {
++                      mockME.ExpectAndThrow ("RemoveCurrent", new MonoMessagingException (), null);
++                      SystemMessageEnumerator me = CreateEnumerator ((IMessageEnumerator) mockME.MockInstance);
++                      me.RemoveCurrent ();
++              }               
++              
++              [Test]
++              [ExpectedException(typeof(NotImplementedException))]
++              public void RemoveCurrentThrowsMessageNotImplemented ()
++              {
++                      mockME.ExpectAndThrow ("RemoveCurrent", new NotImplementedException (), null);
++                      SystemMessageEnumerator me = CreateEnumerator ((IMessageEnumerator) mockME.MockInstance);
++                      me.RemoveCurrent ();
++              }               
++      
++              public SystemMessageEnumerator CreateEnumerator (IMessageEnumerator ime)
++              {
++            Type[] types = { 
++                typeof (IMessageEnumerator), typeof (SystemIMessageFormatter)
++            };
++                
++            ConstructorInfo ci = typeof (SystemMessageEnumerator).GetConstructor (
++                BindingFlags.NonPublic | BindingFlags.Instance, 
++                Type.DefaultBinder, types, new ParameterModifier[0]);
++                
++            if (ci == null)
++                throw new Exception ("ConstructorInfo is null");
++            
++            return (SystemMessageEnumerator) ci.Invoke (new object[] { ime, null });
++              }
++      }
++}
index f0407173f96e8dfcb175ae9ac92e802457fec619,f0407173f96e8dfcb175ae9ac92e802457fec619..40d847a0ee1cd298e6f407614d28b8926814fd7f
  using NUnit.Framework;
  using NUnit.Mocks;
  using System;
--//using System.Messaging;
  using System.Security;
  using System.Security.Permissions;
  using System.Reflection;
++using SystemMessage = System.Messaging.Message;
++using SystemAcknowledgeTypes = System.Messaging.AcknowledgeTypes;
  
  using Mono.Messaging;
  
@@@ -58,8 -58,8 +59,8 @@@ namespace MonoTests.Mono.Messaging.Rabb
              messageMock.Expect ("set_AcknowledgeType", 
                  AcknowledgeTypes.FullReachQueue);
                  
--            System.Messaging.Message m = TestUtils.CreateMessage (iMessage);
--            m.AcknowledgeType = System.Messaging.AcknowledgeTypes.FullReachQueue;
++            SystemMessage m = TestUtils.CreateMessage (iMessage);
++            m.AcknowledgeType = SystemAcknowledgeTypes.FullReachQueue;
              
              messageMock.Verify ();
          }
index 7d65e557120f75ca33aae992f27718d6af78a9a8,7d65e557120f75ca33aae992f27718d6af78a9a8..8b6b49a961723fd59cd0c7f8a7251cf16459841f
@@@ -119,7 -119,7 +119,7 @@@ namespace MonoTests.Mono.Messaging.Rabb
              
              Assert.AreEqual (t0.Iii, t1.Iii, "The int did not serialise/deserialise properly");
              Assert.AreEqual (t0.Sss, t1.Sss, "The string did not serialise/deserialise properly");
--            Assert.AreEqual (t0.Ttt, t1.Ttt, "The date did not serialise/deserialise properly");
++            Assert.AreEqual (t0.Ttt.ToString (), t1.Ttt.ToString (), "The date did not serialise/deserialise properly");
                        
                        mock1.Verify ();
                        mock2.Verify ();
index 9cfd069df5f1ad3e266a295babf2e8897253284b,9cfd069df5f1ad3e266a295babf2e8897253284b..3e0f8ab586f42dc94aa19c593ef95d20b79af809
@@@ -1,3 -1,3 +1,8 @@@
++2009-06-11  Michael Barker  <mike@middlesoft.co.uk>
++
++      * Mono.Messaging_test.dll.sources:  Moved MessageBaseTest.cs and
++      MessageEnumeratorTest.cs to Mono.Messaging.RabbitMQ.Test.
++
  2009-05-23  Michael Barker  <mike@middlesoft.co.uk>
  
        * Mono.Messaging_test.dll.sources:  Added MessageEnumeratorExceptionTest.cs
index 38bd62f9ae2f17a0c4718674119a59c3498a2a4c,38bd62f9ae2f17a0c4718674119a59c3498a2a4c..d10ef8bab69605713ea414532ac2e39b5dc84d00
@@@ -1,3 -1,3 +1,8 @@@
++2009-07-11  Michael Barker  <mike@middlesoft.co.uk>
++
++      * MessagingProviderLocator.cs:  Removed unessecary fields, made fields
++      readonly and some formatting changes.
++
  2009-05-23  Michael Barker  <mike@middlesoft.co.uk>
  
        * IMessageEnumerator.cs:  Added additional methods to support operations
index f1ced06174f13b874e299e0d0e6c3688c6c4deba,f1ced06174f13b874e299e0d0e6c3688c6c4deba..e6f65da5388ebacc799074f5056a61863d7e35d3
@@@ -43,10 -43,10 +43,9 @@@ namespace Mono.Messagin
        public class MessagingProviderLocator 
        {
                public static readonly TimeSpan InfiniteTimeout = TimeSpan.MaxValue;
++              private static readonly MessagingProviderLocator instance = new MessagingProviderLocator();             
++              private readonly IMessagingProvider provider;
                
--              private static MessagingProviderLocator instance = new MessagingProviderLocator();              
--              private readonly object syncObj = new object();
--              private IMessagingProvider provider = null;
                
                private MessagingProviderLocator () {
                        string providerName = System.Environment.GetEnvironmentVariable("MONO_MESSAGING_PROVIDER");
@@@ -55,7 -55,7 +54,9 @@@
                        provider = CreateProvider (providerName);
                }
                
--              public static MessagingProviderLocator Instance { get { return instance; } }
++              public static MessagingProviderLocator Instance { 
++                      get { return instance; }
++              }
                
                public static IMessagingProvider GetProvider ()
                {
@@@ -68,8 -68,8 +69,7 @@@
                        if (t == null)
                                throw new Exception ("Can't find class: " + className);
                        
--                      ConstructorInfo ci = t.GetConstructor (BindingFlags.Public | 
--                                                             BindingFlags.Instance,
++                      ConstructorInfo ci = t.GetConstructor (BindingFlags.Public | BindingFlags.Instance,
                                                               Type.DefaultBinder,
                                                               new Type[0],
                                                               new ParameterModifier[0]);
index d5bfcb3a87e3be97f34071e2aa7b47415906d5f0,d5bfcb3a87e3be97f34071e2aa7b47415906d5f0..8c82b8604c48e969d45b594f9d597ea3ac828dfb
@@@ -1,3 -1,3 +1,1 @@@
--Mono.Messaging/MessageBaseTest.cs
--Mono.Messaging/MessageEnumeratorExceptionTest.cs
--Mono.Messaging/QueueReferenceTest.cs
++Mono.Messaging/QueueReferenceTest.cs
index 76e40f0761bb25bd42e3a8e9e89fbd04c06f058c,76e40f0761bb25bd42e3a8e9e89fbd04c06f058c..888dec2e4f3ee2b04e1df53cbdc06e03cf7079a3
@@@ -1,3 -1,3 +1,8 @@@
++2009-06-11  Michael Barker  <mike@middlesoft.co.uk>
++
++      * MessageBaseTest.cs: Moved to Mono.Messaging.RabbitMQ.Test
++      * MessageEnumeratorTest.cs: Moved to Mono.Messaging.RabbitMQ.Test
++      
  2009-05-23  Michael Barker  <mike@middlesoft.co.uk>
  
        * MessageEnumeratorExceptionTest.cs:  New
diff --cc mcs/class/Mono.Messaging/Test/Mono.Messaging/MessageBaseTest.cs
index 52a4704723609bc0bb1a2d6ef4248e811b4ace27,52a4704723609bc0bb1a2d6ef4248e811b4ace27..0000000000000000000000000000000000000000
deleted file mode 100644,100644
+++ /dev/null
@@@ -1,113 -1,113 +1,0 @@@
--//
--// Mono.Messaging.RabbitMQ
--//
--// Authors:
--//      Michael Barker (mike@middlesoft.co.uk)
--//
--// (C) 2008 Michael Barker
--//
--
--//
--// Permission is hereby granted, free of charge, to any person obtaining
--// a copy of this software and associated documentation files (the
--// "Software"), to deal in the Software without restriction, including
--// without limitation the rights to use, copy, modify, merge, publish,
--// distribute, sublicense, and/or sell copies of the Software, and to
--// permit persons to whom the Software is furnished to do so, subject to
--// the following conditions:
--// 
--// The above copyright notice and this permission notice shall be
--// included in all copies or substantial portions of the Software.
--// 
--// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
--// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
--// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
--// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
--// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
--// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
--// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--//
--
--using System;
--using System.Messaging;
--using System.Reflection;
--using Mono.Messaging;
--
--using NUnit.Framework;
--
--namespace MonoTests.Mono.Messaging {
--
--      [TestFixture]
--      public class MessageBaseTest {
--              
--              [Test]
--              public void CheckDefaultValues ()
--              {
--            Type[] types = { 
--                typeof (IMessage), typeof (object), typeof (IMessageFormatter)
--            };
--                
--            ConstructorInfo ci = typeof (Message).GetConstructor (
--                BindingFlags.NonPublic | BindingFlags.Instance, 
--                Type.DefaultBinder, types, new ParameterModifier[0]);
--                
--            if (ci == null)
--                throw new Exception ("ConstructorInfo is null");
--            
--            Message m = (Message) ci.Invoke (new object[] { new MessageBase (), null, null });
--                      
--                      Assert.IsNull (m.Body, "Body default should be Null");
--                      Assert.IsNull (m.Formatter, "Formatter default should null");
--                      
--                      Assert.AreEqual (System.Messaging.AcknowledgeTypes.None, 
--                                      m.AcknowledgeType, 
--                                      "AcknowledgeType default should be None");
--                      Assert.AreEqual (null, m.AdministrationQueue, 
--                                      "AdministrationQueue default should be null");
--                      Assert.AreEqual (0, m.AppSpecific, "AppSpecific default should be 0");
--                      Assert.AreEqual (true, m.AttachSenderId, "AttachSenderId default should be true");
--                      Assert.AreEqual ("Microsoft Base Cryptographic Provider, Ver. 1.0", m.AuthenticationProviderName, 
--                                      "AuthenticationProviderName should default to \"Microsoft Base Cryptographic Provider, Ver. 1.0\"");
--                      Assert.AreEqual (System.Messaging.CryptographicProviderType.RsaFull, 
--                                      m.AuthenticationProviderType, 
--                                      "AuthenticationProviderType should default to RsaFull");
--                      Assert.AreEqual (null, m.BodyStream, "BodyStream should default to null");
--                      Assert.AreEqual (Guid.Empty, m.ConnectorType, "ConnectorType should default to empty");
--                      Assert.AreEqual (null, m.CorrelationId, "CorrelationId should default to null");
--                      Assert.AreEqual (new byte[0], m.DestinationSymmetricKey, 
--                                      "DestinationSymmetricKey should default to an empty array");
--                      Assert.AreEqual (new byte[0], m.DigitalSignature,
--                                      "DigitalSignature default to an empty array");
--                      Assert.AreEqual (System.Messaging.EncryptionAlgorithm.Rc2,
--                                      m.EncryptionAlgorithm,
--                                      "EncryptionAlgorithm should default to Rc2");
--                      Assert.AreEqual (new byte[0], m.Extension, 
--                                      "Extension should default to an empty array");
--                      Assert.AreEqual (System.Messaging.HashAlgorithm.Sha, m.HashAlgorithm, 
--                                      "HashAlgorithm should default to Sha");
--                      Assert.AreEqual (Guid.Empty.ToString () + "\\0", m.Id, "Id should default to Guid.Empty");
--                      Assert.AreEqual ("", m.Label, "Label should default to \"\"");
--                      Assert.AreEqual (false, m.IsFirstInTransaction, "IsFirstInTransaction should default to false");
--                      Assert.AreEqual (false, m.IsLastInTransaction, "IsLastInTransaction should default to false");
--                      Assert.AreEqual (System.Messaging.MessagePriority.Normal, m.Priority,
--                                      "Priority should default to Normal");
--                      Assert.AreEqual (false, m.Recoverable, "Recoverable should default to false");
--                      Assert.AreEqual (null, m.ResponseQueue, "ResponseQueue should default to null");
--                      //Assert.AreEqual (null, m.SecurityContext, "SecurityContext should default to null");
--                      Assert.AreEqual (new byte[0], m.SenderCertificate, 
--                                      "SenderCertificate should default to an empty array");
--                      Assert.AreEqual (Message.InfiniteTimeout, m.TimeToBeReceived,
--                                      "TimeToBeReceived should default to InfiniteTimeout");
--                      Assert.AreEqual (Message.InfiniteTimeout, m.TimeToReachQueue,
--                                      "TimeToReadQueue should default to InfiniteTimeout");
--                      Assert.AreEqual (false, m.UseAuthentication, 
--                                      "UseAuthentication should default to false");
--                      Assert.AreEqual (false, m.UseDeadLetterQueue,
--                                      "UseDeadLetterQueue should default to false");
--                      Assert.AreEqual (false, m.UseEncryption, "Encryption should default to false");
--                      Assert.AreEqual (false, m.UseJournalQueue, 
--                                      "UseJournalQueue should default to false");
--                      Assert.AreEqual (false, m.UseTracing, "UseTracing should default to false");
--              }
--      }
--}
diff --cc mcs/class/Mono.Messaging/Test/Mono.Messaging/MessageEnumeratorExceptionTest.cs
index 36edde5d52e933a5e1041c5e4e9f505d3c69bbf3,36edde5d52e933a5e1041c5e4e9f505d3c69bbf3..0000000000000000000000000000000000000000
deleted file mode 100644,100644
+++ /dev/null
@@@ -1,105 -1,105 +1,0 @@@
--//\r
--// MessageEnumeratorTest.cs -\r
--//    NUnit Test Cases for MessageEnumerator\r
--//\r
--// Author:\r
--//    Michael Barker  <mike@middlesoft.co.uk>\r
--//\r
--// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)\r
--//\r
--// Permission is hereby granted, free of charge, to any person obtaining\r
--// a copy of this software and associated documentation files (the\r
--// "Software"), to deal in the Software without restriction, including\r
--// without limitation the rights to use, copy, modify, merge, publish,\r
--// distribute, sublicense, and/or sell copies of the Software, and to\r
--// permit persons to whom the Software is furnished to do so, subject to\r
--// the following conditions:\r
--// \r
--// The above copyright notice and this permission notice shall be\r
--// included in all copies or substantial portions of the Software.\r
--// \r
--// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
--// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
--// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
--// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
--// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
--// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
--// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
--//\r
--using System;\r
--using System.Security;\r
--using System.Security.Permissions;
--using System.Reflection;
--
--using Mono.Messaging;
--
--using NUnit.Framework;
--using NUnit.Mocks;\r
--\r
--\r
--namespace MonoTests.Mono.Messaging {\r
--      
--      [TestFixture]\r
--      public class MessageEnumeratorExceptionTest
--      {
--              private DynamicMock mockME;
--              
--              [SetUp]
--              public void Init ()
--              {
--                      mockME = new DynamicMock (typeof (IMessageEnumerator));
--              }
--
--              [Test]
--              [ExpectedException("System.Messaging.MessageQueueException")]
--              public void RemoveCurrentThrowsConnectionException ()
--              {
--                      mockME.ExpectAndThrow ("RemoveCurrent", new ConnectionException (QueueReference.DEFAULT), null);
--                      System.Messaging.MessageEnumerator me = CreateEnumerator ((IMessageEnumerator) mockME.MockInstance);
--                      me.RemoveCurrent ();
--              }
--              
--              [Test]
--              [ExpectedException("System.InvalidOperationException")]
--              public void RemoveCurrentThrowsMessageUnavailableException ()
--              {
--                      mockME.ExpectAndThrow ("RemoveCurrent", new MessageUnavailableException (), null);
--                      System.Messaging.MessageEnumerator me = CreateEnumerator ((IMessageEnumerator) mockME.MockInstance);
--                      me.RemoveCurrent ();
--              }               
--              
--              [Test]
--              [ExpectedException("System.Messaging.MessageQueueException")]
--              public void RemoveCurrentThrowsMonoMessagingException ()
--              {
--                      mockME.ExpectAndThrow ("RemoveCurrent", new MonoMessagingException (), null);
--                      System.Messaging.MessageEnumerator me = CreateEnumerator ((IMessageEnumerator) mockME.MockInstance);
--                      me.RemoveCurrent ();
--              }               
--              
--              [Test]
--              [ExpectedException("System.NotImplementedException")]
--              public void RemoveCurrentThrowsMessageNotImplemented ()
--              {
--                      mockME.ExpectAndThrow ("RemoveCurrent", new NotImplementedException (), null);
--                      System.Messaging.MessageEnumerator me = CreateEnumerator ((IMessageEnumerator) mockME.MockInstance);
--                      me.RemoveCurrent ();
--              }               
--      
--              public System.Messaging.MessageEnumerator CreateEnumerator (IMessageEnumerator ime)
--              {
--            Type[] types = { 
--                typeof (IMessageEnumerator), typeof (System.Messaging.IMessageFormatter)
--            };
--                
--            ConstructorInfo ci = typeof (System.Messaging.MessageEnumerator).GetConstructor (
--                BindingFlags.NonPublic | BindingFlags.Instance, 
--                Type.DefaultBinder, types, new ParameterModifier[0]);
--                
--            if (ci == null)
--                throw new Exception ("ConstructorInfo is null");
--            
--            return (System.Messaging.MessageEnumerator) ci.Invoke (new object[] { ime, null });
--              }
--      }
--}
index 4b2c8833b0810ce438472d0fa4006fddedfebafa,4b2c8833b0810ce438472d0fa4006fddedfebafa..e5fcc897f0cca6d05b2147ee77a8ac2bdfbf18b5
@@@ -1,3 -1,3 +1,7 @@@
++2009-07-11  Michael Barker  <mike@middlesoft.co.uk>
++
++      * MessageQueueException.cs: Removed MonoTODO.
++
  2009-05-23  Michael Barker  <mike@middlesoft.co.uk>
  
        * MessageEnumerator.cs:  Added calls to the delegate IMessageEnumerator
index 4621760d09a44a31aef55f6dd0e085ab54bc7ec7,4621760d09a44a31aef55f6dd0e085ab54bc7ec7..b9a6452ed92c749060f04834e8d7c33727893e51
@@@ -63,7 -63,7 +63,6 @@@ namespace System.Messagin
                        return "UnknownError";
                }
  
--              [MonoTODO]
                public override string Message 
                {
                        get { return base.Message; }