activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r451036 [1/3] - in /incubator/activemq/activemq-dotnet/trunk: ./ src/main/csharp/ src/main/csharp/ActiveMQ/Commands/ src/main/csharp/ActiveMQ/OpenWire/ src/main/csharp/ActiveMQ/Transport/ src/main/csharp/JMS/ src/main/csharp/MSMQ/ src/main/...
Date Thu, 28 Sep 2006 22:01:07 GMT
Author: chirino
Date: Thu Sep 28 15:01:04 2006
New Revision: 451036

URL: http://svn.apache.org/viewvc?view=rev&rev=451036
Log:
- Added the start of a NMS implementation for MSMQ
- Added a bunch of vs2005-*.csproj files so that VS 2005 can build NMS in a nice modular way.  It produces 6 dlls (nms, activemq, msqm, and test dlls for each of those).  Prefixed with vs2005 so that we can maintain project files of other version of visual studio or ide tools
- Abstracted the bas NMS tests so that they don't have a dependency on the ActiveMQ module
- Cleaned up remenants of JMS references
- Updated the README so folks know how to build using the vs 2005 project files
- Fixed some wirefomat issues... NMS for now will need to stay using the v1 wirefomat until it can implement dynamic wireformat switching


Added:
    incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/
    incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/BaseMessage.cs
    incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/BytesMessage.cs
    incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/Connection.cs
    incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/ConnectionFactory.cs
    incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/Destination.cs
    incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/MapMessage.cs
    incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/MessageConsumer.cs
    incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/MessageProducer.cs
    incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/ObjectMessage.cs
    incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/PrimitiveMap.cs
    incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/Queue.cs
    incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/Session.cs
    incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/StreamMessage.cs
    incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/TextMessage.cs
    incubator/activemq/activemq-dotnet/trunk/src/main/csharp/NMS/NMSSecurityException.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/BadConsumeTest.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/BytesMessageTest.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/ConsumerTest.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/DurableTest.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/JMSPropertyTest.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/MapMessageTest.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/TemporaryQueueTest.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/TextMessage.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/TransactionTest.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/MSMQ/
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/MSMQ/MSMQTest.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/MSMQ/ProducerTest.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/NMS/Test/
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/NMS/Test/AsyncConsumeTest.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/NMS/Test/BadConsumeTest.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/NMS/Test/BytesMessageTest.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/NMS/Test/ConsumerTest.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/NMS/Test/DurableTest.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/NMS/Test/JMSPropertyTest.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/NMS/Test/MapMessageTest.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/NMS/Test/MessageTest.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/NMS/Test/NMSTestSupport.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/NMS/Test/TemporaryQueueTest.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/NMS/Test/TextMessage.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/NMS/Test/TransactionTest.cs
    incubator/activemq/activemq-dotnet/trunk/vs2005-activemq-test.csproj
    incubator/activemq/activemq-dotnet/trunk/vs2005-activemq.csproj
    incubator/activemq/activemq-dotnet/trunk/vs2005-msmq-test.csproj
    incubator/activemq/activemq-dotnet/trunk/vs2005-msmq.csproj
    incubator/activemq/activemq-dotnet/trunk/vs2005-nms-test.csproj
    incubator/activemq/activemq-dotnet/trunk/vs2005-nms.csproj
    incubator/activemq/activemq-dotnet/trunk/vs2005.sln
Removed:
    incubator/activemq/activemq-dotnet/trunk/src/main/csharp/JMS/
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/JMS/
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/NMS/AsyncConsumeTest.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/NMS/BadConsumeTest.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/NMS/BytesMessageTest.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/NMS/ConsumerTest.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/NMS/DurableTest.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/NMS/JMSPropertyTest.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/NMS/JMSTestSupport.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/NMS/MapMessageTest.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/NMS/MessageTest.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/NMS/TemporaryQueueTest.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/NMS/TextMessage.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/NMS/TransactionTest.cs
Modified:
    incubator/activemq/activemq-dotnet/trunk/README.txt
    incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Commands/ActiveMQDestination.cs
    incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Commands/ActiveMQMessage.cs
    incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/OpenWire/MessagePropertyHelper.cs
    incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/OpenWire/OpenWireFormat.cs
    incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Transport/WireFormatNegotiator.cs
    incubator/activemq/activemq-dotnet/trunk/src/main/csharp/CommonAssemblyInfo.cs
    incubator/activemq/activemq-dotnet/trunk/src/main/csharp/NMS/NMSException.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/TestMain.cs
    incubator/activemq/activemq-dotnet/trunk/src/test/csharp/CommonAssemblyInfo.cs

Modified: incubator/activemq/activemq-dotnet/trunk/README.txt
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/README.txt?view=diff&rev=451036&r1=451035&r2=451036
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/README.txt (original)
+++ incubator/activemq/activemq-dotnet/trunk/README.txt Thu Sep 28 15:01:04 2006
@@ -1,10 +1,28 @@
-Welcome to the NMS API and the .Net Client for Apache ActiveMQ
+==============================================================
+Welcome to:
+ * NMS API : The .NET Messaging Service API
+ * NMS Client for Apache ActiveMQ
+ * NMS Client for MSMQ
 ==============================================================
 
 For more information see http://incubator.apache.org/activemq/nms.html
 
+==============================================================
+Building With Visual Stuido 2005
+==============================================================
+
+Open the vs2005.sln Solution File.  Build using "Build"->"Build Solution" menu option.
+
+The resulting DLLs will be in bin\Debug or the bin\Release directories depending on you settings under
+"Build"->"Configuration Manager"
 
+If you have the Resharper plugin installed in Visual Studio, you can run all the Unit Tests by using
+the "ReSharper"->"Unit Testing"->"Run All Tests from Solution" menu option.  Please note that you must
+run an Apache ActiveMQ Broker before kicking off the unit tests.
 
+==============================================================
+Building With NAnt
+==============================================================
 To build the code using NAnt type
 
   nant
@@ -16,6 +34,7 @@
 To generate the documentation type
 
   nant doc
+
   
 Assuming that you have checked out the ActiveMQ code and the Site in peer directories such as
 
@@ -28,5 +47,4 @@
       ndoc/
       
 So that generating the ndoc will copy the generate content into the ndoc directory so it can be deployed on the Apache website.
-
 

Modified: incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Commands/ActiveMQDestination.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Commands/ActiveMQDestination.cs?view=diff&rev=451036&r1=451035&r2=451036
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Commands/ActiveMQDestination.cs (original)
+++ incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Commands/ActiveMQDestination.cs Thu Sep 28 15:01:04 2006
@@ -202,8 +202,6 @@
         
         /**
          * @param destination
-         * @return @throws JMSException
-         * @throws javax.jms.JMSException
          */
         public static ActiveMQDestination Transform(IDestination destination)
         {
@@ -408,7 +406,7 @@
         /**
          * Returns true if this destination represents a collection of
          * destinations; allowing a set of destinations to be published to or subscribed
-         * from in one JMS operation.
+         * from in one NMS operation.
          * <p/>
          * If this destination is a composite then you can call {@link #getChildDestinations()}
          * to return the list of child destinations.

Modified: incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Commands/ActiveMQMessage.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Commands/ActiveMQMessage.cs?view=diff&rev=451036&r1=451035&r2=451036
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Commands/ActiveMQMessage.cs (original)
+++ incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Commands/ActiveMQMessage.cs Thu Sep 28 15:01:04 2006
@@ -80,12 +80,7 @@
             get { return Destination; }
             set { this.Destination = ActiveMQDestination.Transform(value); }
         }
-        
-        
-        // IMessage interface
-        
-        // JMS headers
-        
+                               
         /// <summary>
         /// The correlation ID used to correlate messages with conversations or long running business processes
         /// </summary>
@@ -207,12 +202,12 @@
         }
         
         
-        // JMS Extension headers
+        // NMS Extension headers
         
         /// <summary>
         /// Returns the number of times this message has been redelivered to other consumers without being acknowledged successfully.
         /// </summary>
-        public int JMSXDeliveryCount
+        public int NMSXDeliveryCount
         {
             get {
                 return RedeliveryCounter + 1;
@@ -223,7 +218,7 @@
         /// <summary>
         /// The Message Group ID used to group messages together to the same consumer for the same group ID value
         /// </summary>
-        public string JMSXGroupID
+        public string NMSXGroupID
         {
             get {
                 return GroupID;
@@ -235,7 +230,7 @@
         /// <summary>
         /// The Message Group Sequence counter to indicate the position in a group
         /// </summary>
-        public int JMSXGroupSeq
+        public int NMSXGroupSeq
         {
             get {
                 return GroupSequence;
@@ -248,7 +243,7 @@
         /// <summary>
         /// Returns the ID of the producers transaction
         /// </summary>
-        public string JMSXProducerTXID
+        public string NMSXProducerTXID
         {
             get {
                 TransactionId txnId = OriginalTransactionId;

Modified: incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/OpenWire/MessagePropertyHelper.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/OpenWire/MessagePropertyHelper.cs?view=diff&rev=451036&r1=451035&r2=451036
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/OpenWire/MessagePropertyHelper.cs (original)
+++ incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/OpenWire/MessagePropertyHelper.cs Thu Sep 28 15:01:04 2006
@@ -29,7 +29,7 @@
         
         public MessagePropertyHelper()
         {
-            // TODO find all of the JMS properties via introspection
+            // TODO find all of the NMS properties via introspection
         }
         
         

Modified: incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/OpenWire/OpenWireFormat.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/OpenWire/OpenWireFormat.cs?view=diff&rev=451036&r1=451035&r2=451036
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/OpenWire/OpenWireFormat.cs (original)
+++ incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/OpenWire/OpenWireFormat.cs Thu Sep 28 15:01:04 2006
@@ -38,6 +38,8 @@
         public OpenWireFormat()
         {
             dataMarshallers = new BaseDataStreamMarshaller[256];
+            // TODO: We need to dynamically load the marshaller factory based
+            // on the openwire version.
             MarshallerFactory factory = new MarshallerFactory();
             factory.configure(this);
         }

Modified: incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Transport/WireFormatNegotiator.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Transport/WireFormatNegotiator.cs?view=diff&rev=451036&r1=451035&r2=451036
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Transport/WireFormatNegotiator.cs (original)
+++ incubator/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Transport/WireFormatNegotiator.cs Thu Sep 28 15:01:04 2006
@@ -26,8 +26,6 @@
     /// </summary>
     public class WireFormatNegotiator : TransportFilter
     {
-        public const int OPENWIRE_VERSION = 2;
-
 
         public WireFormatNegotiator(ITransport next) : base(next) {
         }
@@ -43,7 +41,7 @@
             info.TcpNoDelayEnabled=false;
             info.CacheEnabled=false;
             info.SizePrefixDisabled=false;
-            info.Version = OPENWIRE_VERSION;
+            info.Version = 1;
 
             Oneway(info);
         }

Modified: incubator/activemq/activemq-dotnet/trunk/src/main/csharp/CommonAssemblyInfo.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/main/csharp/CommonAssemblyInfo.cs?view=diff&rev=451036&r1=451035&r2=451036
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/main/csharp/CommonAssemblyInfo.cs (original)
+++ incubator/activemq/activemq-dotnet/trunk/src/main/csharp/CommonAssemblyInfo.cs Thu Sep 28 15:01:04 2006
@@ -2,15 +2,15 @@
 using System.Reflection;
 using System.Runtime.InteropServices;
 
-// ------------------------------------------------------------------------------
-//  <autogenerated>
-//      This code was generated by a tool.
-//      Mono Runtime Version: 1.1.4322.2032
-// 
-//      Changes to this file may cause incorrect behavior and will be lost if 
-//      the code is regenerated.
-//  </autogenerated>
-// ------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:2.0.50727.42
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
 
 [assembly: ComVisibleAttribute(false)]
 [assembly: CLSCompliantAttribute(true)]
@@ -22,6 +22,6 @@
 [assembly: AssemblyCopyrightAttribute("Copyright (C) 2005-2006 Apache Software Foundation")]
 [assembly: AssemblyTrademarkAttribute("")]
 [assembly: AssemblyCultureAttribute("")]
-[assembly: AssemblyVersionAttribute("4.0.2460.0")]
+[assembly: AssemblyVersionAttribute("4.0.2462.0")]
 [assembly: AssemblyInformationalVersionAttribute("4.0")]
 

Added: incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/BaseMessage.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/BaseMessage.cs?view=auto&rev=451036
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/BaseMessage.cs (added)
+++ incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/BaseMessage.cs Thu Sep 28 15:01:04 2006
@@ -0,0 +1,205 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+using NMS;
+
+
+namespace MSMQ
+{
+	public delegate void AcknowledgeHandler(BaseMessage baseMessage);
+
+    public class BaseMessage : IMessage
+    {
+        private PrimitiveMap properties;
+        private Destination destination;
+        private string correlationId;
+        private long expiration;
+        private string messageId;
+        private bool persistent;
+        private byte priority;
+        private Destination replyTo;
+        private string type;
+        private event AcknowledgeHandler Acknowledger;
+        private byte[] content;
+        private long timestamp;
+
+        public byte[] Content
+        {
+            get { return content; }
+            set { content = value; }
+        }
+
+        public void Acknowledge()
+        {
+            if (Acknowledger == null)
+			{
+                throw new NMSException("No Acknowledger has been associated with this message: " + this);
+			}
+            else
+			{
+                Acknowledger(this);
+            }
+        }
+        
+        
+        // Properties
+        
+        public IPrimitiveMap Properties
+        {
+            get {
+                return properties;
+            }
+        }
+        
+        
+        // IMessage interface
+        
+        // NMS headers
+        
+        /// <summary>
+        /// The correlation ID used to correlate messages with conversations or long running business processes
+        /// </summary>
+        public string NMSCorrelationID
+        {
+            get {
+                return correlationId;
+            }
+            set {
+                correlationId = value;
+            }
+        }
+        
+        /// <summary>
+        /// The destination of the message
+        /// </summary>
+        public IDestination NMSDestination
+        {
+            get {
+                return destination;
+            }
+        }
+        
+        /// <summary>
+        /// The time in milliseconds that this message should expire in
+        /// </summary>
+        public long NMSExpiration
+        {
+            get {
+                return expiration;
+            }
+            set {
+                expiration = value;
+            }
+        }
+        
+        /// <summary>
+        /// The message ID which is set by the provider
+        /// </summary>
+        public string NMSMessageId
+        {
+            get {
+                return messageId;
+            }
+        }
+        
+        /// <summary>
+        /// Whether or not this message is persistent
+        /// </summary>
+        public bool NMSPersistent
+        {
+            get {
+                return persistent;
+            }
+            set {
+                persistent = value;
+            }
+        }
+        
+        /// <summary>
+        /// The Priority on this message
+        /// </summary>
+        public byte NMSPriority
+        {
+            get {
+                return priority;
+            }
+            set {
+                priority = value;
+            }
+        }
+        
+        /// <summary>
+        /// Returns true if this message has been redelivered to this or another consumer before being acknowledged successfully.
+        /// </summary>
+        public bool NMSRedelivered
+        {
+            get {
+                return false;
+            }
+        }
+        
+        
+        /// <summary>
+        /// The destination that the consumer of this message should send replies to
+        /// </summary>
+        public IDestination NMSReplyTo
+        {
+            get {
+                return replyTo;
+            }
+            set {
+                replyTo = (Destination) value;
+            }
+        }
+        
+        
+        /// <summary>
+        /// The timestamp the broker added to the message
+        /// </summary>
+        public long NMSTimestamp
+        {
+            get {
+                return timestamp;
+            }
+        }
+        
+        /// <summary>
+        /// The type name of this message
+        /// </summary>
+        public string NMSType
+        {
+            get {
+                return type;
+            }
+            set {
+                type = value;
+            }
+        }
+        
+
+        public object GetObjectProperty(string name)
+        {
+            return null;
+        }
+        
+        public void SetObjectProperty(string name, object value)
+        {
+        }
+                
+        
+    }
+}
+

Added: incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/BytesMessage.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/BytesMessage.cs?view=auto&rev=451036
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/BytesMessage.cs (added)
+++ incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/BytesMessage.cs Thu Sep 28 15:01:04 2006
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+using System;
+using NMS;
+
+
+namespace MSMQ
+{
+	public class BytesMessage : BaseMessage, IBytesMessage
+    {
+	    public byte[] Content
+	    {
+	        get { throw new NotImplementedException(); }
+	        set { throw new NotImplementedException(); }
+	    }
+    }
+}
+

Added: incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/Connection.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/Connection.cs?view=auto&rev=451036
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/Connection.cs (added)
+++ incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/Connection.cs Thu Sep 28 15:01:04 2006
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+using NMS;
+
+namespace MSMQ
+{
+    /// <summary>
+    /// Represents a connection with a message broker
+    /// </summary>
+    public class Connection : IConnection
+    {
+        
+        private AcknowledgementMode acknowledgementMode = AcknowledgementMode.AutoAcknowledge;
+        
+        private bool connected;
+        private bool closed;
+        private string clientId;
+
+
+
+        /// <summary>
+        /// Starts message delivery for this connection.
+        /// </summary>
+        public void Start()
+        {
+        }
+        
+        
+        /// <summary>
+        /// Stop message delivery for this connection.
+        /// </summary>
+        public void Stop()
+        {
+        }
+        
+        /// <summary>
+        /// Creates a new session to work on this connection
+        /// </summary>
+        public ISession CreateSession()
+        {
+            return CreateSession(acknowledgementMode);
+        }
+        
+        /// <summary>
+        /// Creates a new session to work on this connection
+        /// </summary>
+        public ISession CreateSession(AcknowledgementMode mode)
+        {
+            return new Session(this, mode);
+        }
+        
+        public void Dispose()
+        {
+            closed = true;
+        }
+        
+        public AcknowledgementMode AcknowledgementMode
+        {
+            get { return acknowledgementMode; }
+            set { acknowledgementMode = value; }
+        }
+        
+        public string ClientId
+        {
+            get { return clientId; }
+            set {
+                if (connected)
+                {
+                    throw new NMSException("You cannot change the ClientId once the Connection is connected");
+                }
+                clientId = value;
+            }
+        }
+                
+        protected void CheckConnected()
+        {
+            if (closed)
+            {
+                throw new NMSException("Connection Closed");
+            }
+            if (!connected)
+            {
+                connected = true;
+                // now lets send the connection and see if we get an ack/nak
+                // TODO: establish a connection
+            }
+        }
+        	        
+    }
+}

Added: incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/ConnectionFactory.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/ConnectionFactory.cs?view=auto&rev=451036
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/ConnectionFactory.cs (added)
+++ incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/ConnectionFactory.cs Thu Sep 28 15:01:04 2006
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+using NMS;
+using System;
+
+namespace MSMQ
+{
+    /// <summary>
+    /// Represents a connection with a message broker
+    /// </summary>
+    public class ConnectionFactory : IConnectionFactory
+    {        
+                
+        public IConnection CreateConnection()
+        {
+            return new Connection();
+        }
+        
+        public IConnection CreateConnection(string userName, string password)
+        {
+            return new Connection();
+        }
+                
+    }
+}

Added: incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/Destination.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/Destination.cs?view=auto&rev=451036
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/Destination.cs (added)
+++ incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/Destination.cs Thu Sep 28 15:01:04 2006
@@ -0,0 +1,147 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+using NMS;
+using System;
+namespace MSMQ
+{
+    
+    /// <summary>
+    /// Summary description for Destination.
+    /// </summary>
+    public abstract class Destination : IDestination
+    {
+        
+        private String path = "";
+        
+        /**
+         * The Default Constructor
+         */
+        protected Destination()
+        {
+        }
+        
+        /**
+         * Construct the Destination with a defined physical name;
+         *
+         * @param name
+         */
+        protected Destination(String name)
+        {
+            this.path = name;
+        }
+                
+        public String Path
+        {
+            get { return this.path; }
+            set { this.path = value; }
+        }
+        
+        /**
+         * Returns true if a temporary Destination
+         *
+         * @return true/false
+         */
+        
+        public bool IsTemporary()
+        {
+            return DestinationType == DestinationType.TemporaryQueue
+                || DestinationType == DestinationType.TemporaryTopic;
+        }
+        
+        /**
+         * Returns true if a Topic Destination
+         *
+         * @return true/false
+         */
+        
+        public bool IsTopic()
+        {
+            return DestinationType == DestinationType.Topic
+                   || DestinationType == DestinationType.TemporaryTopic;
+        }
+        
+        /**
+         * Returns true if a Queue Destination
+         *
+         * @return true/false
+         */
+        public bool IsQueue()
+        {
+            return !IsTopic();
+        }
+        
+        
+        /**
+         * @return string representation of this instance
+         */        
+        public override String ToString()
+        {
+            return this.path;
+        }
+        
+        /**
+         * @return hashCode for this instance
+         */
+        public override int GetHashCode()
+        {
+            int answer = 37;
+            
+            if (this.path != null)
+            {
+                answer = path.GetHashCode();
+            }
+            if (IsTopic())
+            {
+                answer ^= 0xfabfab;
+            }
+            return answer;
+        }
+        
+        /**
+         * if the object passed in is equivalent, return true
+         *
+         * @param obj the object to compare
+         * @return true if this instance and obj are equivalent
+         */
+        public override bool Equals(Object obj)
+        {
+            bool result = this == obj;
+            if (!result && obj != null && obj is Destination)
+            {
+                Destination other = (Destination) obj;
+                result = this.DestinationType == other.DestinationType
+                    && this.path.Equals(other.path);
+            }
+            return result;
+        }
+                
+        /**
+         * Factory method to create a child destination if this destination is a composite
+         * @param name
+         * @return the created Destination
+         */
+        public abstract Destination CreateDestination(String name);
+
+
+		public abstract DestinationType DestinationType
+		{
+			get;
+		}
+
+    }
+}
+

Added: incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/MapMessage.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/MapMessage.cs?view=auto&rev=451036
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/MapMessage.cs (added)
+++ incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/MapMessage.cs Thu Sep 28 15:01:04 2006
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+using NMS;
+using System;
+
+
+namespace MSMQ
+{
+	public class MapMessage : BaseMessage, IMapMessage
+    {
+        private PrimitiveMap body;
+                
+        public IPrimitiveMap Body
+        {
+            get {
+                if (body == null)
+                {
+                    // body = PrimitiveMap.Unmarshal(Content);
+                }
+                return body;
+            }
+        }
+        
+//        public override void BeforeMarshall(OpenWireFormat wireFormat)
+//        {
+//            if (body == null)
+//            {
+//                Content = null;
+//            }
+//            else
+//            {
+//                Content = body.Marshal();
+//            }
+//            
+//            Console.WriteLine("BeforeMarshalling, content is: " + Content);
+//			
+//            base.BeforeMarshall(wireFormat);
+//        }
+        
+    }
+}
+

Added: incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/MessageConsumer.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/MessageConsumer.cs?view=auto&rev=451036
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/MessageConsumer.cs (added)
+++ incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/MessageConsumer.cs Thu Sep 28 15:01:04 2006
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+using System;
+using NMS;
+using System.Threading;
+
+namespace MSMQ
+{
+    /// <summary>
+    /// An object capable of receiving messages from some destination
+    /// </summary>
+    public class MessageConsumer : IMessageConsumer
+    {
+        private readonly Session session;
+        private readonly AcknowledgementMode acknowledgementMode;
+
+        public MessageConsumer(Session session, AcknowledgementMode acknowledgementMode)
+        {
+            this.session = session;
+            this.acknowledgementMode = acknowledgementMode;            
+        }
+
+        public IMessage Receive()
+        {
+            throw new NotImplementedException();
+        }
+
+        public IMessage Receive(TimeSpan timeout)
+        {
+            throw new NotImplementedException();
+        }
+
+        public IMessage ReceiveNoWait()
+        {
+            throw new NotImplementedException();
+        }
+
+        public event MessageListener Listener;
+
+        public void Dispose()
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

Added: incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/MessageProducer.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/MessageProducer.cs?view=auto&rev=451036
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/MessageProducer.cs (added)
+++ incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/MessageProducer.cs Thu Sep 28 15:01:04 2006
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+using System;
+using System.Messaging;
+using NMS;
+
+namespace MSMQ
+{
+    /// <summary>
+    /// An object capable of sending messages to some destination
+    /// </summary>
+    public class MessageProducer : IMessageProducer
+    {
+        private readonly Session session;
+        private Destination destination;
+
+        private long messageCounter;
+        private bool persistent;
+        private long timeToLive;
+        private int priority;
+        private bool disableMessageID;
+        private bool disableMessageTimestamp;
+        
+        private MessageQueue messageQueue;
+
+        public MessageProducer(Session session, Destination destination)
+        {
+            this.session = session;
+            this.destination = destination;
+            if (destination != null)
+            {
+                messageQueue = openMessageQueue(destination);
+            }
+        }
+
+        private MessageQueue openMessageQueue(Destination dest)
+        {
+            MessageQueue rc=null;
+            try
+            {
+                if (!MessageQueue.Exists(dest.Path))
+                {
+                    // create the new message queue and make it transactional
+                    rc = MessageQueue.Create(dest.Path, session.Transacted);
+                    this.destination.Path = rc.Path;
+                } else
+                {
+                    rc = new MessageQueue(dest.Path);
+                    this.destination.Path = rc.Path;
+                    if( !rc.CanWrite )
+                    {
+                        throw new NMSSecurityException("Do not have write access to: " + dest);
+                    }
+                }                
+            } 
+            catch( Exception e ) 
+            {
+                if( rc!=null )
+                {
+                    rc.Dispose();
+                }
+                throw new NMSException(e.Message+": "+dest, e);
+            }            
+            return rc;
+        }
+
+        public void Send(IMessage message)
+        {
+            Send(destination, message);
+        }
+
+        public void Send(IDestination dest, IMessage imessage)
+        {
+            BaseMessage message = (BaseMessage) imessage;
+            MessageQueue mq=null;
+            MessageQueue responseQueue = null;
+            MessageQueueTransaction transaction = null;
+            try
+            {
+                // Locate the MSMQ Queue we will be sending to
+                if (messageQueue != null)
+                {
+                    if( dest.Equals(destination) )
+                    {
+                        mq = messageQueue;
+                    } 
+                    else
+                    {
+                        throw new NMSException("This producer can only be used to send to: "+destination);
+                    }
+                }
+                else
+                {
+                    mq = openMessageQueue((Destination)dest);
+                }
+
+                // Convert the Mesasge into a MSMQ message
+                Message msg = new Message();                
+                if ( message.NMSReplyTo!=null )
+                {
+                    responseQueue = new MessageQueue(((Destination)message.NMSReplyTo).Path);
+                }
+                if ( timeToLive!=null )
+                {
+                    msg.TimeToBeReceived = TimeSpan.FromMilliseconds(timeToLive);
+                }
+                if ( message.NMSCorrelationID!=null )
+                {
+                    msg.CorrelationId = message.NMSCorrelationID;
+                }
+                msg.Recoverable = persistent;
+                msg.Priority = MessagePriority.Normal;
+                msg.ResponseQueue = responseQueue;
+
+                // Now Send the message
+                if( mq.Transactional )
+                {
+                    if (session.Transacted)
+                    {
+                        mq.Send(msg, session.MessageQueueTransaction);
+                        
+                    } else
+                    {
+                        // Start our own mini transaction here to send the message.
+                        transaction = new MessageQueueTransaction();
+                        transaction.Begin();
+                        mq.Send(msg, transaction);
+                        transaction.Commit();
+                    }
+                } else
+                {
+                    if( session.Transacted )
+                    {
+                        // We may want to raise an exception here since app requested
+                        // a transeced NMS session, but is using a non transacted message queue
+                        // For now silently ignore it.
+                    }
+                    mq.Send(msg);
+                }
+                
+            } finally
+            {
+                // Cleanup
+                if(transaction!=null)
+                {
+                    transaction.Dispose();
+                }
+                if (responseQueue != null)
+                {
+                    responseQueue.Dispose();
+                }
+                if( mq!=null && mq!=messageQueue )
+                {
+                    mq.Dispose();
+                }
+            }
+        }
+
+        public void Dispose()
+        {
+            if( messageQueue!=null )
+            {
+                messageQueue.Dispose();
+                messageQueue = null;                    
+            }
+        }
+
+        public bool Persistent
+        {
+            get { return persistent; }
+            set { persistent = value; }
+        }
+
+        public long TimeToLive
+        {
+            get { return timeToLive; }
+            set { timeToLive = value; }
+        }
+
+        public int Priority
+        {
+            get { return priority; }
+            set { priority = value; }
+        }
+
+        public bool DisableMessageID
+        {
+            get { return disableMessageID; }
+            set { disableMessageID = value; }
+        }
+
+        public bool DisableMessageTimestamp
+        {
+            get { return disableMessageTimestamp; }
+            set { disableMessageTimestamp = value; }
+        }
+    }
+}
\ No newline at end of file

Added: incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/ObjectMessage.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/ObjectMessage.cs?view=auto&rev=451036
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/ObjectMessage.cs (added)
+++ incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/ObjectMessage.cs Thu Sep 28 15:01:04 2006
@@ -0,0 +1,27 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+using System;
+using System.Collections;
+
+namespace MSMQ
+{
+    public class ObjectMessage : BaseMessage
+    {
+
+    }
+}

Added: incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/PrimitiveMap.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/PrimitiveMap.cs?view=auto&rev=451036
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/PrimitiveMap.cs (added)
+++ incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/PrimitiveMap.cs Thu Sep 28 15:01:04 2006
@@ -0,0 +1,293 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+using NMS;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+namespace MSMQ
+{
+    /// <summary>
+    /// A default implementation of IPrimitiveMap
+    /// </summary>
+    [Serializable()]
+    public class PrimitiveMap : IPrimitiveMap
+    {
+        public const byte NULL = 0;
+        public const byte BOOLEAN_TYPE = 1;
+        public const byte BYTE_TYPE = 2;
+        public const byte CHAR_TYPE = 3;
+        public const byte SHORT_TYPE = 4;
+        public const byte INTEGER_TYPE = 5;
+        public const byte LONG_TYPE = 6;
+        public const byte DOUBLE_TYPE = 7;
+        public const byte FLOAT_TYPE = 8;
+        public const byte STRING_TYPE = 9;
+        public const byte BYTE_ARRAY_TYPE = 10;
+        public const byte MAP_TYPE = 11;
+        public const byte LIST_TYPE = 12;
+        public const byte BIG_STRING_TYPE = 13;
+
+        private Dictionary<String, object> dictionary = new Dictionary<String, object>();
+
+        public void Clear()
+        {
+            dictionary.Clear();
+        }
+
+        public bool Contains(Object key)
+        {
+            return dictionary.ContainsKey((string) key);
+        }
+
+        public void Remove(Object key)
+        {
+            dictionary.Remove((string) key);
+        }
+
+
+        public int Count
+        {
+            get
+            {
+                return dictionary.Count;
+            }
+        }
+
+        public ICollection Keys
+        {
+            get
+            {
+                return dictionary.Keys;
+            }
+        }
+
+        public ICollection Values
+        {
+            get
+            {
+                return dictionary.Values;
+            }
+        }
+
+        public object this[string key]
+        {
+            get
+            {
+                return GetValue(key);
+            }
+            set
+            {
+                CheckValidType(value);
+                SetValue(key, value);
+            }
+        }
+
+        public string GetString(string key)
+        {
+            Object value = GetValue(key);
+            CheckValueType(value, typeof(string));
+            return (string)value;
+        }
+
+        public void SetString(string key, string value)
+        {
+            SetValue(key, value);
+        }
+
+        public bool GetBool(String key)
+        {
+            Object value = GetValue(key);
+            CheckValueType(value, typeof(bool));
+            return (bool)value;
+        }
+
+        public void SetBool(String key, bool value)
+        {
+            SetValue(key, value);
+        }
+
+        public byte GetByte(String key)
+        {
+            Object value = GetValue(key);
+            CheckValueType(value, typeof(byte));
+            return (byte)value;
+        }
+
+        public void SetByte(String key, byte value)
+        {
+            SetValue(key, value);
+        }
+
+        public char GetChar(String key)
+        {
+            Object value = GetValue(key);
+            CheckValueType(value, typeof(char));
+            return (char)value;
+        }
+
+        public void SetChar(String key, char value)
+        {
+            SetValue(key, value);
+        }
+
+        public short GetShort(String key)
+        {
+            Object value = GetValue(key);
+            CheckValueType(value, typeof(short));
+            return (short)value;
+        }
+
+        public void SetShort(String key, short value)
+        {
+            SetValue(key, value);
+        }
+
+        public int GetInt(String key)
+        {
+            Object value = GetValue(key);
+            CheckValueType(value, typeof(int));
+            return (int)value;
+        }
+
+        public void SetInt(String key, int value)
+        {
+            SetValue(key, value);
+        }
+
+        public long GetLong(String key)
+        {
+            Object value = GetValue(key);
+            CheckValueType(value, typeof(long));
+            return (long)value;
+        }
+
+        public void SetLong(String key, long value)
+        {
+            SetValue(key, value);
+        }
+
+        public float GetFloat(String key)
+        {
+            Object value = GetValue(key);
+            CheckValueType(value, typeof(float));
+            return (float)value;
+        }
+
+        public void SetFloat(String key, float value)
+        {
+            SetValue(key, value);
+        }
+
+        public double GetDouble(String key)
+        {
+            Object value = GetValue(key);
+            CheckValueType(value, typeof(double));
+            return (double)value;
+        }
+
+        public void SetDouble(String key, double value)
+        {
+            SetValue(key, value);
+        }
+
+        public IList GetList(String key)
+        {
+            Object value = GetValue(key);
+            if (value != null && !(value is IList))
+            {
+                throw new NMSException("Property: " + key + " is not an IList but is: " + value);
+            }
+            return (IList)value;
+        }
+
+        public void SetList(String key, IList value)
+        {
+            SetValue(key, value);
+        }
+
+        public IDictionary GetDictionary(String key)
+        {
+            Object value = GetValue(key);
+            if (value != null && !(value is IDictionary))
+            {
+                throw new NMSException("Property: " + key + " is not an IDictionary but is: " + value);
+            }
+            return (IDictionary)value;
+        }
+
+        public void SetDictionary(String key, IDictionary value)
+        {
+            SetValue(key, value);
+        }
+
+
+        protected virtual void SetValue(String key, Object value)
+        {
+            dictionary[key] = value;
+        }
+
+
+        protected virtual Object GetValue(String key)
+        {
+            return dictionary[key];
+        }
+
+        protected virtual void CheckValueType(Object value, Type type)
+        {
+            if (!type.IsInstanceOfType(value))
+            {
+                throw new NMSException("Expected type: " + type.Name + " but was: " + value);
+            }
+        }
+
+        protected virtual void CheckValidType(Object value)
+        {
+            if (value != null && !(value is IList) && !(value is IDictionary))
+            {
+                Type type = value.GetType();
+                if (!type.IsPrimitive && !type.IsValueType && !type.IsAssignableFrom(typeof(string)))
+                {
+                    throw new NMSException("Invalid type: " + type.Name + " for value: " + value);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Method ToString
+        /// </summary>
+        /// <returns>A string</returns>
+        public override String ToString()
+        {
+            String s = "{";
+            bool first = true;
+            foreach (KeyValuePair<String, object> entry in dictionary)
+            {
+                if (!first)
+                {
+                    s += ", ";
+                }
+                first = false;
+                String name = (String)entry.Key;
+                Object value = entry.Value;
+                s += name + "=" + value;
+            }
+            s += "}";
+            return s;
+        }
+    }
+}

Added: incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/Queue.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/Queue.cs?view=auto&rev=451036
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/Queue.cs (added)
+++ incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/Queue.cs Thu Sep 28 15:01:04 2006
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+using NMS;
+using System;
+
+namespace MSMQ
+{
+	
+	/// <summary>
+	/// Summary description for Queue.
+	/// </summary>
+	public class Queue : Destination, IQueue
+    {        
+        public Queue() : base()
+        {
+        }
+        public Queue(String name) : base(name)
+        {
+        }
+		
+		override public DestinationType DestinationType
+		{
+			get {
+				return DestinationType.Queue;
+			}
+		}
+		
+        public String QueueName
+        {
+            get { return Path; }
+        }
+        
+        
+        public override Destination CreateDestination(String name)
+        {
+            return new Queue(name);
+        }
+    }
+}
+

Added: incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/Session.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/Session.cs?view=auto&rev=451036
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/Session.cs (added)
+++ incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/Session.cs Thu Sep 28 15:01:04 2006
@@ -0,0 +1,172 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+using System.Messaging;
+using NMS;
+using System;
+
+namespace MSMQ
+{
+    /// <summary>
+    /// MSQM provider of ISession
+    /// </summary>
+    public class Session : ISession
+    {
+        private Connection connection;
+        private AcknowledgementMode acknowledgementMode;
+        private MessageQueueTransaction messageQueueTransaction;
+
+        public Session(Connection connection, AcknowledgementMode acknowledgementMode)
+        {
+            this.connection = connection;
+            this.acknowledgementMode = acknowledgementMode;            
+            if( this.acknowledgementMode == AcknowledgementMode.Transactional )
+            {
+                MessageQueueTransaction = new MessageQueueTransaction();
+            }
+        }
+
+        public void Dispose()
+        {
+            if(MessageQueueTransaction!=null)
+            {
+                MessageQueueTransaction.Dispose();
+            }
+        }
+        
+        public IMessageProducer CreateProducer()
+        {
+            return CreateProducer(null);
+        }
+        
+        public IMessageProducer CreateProducer(IDestination destination)
+        {
+            return new MessageProducer(this, (Destination) destination);
+        }
+        
+        public IMessageConsumer CreateConsumer(IDestination destination)
+        {
+            return CreateConsumer(destination, null);
+        }
+        
+        public IMessageConsumer CreateConsumer(IDestination destination, string selector)
+        {
+            return new MessageConsumer(this, acknowledgementMode);
+        }
+        
+        public IMessageConsumer CreateDurableConsumer(ITopic destination, string name, string selector, bool noLocal)
+        {
+            return null;
+        }
+        
+        public IQueue GetQueue(string name)
+        {
+            return new Queue(name);
+        }
+        
+        public ITopic GetTopic(string name)
+        {
+            throw new NotImplementedException("Topics are not supported by MSQM");
+        }
+        
+        public ITemporaryQueue CreateTemporaryQueue()
+        {
+            throw new NotImplementedException("Tempoary Queues are not supported by MSQM");
+        }
+        
+        public ITemporaryTopic CreateTemporaryTopic()
+        {
+            throw new NotImplementedException("Tempoary Topics are not supported by MSQM");
+        }
+        
+        public IMessage CreateMessage()
+        {
+            BaseMessage answer = new BaseMessage();
+            return answer;
+        }
+        
+        
+        public ITextMessage CreateTextMessage()
+        {
+            TextMessage answer = new TextMessage();
+            return answer;
+        }
+        
+        public ITextMessage CreateTextMessage(string text)
+        {
+            TextMessage answer = new TextMessage(text);
+            return answer;
+        }
+        
+        public IMapMessage CreateMapMessage()
+        {
+            return new MapMessage();
+        }
+        
+        public IBytesMessage CreateBytesMessage()
+        {
+            return new BytesMessage();
+        }
+        
+        public IBytesMessage CreateBytesMessage(byte[] body)
+        {
+            BytesMessage answer = new BytesMessage();
+            answer.Content = body;
+            return answer;
+        }
+        
+        public void Commit()
+        {
+            if (! Transacted )
+            {
+                throw new InvalidOperationException("You cannot perform a Commit() on a non-transacted session. Acknowlegement mode is: " + acknowledgementMode);
+            }
+            messageQueueTransaction.Commit();
+        }
+        
+        public void Rollback()
+        {
+            if (! Transacted)
+            {
+                throw new InvalidOperationException("You cannot perform a Commit() on a non-transacted session. Acknowlegement mode is: " + acknowledgementMode);
+            }
+            messageQueueTransaction.Abort();            
+        }
+        
+        // Properties        
+        public Connection Connection
+        {
+            get { return connection; }
+        }
+        
+        public bool Transacted
+        {
+            get { return acknowledgementMode == AcknowledgementMode.Transactional; }
+        }
+        
+        public MessageQueueTransaction MessageQueueTransaction
+        {
+            get
+            {
+                if( messageQueueTransaction.Status != MessageQueueTransactionStatus.Pending ) 
+                    messageQueueTransaction.Begin();
+                return messageQueueTransaction;
+            }
+            set { messageQueueTransaction = value; }
+        }
+
+    }
+}

Added: incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/StreamMessage.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/StreamMessage.cs?view=auto&rev=451036
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/StreamMessage.cs (added)
+++ incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/StreamMessage.cs Thu Sep 28 15:01:04 2006
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+namespace MSMQ
+{
+	public class StreamMessage : BaseMessage
+    {
+		
+    }
+}
+

Added: incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/TextMessage.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/TextMessage.cs?view=auto&rev=451036
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/TextMessage.cs (added)
+++ incubator/activemq/activemq-dotnet/trunk/src/main/csharp/MSMQ/TextMessage.cs Thu Sep 28 15:01:04 2006
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+using NMS;
+using System;
+
+
+namespace MSMQ
+{
+	public class TextMessage : BaseMessage, ITextMessage
+    {
+        private String text;
+        
+        public TextMessage()
+        {
+        }
+        
+        public TextMessage(String text)
+        {
+            this.Text = text;
+        }
+        
+        
+        // Properties
+        
+        public string Text
+        {
+            get {
+                if (text == null)
+                {
+                    // now lets read the content
+                    byte[] data = this.Content;
+                    if (data != null)
+                    {
+                        // TODO assume that the text is ASCII
+                        char[] chars = new char[data.Length-sizeof(int)];
+                        for (int i = 0; i < chars.Length; i++)
+                        {
+                            chars[i] = (char) data[i+sizeof(int)];
+                        }
+                        text = new String(chars);
+                    }
+                }
+                return text;
+            }
+            
+            set {
+                this.text = value;
+                byte[] data = null;
+                if (text != null)
+                {
+					// TODO assume that the text is ASCII
+					
+                    byte[] sizePrefix = System.BitConverter.GetBytes(text.Length);
+					data = new byte[text.Length + sizePrefix.Length];  //int at the front of it
+															
+					// add the size prefix
+					for (int j = 0; j < sizePrefix.Length; j++)
+                    {
+						// The bytes need to be encoded in big endian
+						if ( BitConverter.IsLittleEndian ) {
+							data[j] = sizePrefix[sizePrefix.Length - j - 1];
+						} else {
+							data[j] = sizePrefix[j];
+						}
+                    }
+					
+					// Add the data.
+                    char[] chars = text.ToCharArray();
+					for (int i = 0; i < chars.Length; i++)
+                    {
+                        data[i + sizePrefix.Length] = (byte)chars[i];
+                    }
+				}
+				this.Content = data;
+					
+            }
+        }
+
+    }
+}
+

Modified: incubator/activemq/activemq-dotnet/trunk/src/main/csharp/NMS/NMSException.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/main/csharp/NMS/NMSException.cs?view=diff&rev=451036&r1=451035&r2=451036
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/main/csharp/NMS/NMSException.cs (original)
+++ incubator/activemq/activemq-dotnet/trunk/src/main/csharp/NMS/NMSException.cs Thu Sep 28 15:01:04 2006
@@ -14,6 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+using System;
+
 namespace NMS
 {
 	/// <summary>
@@ -21,10 +23,17 @@
 	/// </summary>
 	public class NMSException : System.Exception
 	{
-		public NMSException(string message) : base(message)
+	    
+		public NMSException(string message) 
+		    : base(message)
 		{
 		}
-	}
+	    
+        public NMSException(string message, Exception innerException)
+            : base(message, innerException)
+        {
+        }
+    }
 }
 
 

Added: incubator/activemq/activemq-dotnet/trunk/src/main/csharp/NMS/NMSSecurityException.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/main/csharp/NMS/NMSSecurityException.cs?view=auto&rev=451036
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/main/csharp/NMS/NMSSecurityException.cs (added)
+++ incubator/activemq/activemq-dotnet/trunk/src/main/csharp/NMS/NMSSecurityException.cs Thu Sep 28 15:01:04 2006
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+namespace NMS
+{
+	/// <summary>
+	/// Represents a connection failure.
+	/// </summary>
+	public class NMSSecurityException : NMSException
+	{
+        public NMSSecurityException(string message)
+            : base(message)
+		{
+		}
+	}
+}
+
+

Added: incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/BadConsumeTest.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/BadConsumeTest.cs?view=auto&rev=451036
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/BadConsumeTest.cs (added)
+++ incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/BadConsumeTest.cs Thu Sep 28 15:01:04 2006
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+using ActiveMQ;
+using NMS;
+using NUnit.Framework;
+using System;
+
+namespace ActiveMQ
+{
+	[TestFixture]
+    public class BadConsumeTest : NMS.Test.BadConsumeTest
+    {
+        private String brokerURI = "tcp://localhost:61616";
+        protected override IConnectionFactory CreateConnectionFactory()
+        {
+            return new ConnectionFactory(new Uri(brokerURI));
+        }
+    }
+}
+
+

Added: incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/BytesMessageTest.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/BytesMessageTest.cs?view=auto&rev=451036
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/BytesMessageTest.cs (added)
+++ incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/BytesMessageTest.cs Thu Sep 28 15:01:04 2006
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+using ActiveMQ;
+using NMS;
+using NUnit.Framework;
+using System;
+
+namespace ActiveMQ
+{
+    [TestFixture]
+    public class BytesMessageTest : NMS.Test.BytesMessageTest
+    {
+        private String brokerURI = "tcp://localhost:61616";
+        protected override IConnectionFactory CreateConnectionFactory()
+        {
+            return new ConnectionFactory(new Uri(brokerURI));
+        }
+    }
+}
+
+
+

Added: incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/ConsumerTest.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/ConsumerTest.cs?view=auto&rev=451036
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/ConsumerTest.cs (added)
+++ incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/ConsumerTest.cs Thu Sep 28 15:01:04 2006
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+using ActiveMQ;
+using NMS;
+using NUnit.Framework;
+using System;
+
+namespace ActiveMQ
+{
+	[TestFixture]
+    public class ConsumerTest : NMS.Test.ConsumerTest
+    {
+
+        private String brokerURI = "tcp://localhost:61616";
+        protected override IConnectionFactory CreateConnectionFactory()
+        {
+            return new ConnectionFactory(new Uri(brokerURI));
+        }	    				
+    }
+}
+
+
+

Added: incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/DurableTest.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/DurableTest.cs?view=auto&rev=451036
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/DurableTest.cs (added)
+++ incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/DurableTest.cs Thu Sep 28 15:01:04 2006
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+using System;
+using NMS;
+using NUnit.Framework;
+
+namespace ActiveMQ
+{
+    [TestFixture]
+    public class DurableTest : NMS.Test.DurableTest
+    {
+        private String brokerURI = "tcp://localhost:61616";
+
+        protected override IConnectionFactory CreateConnectionFactory()
+        {
+            return new ConnectionFactory(new Uri(brokerURI));
+        }
+    }
+}
\ No newline at end of file

Added: incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/JMSPropertyTest.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/JMSPropertyTest.cs?view=auto&rev=451036
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/JMSPropertyTest.cs (added)
+++ incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/JMSPropertyTest.cs Thu Sep 28 15:01:04 2006
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//using ActiveMQ;
+using ActiveMQ;
+using NMS;
+using NUnit.Framework;
+using System;
+
+namespace ActiveMQ
+{
+    [ TestFixture ]
+    public class NMSPropertyTest : NMS.Test.NMSPropertyTest
+    {
+        private String brokerURI = "tcp://localhost:61616";
+        protected override IConnectionFactory CreateConnectionFactory()
+        {
+            return new ConnectionFactory(new Uri(brokerURI));
+        }
+    }
+}
+
+
+

Added: incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/MapMessageTest.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/MapMessageTest.cs?view=auto&rev=451036
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/MapMessageTest.cs (added)
+++ incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/MapMessageTest.cs Thu Sep 28 15:01:04 2006
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+using ActiveMQ;
+using NMS;
+using NUnit.Framework;
+using System;
+
+namespace ActiveMQ
+{
+	[ TestFixture ]
+    public class MapMessageTest : NMS.Test.MapMessageTest 
+    {
+
+        private String brokerURI = "tcp://localhost:61616";
+        protected override IConnectionFactory CreateConnectionFactory()
+        {
+            return new ConnectionFactory(new Uri(brokerURI));
+        }
+	    
+    }
+}
+
+

Added: incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/TemporaryQueueTest.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/TemporaryQueueTest.cs?view=auto&rev=451036
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/TemporaryQueueTest.cs (added)
+++ incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/TemporaryQueueTest.cs Thu Sep 28 15:01:04 2006
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+using ActiveMQ;
+using NMS;
+using NUnit.Framework;
+using System;
+
+namespace ActiveMQ
+{
+    [ TestFixture ]
+    public class TemporaryQueueTest : NMS.Test.TemporaryQueueTest
+    {
+        private String brokerURI = "tcp://localhost:61616";
+        protected override IConnectionFactory CreateConnectionFactory()
+        {
+            return new ConnectionFactory(new Uri(brokerURI));
+        }
+    }
+}

Modified: incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/TestMain.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/TestMain.cs?view=diff&rev=451036&r1=451035&r2=451036
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/TestMain.cs (original)
+++ incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/TestMain.cs Thu Sep 28 15:01:04 2006
@@ -48,7 +48,7 @@
                     // lets send a message
                     ITextMessage request = session.CreateTextMessage("Hello World!");
                     request.NMSCorrelationID = "abc";
-                    request.Properties["JMSXGroupID"] = "cheese";
+                    request.Properties["NMSXGroupID"] = "cheese";
                     request.Properties["myHeader"] = "James";
                     
                     producer.Send(request);

Added: incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/TextMessage.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/TextMessage.cs?view=auto&rev=451036
==============================================================================
--- incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/TextMessage.cs (added)
+++ incubator/activemq/activemq-dotnet/trunk/src/test/csharp/ActiveMQ/TextMessage.cs Thu Sep 28 15:01:04 2006
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+using ActiveMQ;
+using NMS;
+using NUnit.Framework;
+using System;
+
+namespace ActiveMQ
+{
+	[ TestFixture ]
+    public class TextMessage : NMS.Test.TextMessage
+    {
+        private String brokerURI = "tcp://localhost:61616";
+        protected override IConnectionFactory CreateConnectionFactory()
+        {
+            return new ConnectionFactory(new Uri(brokerURI));
+        }        
+    }
+}
+
+
+



Mime
View raw message