activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r989852 [1/2] - in /activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp: ./ Commands/
Date Thu, 26 Aug 2010 18:04:52 GMT
Author: tabish
Date: Thu Aug 26 18:04:52 2010
New Revision: 989852

URL: http://svn.apache.org/viewvc?rev=989852&view=rev
Log:
fix: https://issues.apache.org/activemq/browse/AMQNET-276

Adds a ForeignMessageTransformationTest and a set of NMS IMessage and IDestination test classes to allow for creation of custom Messages and Destination in the tests.

Added:
    activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/
    activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/BytesMessage.cs   (with props)
    activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/Destination.cs   (with props)
    activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/MapMessage.cs   (with props)
    activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/Message.cs   (with props)
    activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/ObjectMessage.cs   (with props)
    activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/Queue.cs   (with props)
    activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/StreamMessage.cs   (with props)
    activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/TempDestination.cs   (with props)
    activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/TempQueue.cs   (with props)
    activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/TempTopic.cs   (with props)
    activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/TextMessage.cs   (with props)
    activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/Topic.cs   (with props)
    activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/ForgeinMessageTransformationTest.cs   (with props)

Added: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/BytesMessage.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/BytesMessage.cs?rev=989852&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/BytesMessage.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/BytesMessage.cs Thu Aug 26 18:04:52 2010
@@ -0,0 +1,511 @@
+/*
+ * 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 Apache.NMS;
+using Apache.NMS.Util;
+using System;
+using System.Collections;
+using System.IO;
+
+namespace Apache.NMS.Commands
+{
+    public class BytesMessage : Message, IBytesMessage
+    {
+        private EndianBinaryReader dataIn = null;
+        private EndianBinaryWriter dataOut = null;
+        private MemoryStream outputBuffer = null;
+        private int length = 0;
+
+        public override Object Clone()
+        {
+            StoreContent();
+            return base.Clone();
+        }
+
+        public override void ClearBody()
+        {
+            base.ClearBody();
+            this.outputBuffer = null;
+            this.dataIn = null;
+            this.dataOut = null;
+            this.length = 0;
+        }
+
+        public long BodyLength
+        {
+            get
+            {
+                InitializeReading();
+                return this.length;
+            }
+        }
+
+        public byte ReadByte()
+        {
+            InitializeReading();
+            try
+            {
+                return dataIn.ReadByte();
+            }
+            catch(EndOfStreamException e)
+            {
+                throw NMSExceptionSupport.CreateMessageEOFException(e);
+            }
+            catch(IOException e)
+            {
+                throw NMSExceptionSupport.CreateMessageFormatException(e);
+            }
+        }
+
+        public void WriteByte( byte value )
+        {
+            InitializeWriting();
+            try
+            {
+                dataOut.Write( value );
+            }
+            catch(Exception e)
+            {
+                throw NMSExceptionSupport.Create(e);
+            }
+        }
+
+        public bool ReadBoolean()
+        {
+            InitializeReading();
+            try
+            {
+                return dataIn.ReadBoolean();
+            }
+            catch(EndOfStreamException e)
+            {
+                throw NMSExceptionSupport.CreateMessageEOFException(e);
+            }
+            catch(IOException e)
+            {
+                throw NMSExceptionSupport.CreateMessageFormatException(e);
+            }
+        }
+
+        public void WriteBoolean( bool value )
+        {
+            InitializeWriting();
+            try
+            {
+                dataOut.Write( value );
+            }
+            catch(Exception e)
+            {
+                throw NMSExceptionSupport.Create(e);
+            }
+        }
+
+        public char ReadChar()
+        {
+            InitializeReading();
+            try
+            {
+                return dataIn.ReadChar();
+            }
+            catch(EndOfStreamException e)
+            {
+                throw NMSExceptionSupport.CreateMessageEOFException(e);
+            }
+            catch(IOException e)
+            {
+                throw NMSExceptionSupport.CreateMessageFormatException(e);
+            }
+        }
+
+        public void WriteChar( char value )
+        {
+            InitializeWriting();
+            try
+            {
+                dataOut.Write( value );
+            }
+            catch(Exception e)
+            {
+                throw NMSExceptionSupport.Create(e);
+            }
+        }
+
+        public short ReadInt16()
+        {
+            InitializeReading();
+            try
+            {
+                return dataIn.ReadInt16();
+            }
+            catch(EndOfStreamException e)
+            {
+                throw NMSExceptionSupport.CreateMessageEOFException(e);
+            }
+            catch(IOException e)
+            {
+                throw NMSExceptionSupport.CreateMessageFormatException(e);
+            }
+        }
+
+        public void WriteInt16( short value )
+        {
+            InitializeWriting();
+            try
+            {
+                dataOut.Write( value );
+            }
+            catch(Exception e)
+            {
+                throw NMSExceptionSupport.Create(e);
+            }
+        }
+
+        public int ReadInt32()
+        {
+            InitializeReading();
+            try
+            {
+                return dataIn.ReadInt32();
+            }
+            catch(EndOfStreamException e)
+            {
+                throw NMSExceptionSupport.CreateMessageEOFException(e);
+            }
+            catch(IOException e)
+            {
+                throw NMSExceptionSupport.CreateMessageFormatException(e);
+            }
+        }
+
+        public void WriteInt32( int value )
+        {
+            InitializeWriting();
+            try
+            {
+                dataOut.Write( value );
+            }
+            catch(Exception e)
+            {
+                throw NMSExceptionSupport.Create(e);
+            }
+        }
+
+        public long ReadInt64()
+        {
+            InitializeReading();
+            try
+            {
+                return dataIn.ReadInt64();
+            }
+            catch(EndOfStreamException e)
+            {
+                throw NMSExceptionSupport.CreateMessageEOFException(e);
+            }
+            catch(IOException e)
+            {
+                throw NMSExceptionSupport.CreateMessageFormatException(e);
+            }
+        }
+
+        public void WriteInt64( long value )
+        {
+            InitializeWriting();
+            try
+            {
+                dataOut.Write( value );
+            }
+            catch(Exception e)
+            {
+                throw NMSExceptionSupport.Create(e);
+            }
+        }
+
+        public float ReadSingle()
+        {
+            InitializeReading();
+            try
+            {
+                return dataIn.ReadSingle();
+            }
+            catch(EndOfStreamException e)
+            {
+                throw NMSExceptionSupport.CreateMessageEOFException(e);
+            }
+            catch(IOException e)
+            {
+                throw NMSExceptionSupport.CreateMessageFormatException(e);
+            }
+        }
+
+        public void WriteSingle( float value )
+        {
+            InitializeWriting();
+            try
+            {
+                dataOut.Write( value );
+            }
+            catch(Exception e)
+            {
+                throw NMSExceptionSupport.Create(e);
+            }
+        }
+
+        public double ReadDouble()
+        {
+            InitializeReading();
+            try
+            {
+                return dataIn.ReadDouble();
+            }
+            catch(EndOfStreamException e)
+            {
+                throw NMSExceptionSupport.CreateMessageEOFException(e);
+            }
+            catch(IOException e)
+            {
+                throw NMSExceptionSupport.CreateMessageFormatException(e);
+            }
+        }
+
+        public void WriteDouble( double value )
+        {
+            InitializeWriting();
+            try
+            {
+                dataOut.Write( value );
+            }
+            catch(Exception e)
+            {
+                throw NMSExceptionSupport.Create(e);
+            }
+        }
+
+        public int ReadBytes( byte[] value )
+        {
+            InitializeReading();
+            try
+            {
+                return dataIn.Read( value, 0, value.Length );
+            }
+            catch(EndOfStreamException e)
+            {
+                throw NMSExceptionSupport.CreateMessageEOFException(e);
+            }
+            catch(IOException e)
+            {
+                throw NMSExceptionSupport.CreateMessageFormatException(e);
+            }
+        }
+
+        public int ReadBytes( byte[] value, int length )
+        {
+            InitializeReading();
+            try
+            {
+                return dataIn.Read( value, 0, length );
+            }
+            catch(EndOfStreamException e)
+            {
+                throw NMSExceptionSupport.CreateMessageEOFException(e);
+            }
+            catch(IOException e)
+            {
+                throw NMSExceptionSupport.CreateMessageFormatException(e);
+            }
+        }
+
+        public void WriteBytes( byte[] value )
+        {
+            InitializeWriting();
+            try
+            {
+                dataOut.Write( value, 0, value.Length );
+            }
+            catch(Exception e)
+            {
+                throw NMSExceptionSupport.Create(e);
+            }
+        }
+
+        public void WriteBytes( byte[] value, int offset, int length )
+        {
+            InitializeWriting();
+            try
+            {
+                dataOut.Write( value, offset, length );
+            }
+            catch(Exception e)
+            {
+                throw NMSExceptionSupport.Create(e);
+            }
+        }
+
+        public string ReadString()
+        {
+            InitializeReading();
+            try
+            {
+                // JMS, CMS and NMS all encode the String using a 16 bit size header.
+                return dataIn.ReadString16();
+            }
+            catch(EndOfStreamException e)
+            {
+                throw NMSExceptionSupport.CreateMessageEOFException(e);
+            }
+            catch(IOException e)
+            {
+                throw NMSExceptionSupport.CreateMessageFormatException(e);
+            }
+        }
+
+        public void WriteString( string value )
+        {
+            InitializeWriting();
+            try
+            {
+                // JMS, CMS and NMS all encode the String using a 16 bit size header.
+                dataOut.WriteString16(value);
+            }
+            catch(Exception e)
+            {
+                throw NMSExceptionSupport.Create(e);
+            }
+        }
+
+        public void WriteObject( System.Object value )
+        {
+            InitializeWriting();
+            if( value is System.Byte )
+            {
+                this.dataOut.Write( (byte) value );
+            }
+            else if( value is Char )
+            {
+                this.dataOut.Write( (char) value );
+            }
+            else if( value is Boolean )
+            {
+                this.dataOut.Write( (bool) value );
+            }
+            else if( value is Int16 )
+            {
+                this.dataOut.Write( (short) value );
+            }
+            else if( value is Int32 )
+            {
+                this.dataOut.Write( (int) value );
+            }
+            else if( value is Int64 )
+            {
+                this.dataOut.Write( (long) value );
+            }
+            else if( value is Single )
+            {
+                this.dataOut.Write( (float) value );
+            }
+            else if( value is Double )
+            {
+                this.dataOut.Write( (double) value );
+            }
+            else if( value is byte[] )
+            {
+                this.dataOut.Write( (byte[]) value );
+            }
+            else if( value is String )
+            {
+                this.dataOut.WriteString16( (string) value );
+            }
+            else
+            {
+                throw new MessageFormatException("Cannot write non-primitive type:" + value.GetType());
+            }
+        }
+
+        public new byte[] Content
+        {
+            get
+            {
+                byte[] buffer = null;
+                InitializeReading();
+                if(this.length != 0)
+                {
+                    buffer = new byte[this.length];
+                    this.dataIn.Read(buffer, 0, buffer.Length);
+                }
+                return buffer;
+            }
+
+            set
+            {
+                InitializeWriting();
+                this.dataOut.Write(value, 0, value.Length);
+            }
+        }
+
+        public void Reset()
+        {
+            StoreContent();
+            this.dataIn = null;
+            this.dataOut = null;
+            this.outputBuffer = null;
+            this.ReadOnlyBody = true;
+        }
+
+        private void InitializeReading()
+        {
+            FailIfWriteOnlyBody();
+            if(this.dataIn == null)
+            {
+                byte[] data = base.Content;
+
+                if(base.Content == null)
+                {
+                    data = new byte[0];
+                }
+
+                Stream target = new MemoryStream(data, false);
+
+                this.length = data.Length;
+                this.dataIn = new EndianBinaryReader(target);
+            }
+        }
+
+        private void InitializeWriting()
+        {
+            FailIfReadOnlyBody();
+            if(this.dataOut == null)
+            {
+                this.outputBuffer = new MemoryStream();
+                this.dataOut = new EndianBinaryWriter(this.outputBuffer);
+            }
+        }
+
+        private void StoreContent()
+        {
+            if(this.dataOut != null)
+            {
+                this.dataOut.Close();
+                base.Content = outputBuffer.ToArray();
+
+                this.dataOut = null;
+                this.outputBuffer = null;
+            }
+        }
+
+    }
+}
+

Propchange: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/BytesMessage.cs
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/BytesMessage.cs
------------------------------------------------------------------------------
    svn:executable = *

Added: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/Destination.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/Destination.cs?rev=989852&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/Destination.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/Destination.cs Thu Aug 26 18:04:52 2010
@@ -0,0 +1,370 @@
+/*
+ * 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.Specialized;
+using Apache.NMS.Util;
+
+namespace Apache.NMS.Commands
+{
+    /// <summary>
+    /// Summary description for Destination.
+    /// </summary>
+    public abstract class Destination : IDestination, ICloneable
+    {
+        /// <summary>
+        /// Topic Destination object
+        /// </summary>
+        public const int TOPIC = 1;
+        /// <summary>
+        /// Temporary Topic Destination object
+        /// </summary>
+        public const int TEMPORARY_TOPIC = 2;
+        /// <summary>
+        /// Queue Destination object
+        /// </summary>
+        public const int QUEUE = 3;
+        /// <summary>
+        /// Temporary Queue Destination object
+        /// </summary>
+        public const int TEMPORARY_QUEUE = 4;
+
+        private const String TEMP_PREFIX = "{TD{";
+        private const String TEMP_POSTFIX = "}TD}";
+
+        private String physicalName = "";
+        private StringDictionary options = null;
+
+        /// <summary>
+        /// The Default Constructor
+        /// </summary>
+        protected Destination()
+        {
+        }
+
+        /// <summary>
+        /// Construct the Destination with a defined physical name;
+        /// </summary>
+        /// <param name="name"></param>
+        protected Destination(String name)
+        {
+            setPhysicalName(name);
+        }
+
+        public bool IsTopic
+        {
+            get
+            {
+                int destinationType = GetDestinationType();
+                return TOPIC == destinationType
+                    || TEMPORARY_TOPIC == destinationType;
+            }
+        }
+
+        public bool IsQueue
+        {
+            get
+            {
+                int destinationType = GetDestinationType();
+                return QUEUE == destinationType
+                    || TEMPORARY_QUEUE == destinationType;
+            }
+        }
+
+        public bool IsTemporary
+        {
+            get
+            {
+                int destinationType = GetDestinationType();
+                return TEMPORARY_QUEUE == destinationType
+                    || TEMPORARY_TOPIC == destinationType;
+            }
+        }
+
+        /// <summary>
+        /// Dictionary of name/value pairs representing option values specified
+        /// in the URI used to create this Destination.  A null value is returned
+        /// if no options were specified.
+        /// </summary>
+        internal StringDictionary Options
+        {
+            get { return this.options; }
+        }
+
+        private void setPhysicalName(string name)
+        {
+            this.physicalName = name;
+
+            int p = name.IndexOf('?');
+            if(p >= 0)
+            {
+                String optstring = physicalName.Substring(p + 1);
+                this.physicalName = name.Substring(0, p);
+                options = URISupport.ParseQuery(optstring);
+            }
+        }
+
+        /// <summary>
+        /// </summary>
+        /// <param name="destination"></param>
+        /// <returns></returns>
+        public static Destination Transform(IDestination destination)
+        {
+            Destination result = null;
+            if(destination != null)
+            {
+                if(destination is Destination)
+                {
+                    result = (Destination) destination;
+                }
+                else
+                {
+                    if(destination is ITemporaryQueue)
+                    {
+                        result = new TempQueue(((IQueue) destination).QueueName);
+                    }
+                    else if(destination is ITemporaryTopic)
+                    {
+                        result = new TempTopic(((ITopic) destination).TopicName);
+                    }
+                    else if(destination is IQueue)
+                    {
+                        result = new Queue(((IQueue) destination).QueueName);
+                    }
+                    else if(destination is ITopic)
+                    {
+                        result = new Topic(((ITopic) destination).TopicName);
+                    }
+                }
+            }
+            return result;
+        }
+
+        /// <summary>
+        /// Create a Destination
+        /// </summary>
+        /// <param name="type"></param>
+        /// <param name="pyhsicalName"></param>
+        /// <returns></returns>
+        public static Destination CreateDestination(int type, String pyhsicalName)
+        {
+            Destination result = null;
+            if(pyhsicalName == null)
+            {
+                return null;
+            }
+            else if(type == TOPIC)
+            {
+                result = new Topic(pyhsicalName);
+            }
+            else if(type == TEMPORARY_TOPIC)
+            {
+                result = new TempTopic(pyhsicalName);
+            }
+            else if(type == QUEUE)
+            {
+                result = new Queue(pyhsicalName);
+            }
+            else
+            {
+                result = new TempQueue(pyhsicalName);
+            }
+            return result;
+        }
+
+        /// <summary>
+        /// Create a temporary name from the clientId
+        /// </summary>
+        /// <param name="clientId"></param>
+        /// <returns></returns>
+        public static String CreateTemporaryName(String clientId)
+        {
+            return TEMP_PREFIX + clientId + TEMP_POSTFIX;
+        }
+
+        /// <summary>
+        /// From a temporary destination find the clientId of the Connection that created it
+        /// </summary>
+        /// <param name="destination"></param>
+        /// <returns>the clientId or null if not a temporary destination</returns>
+        public static String GetClientId(Destination destination)
+        {
+            String answer = null;
+            if(destination != null && destination.IsTemporary)
+            {
+                String name = destination.PhysicalName;
+                int start = name.IndexOf(TEMP_PREFIX);
+                if(start >= 0)
+                {
+                    start += TEMP_PREFIX.Length;
+                    int stop = name.LastIndexOf(TEMP_POSTFIX);
+                    if(stop > start && stop < name.Length)
+                    {
+                        answer = name.Substring(start, stop);
+                    }
+                }
+            }
+            return answer;
+        }
+
+        /// <summary>
+        /// </summary>
+        /// <param name="o">object to compare</param>
+        /// <returns>1 if this is less than o else 0 if they are equal or -1 if this is less than o</returns>
+        public int CompareTo(Object o)
+        {
+            if(o is Destination)
+            {
+                return CompareTo((Destination) o);
+            }
+            return -1;
+        }
+
+        /// <summary>
+        /// Lets sort by name first then lets sort topics greater than queues
+        /// </summary>
+        /// <param name="that">another destination to compare against</param>
+        /// <returns>1 if this is less than o else 0 if they are equal or -1 if this is less than o</returns>
+        public int CompareTo(Destination that)
+        {
+            int answer = 0;
+            if(physicalName != that.physicalName)
+            {
+                if(physicalName == null)
+                {
+                    return -1;
+                }
+                else if(that.physicalName == null)
+                {
+                    return 1;
+                }
+                answer = physicalName.CompareTo(that.physicalName);
+            }
+
+            if(answer == 0)
+            {
+                if(IsTopic)
+                {
+                    if(that.IsQueue)
+                    {
+                        return 1;
+                    }
+                }
+                else
+                {
+                    if(that.IsTopic)
+                    {
+                        return -1;
+                    }
+                }
+            }
+            return answer;
+        }
+
+        /// <summary>
+        /// </summary>
+        /// <returns>Returns the Destination type</returns>
+        public abstract int GetDestinationType();
+
+        public String PhysicalName
+        {
+            get { return this.physicalName; }
+            set
+            {
+                this.physicalName = value;
+            }
+        }
+
+        /// <summary>
+        /// </summary>
+        /// <returns>string representation of this instance</returns>
+        public override String ToString()
+        {
+            switch(DestinationType)
+            {
+            case DestinationType.Topic:
+            return "topic://" + PhysicalName;
+
+            case DestinationType.TemporaryTopic:
+            return "temp-topic://" + PhysicalName;
+
+            case DestinationType.TemporaryQueue:
+            return "temp-queue://" + PhysicalName;
+
+            default:
+            return "queue://" + PhysicalName;
+            }
+        }
+
+        /// <summary>
+        /// </summary>
+        /// <returns>hashCode for this instance</returns>
+        public override int GetHashCode()
+        {
+            int answer = 37;
+
+            if(this.physicalName != null)
+            {
+                answer = physicalName.GetHashCode();
+            }
+            if(IsTopic)
+            {
+                answer ^= 0xfabfab;
+            }
+            return answer;
+        }
+
+        /// <summary>
+        /// if the object passed in is equivalent, return true
+        /// </summary>
+        /// <param name="obj">the object to compare</param>
+        /// <returns>true if this instance and obj are equivalent</returns>
+        public override bool Equals(Object obj)
+        {
+            bool result = this == obj;
+            if(!result && obj != null && obj is Destination)
+            {
+                Destination other = (Destination) obj;
+                result = this.GetDestinationType() == other.GetDestinationType()
+                    && this.physicalName.Equals(other.physicalName);
+            }
+            return result;
+        }
+
+        /// <summary>
+        /// Factory method to create a child destination if this destination is a composite
+        /// </summary>
+        /// <param name="name"></param>
+        /// <returns>the created Destination</returns>
+        public abstract Destination CreateDestination(String name);
+
+        public abstract DestinationType DestinationType
+        {
+            get;
+        }
+
+        public virtual Object Clone()
+        {
+            // Since we are the lowest level base class, do a
+            // shallow copy which will include the derived classes.
+            // From here we would do deep cloning of other objects
+            // if we had any.
+            return this.MemberwiseClone();
+        }
+    }
+}
+

Propchange: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/Destination.cs
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/Destination.cs
------------------------------------------------------------------------------
    svn:executable = *

Added: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/MapMessage.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/MapMessage.cs?rev=989852&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/MapMessage.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/MapMessage.cs Thu Aug 26 18:04:52 2010
@@ -0,0 +1,90 @@
+/*
+ * 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.IO;
+using Apache.NMS;
+using Apache.NMS.Util;
+
+namespace Apache.NMS.Commands
+{
+    public class MapMessage : Message, IMapMessage
+    {
+        private PrimitiveMap body;
+        private PrimitiveMapInterceptor typeConverter;
+
+        public MapMessage() : base()
+        {
+        }
+
+        public MapMessage(PrimitiveMap body) : base()
+        {
+            this.body = body;
+            this.typeConverter = new PrimitiveMapInterceptor(this, this.body);
+        }
+
+        public override void ClearBody()
+        {
+            this.body = null;
+            this.typeConverter = null;
+            base.ClearBody();
+        }
+
+        public override bool ReadOnlyBody
+        {
+            get { return base.ReadOnlyBody; }
+
+            set
+            {
+                if(this.typeConverter != null)
+                {
+                    this.typeConverter.ReadOnly = true;
+                }
+
+                base.ReadOnlyBody = value;
+            }
+        }
+
+
+        public IPrimitiveMap Body
+        {
+            get
+            {
+                if(this.body == null)
+                {
+                    this.body = new PrimitiveMap();
+                    this.typeConverter = new PrimitiveMapInterceptor(this, this.body);
+                }
+
+                return this.typeConverter;
+            }
+
+            set
+            {
+                this.body = value as PrimitiveMap;
+                if(value != null)
+                {
+                    this.typeConverter = new PrimitiveMapInterceptor(this, value);
+                }
+                else
+                {
+                    this.typeConverter = null;
+                }
+            }
+        }
+    }
+}

Propchange: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/MapMessage.cs
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/MapMessage.cs
------------------------------------------------------------------------------
    svn:executable = *

Added: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/Message.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/Message.cs?rev=989852&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/Message.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/Message.cs Thu Aug 26 18:04:52 2010
@@ -0,0 +1,329 @@
+/*
+ * 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;
+
+using Apache.NMS.Util;
+
+namespace Apache.NMS.Commands
+{
+    public class Message : IMessage, ICloneable
+    {
+        private IDestination destination;
+        private string transactionId;
+        private string messageId;
+        private string groupID;
+		private int groupSequence;
+        private string correlationId;
+        private bool persistent;
+        private long expiration;
+        private byte priority;
+        private IDestination replyTo;
+        private long timestamp;
+        private string type;
+        private bool redelivered;
+        private byte[] content;
+        private bool readOnlyMsgProperties;
+        private bool readOnlyMsgBody;
+
+        private MessagePropertyIntercepter propertyHelper;
+        private PrimitiveMap properties;
+
+        ///
+        /// <summery>
+        ///  Clone this object and return a new instance that the caller now owns.
+        /// </summery>
+        ///
+        public virtual Object Clone()
+        {
+            // Since we are the lowest level base class, do a
+            // shallow copy which will include the derived classes.
+            // From here we would do deep cloning of other objects
+            // if we had any.
+            Message o = (Message) this.MemberwiseClone();
+
+            if(this.messageId != null)
+            {
+                o.NMSMessageId = (string) this.messageId.Clone();
+            }
+			
+			return o;
+		}		
+
+        ///
+        /// <summery>
+        ///  Returns a string containing the information for this DataStructure
+        ///  such as its type and value of its elements.
+        /// </summery>
+        ///
+        public override string ToString()
+        {
+            return GetType().Name + "[" +
+                "Destination=" + destination + ", " +
+                "TransactionId=" + transactionId + ", " +
+                "MessageId=" + messageId + ", " +
+                "GroupID=" + groupID + ", " +
+                "GroupSequence=" + groupSequence + ", " +
+                "CorrelationId=" + correlationId + ", " +
+                "Expiration=" + expiration + ", " +
+                "Priority=" + priority + ", " +
+                "ReplyTo=" + replyTo + ", " +
+                "Timestamp=" + timestamp + ", " +
+                "Type=" + type + ", " +
+                "Redelivered=" + redelivered +
+                "]";
+        }
+
+        public void Acknowledge()
+        {
+        }
+		
+        public virtual void ClearBody()
+        {
+			this.content = null;
+        }
+
+        public virtual void ClearProperties()
+        {
+            this.properties.Clear();
+        }
+		
+        protected void FailIfReadOnlyBody()
+        {
+            if(ReadOnlyBody == true)
+            {
+                throw new MessageNotWriteableException("Message is in Read-Only mode.");
+            }
+        }
+
+        protected void FailIfWriteOnlyBody()
+        {
+            if(ReadOnlyBody == false)
+            {
+                throw new MessageNotReadableException("Message is in Write-Only mode.");
+            }
+        }
+		
+        #region Properties
+		
+		public string TransactionId
+		{
+			get { return this.transactionId; }
+			set { this.transactionId = value; }
+		}
+
+        public byte[] Content
+        {
+            get { return content; }
+            set { this.content = value; }
+        }
+		
+        public virtual bool ReadOnlyProperties
+        {
+            get { return this.readOnlyMsgProperties; }
+            set { this.readOnlyMsgProperties = value; }
+        }
+
+        public virtual bool ReadOnlyBody
+        {
+            get { return this.readOnlyMsgBody; }
+            set { this.readOnlyMsgBody = value; }
+        }
+		
+        public IPrimitiveMap Properties
+        {
+            get
+            {
+                if(null == properties)
+                {
+                    properties = new PrimitiveMap();
+                    propertyHelper = new MessagePropertyIntercepter(this, properties, this.ReadOnlyProperties);
+                    propertyHelper.AllowByteArrays = false;
+                }
+
+                return propertyHelper;
+            }
+        }
+
+        /// <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; }
+            set { this.destination = Destination.Transform(value); }
+        }
+
+        private TimeSpan timeToLive = TimeSpan.FromMilliseconds(0);
+        /// <summary>
+        /// The time in milliseconds that this message should expire in
+        /// </summary>
+        public TimeSpan NMSTimeToLive
+        {
+            get { return timeToLive; }
+
+            set
+            {
+                timeToLive = value;
+                if(timeToLive.TotalMilliseconds > 0)
+                {
+                    long timeStamp = timestamp;
+
+                    if(timeStamp == 0)
+                    {
+                        timeStamp = DateUtils.ToJavaTimeUtc(DateTime.UtcNow);
+                    }
+
+                    expiration = timeStamp + (long) timeToLive.TotalMilliseconds;
+                }
+                else
+                {
+                    expiration = 0;
+                }
+            }
+        }
+
+        /// <summary>
+        /// The timestamp the broker added to the message
+        /// </summary>
+        public DateTime NMSTimestamp
+        {
+            get { return DateUtils.ToDateTime(timestamp); }
+            set
+            {
+                timestamp = DateUtils.ToJavaTimeUtc(value);
+                if(timeToLive.TotalMilliseconds > 0)
+                {
+                    expiration = timestamp + (long) timeToLive.TotalMilliseconds;
+                }
+            }
+        }
+
+        /// <summary>
+        /// The message ID which is set by the provider
+        /// </summary>
+        public string NMSMessageId
+        {
+            get { return this.messageId; }
+            set { this.messageId = value; }
+        }
+
+        /// <summary>
+        /// Whether or not this message is persistent
+        /// </summary>
+        public MsgDeliveryMode NMSDeliveryMode
+        {
+            get { return (persistent ? MsgDeliveryMode.Persistent : MsgDeliveryMode.NonPersistent); }
+            set { persistent = (MsgDeliveryMode.Persistent == value); }
+        }
+
+        /// <summary>
+        /// The Priority on this message
+        /// </summary>
+        public MsgPriority NMSPriority
+        {
+            get { return (MsgPriority) priority; }
+            set { priority = (byte) 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 this.redelivered; }
+            set { this.redelivered = value; }
+        }
+
+        /// <summary>
+        /// The destination that the consumer of this message should send replies to
+        /// </summary>
+        public IDestination NMSReplyTo
+        {
+            get { return replyTo; }
+            set { replyTo = Destination.Transform(value); }
+        }
+
+        /// <summary>
+        /// The type name of this message
+        /// </summary>
+        public string NMSType
+        {
+            get { return type; }
+            set { type = value; }
+        }
+
+        #endregion
+
+        #region NMS Extension headers
+
+        /// <summary>
+        /// Returns the number of times this message has been redelivered to other consumers without being acknowledged successfully.
+        /// </summary>
+        public int NMSXDeliveryCount
+        {
+            get { return 0; }
+        }
+
+        /// <summary>
+        /// The Message Group ID used to group messages together to the same consumer for the same group ID value
+        /// </summary>
+        public string NMSXGroupID
+        {
+            get { return groupID; }
+            set { groupID = value; }
+        }
+        /// <summary>
+        /// The Message Group Sequence counter to indicate the position in a group
+        /// </summary>
+        public int NMSXGroupSeq
+        {
+            get { return groupSequence; }
+            set { groupSequence = value; }
+        }
+
+        /// <summary>
+        /// Returns the ID of the producers transaction
+        /// </summary>
+        public string NMSXProducerTXID
+        {
+            get
+            {
+                if(null != transactionId)
+                {
+                    return transactionId;
+                }
+
+                return String.Empty;
+            }
+        }
+
+        #endregion
+
+    };
+}
+

Propchange: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/Message.cs
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/Message.cs
------------------------------------------------------------------------------
    svn:executable = *

Added: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/ObjectMessage.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/ObjectMessage.cs?rev=989852&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/ObjectMessage.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/ObjectMessage.cs Thu Aug 26 18:04:52 2010
@@ -0,0 +1,44 @@
+/*
+* 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;
+using System.IO;
+
+using Apache.NMS;
+
+namespace Apache.NMS.Commands
+{
+    public class ObjectMessage : Message, IObjectMessage
+    {
+        private object body;
+
+        public override string ToString() {
+            return GetType().Name + "["
+                + " ]";
+        }
+
+        // Properties
+
+        public object Body
+        {
+            get { return body; }
+            set { body = value; }
+        }
+
+    }
+}

Propchange: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/ObjectMessage.cs
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/ObjectMessage.cs
------------------------------------------------------------------------------
    svn:executable = *

Added: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/Queue.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/Queue.cs?rev=989852&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/Queue.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/Queue.cs Thu Aug 26 18:04:52 2010
@@ -0,0 +1,75 @@
+/*
+ * 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;
+
+namespace Apache.NMS.Commands
+{
+    /// <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 PhysicalName; }
+        }
+
+        public override int GetDestinationType()
+        {
+            return QUEUE;
+        }
+
+        public override Destination CreateDestination(String name)
+        {
+            return new Queue(name);
+        }
+
+        public override Object Clone()
+        {
+            // Since we are a derived class use the base's Clone()
+            // to perform the shallow copy. Since it is shallow it
+            // will include our derived class. Since we are derived,
+            // this method is an override.
+            Queue o = (Queue) base.Clone();
+
+            // Now do the deep work required
+            // If any new variables are added then this routine will
+            // likely need updating
+
+            return o;
+        }
+    }
+}
+

Propchange: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/Queue.cs
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/Queue.cs
------------------------------------------------------------------------------
    svn:executable = *

Added: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/StreamMessage.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/StreamMessage.cs?rev=989852&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/StreamMessage.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/StreamMessage.cs Thu Aug 26 18:04:52 2010
@@ -0,0 +1,901 @@
+/*
+ * 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.IO;
+using System.Collections;
+
+using Apache.NMS;
+using Apache.NMS.Util;
+
+namespace Apache.NMS.Commands
+{
+    public class StreamMessage : Message, IStreamMessage
+    {
+        private EndianBinaryReader dataIn = null;
+        private EndianBinaryWriter dataOut = null;
+        private MemoryStream byteBuffer = null;
+        private int bytesRemaining = -1;
+
+        public bool ReadBoolean()
+        {
+            InitializeReading();
+
+            try
+            {
+                long startingPos = this.byteBuffer.Position;
+                try
+                {
+                    int type = this.dataIn.ReadByte();
+
+                    if(type == PrimitiveMap.BOOLEAN_TYPE)
+                    {
+                        return this.dataIn.ReadBoolean();
+                    }
+                    else if(type == PrimitiveMap.STRING_TYPE)
+                    {
+                        return Boolean.Parse(this.dataIn.ReadString16());
+                    }
+                    else if(type == PrimitiveMap.NULL)
+                    {
+                        this.byteBuffer.Seek(startingPos, SeekOrigin.Begin);
+                        throw new NMSException("Cannot convert Null type to a bool");
+                    }
+                    else
+                    {
+                        this.byteBuffer.Seek(startingPos, SeekOrigin.Begin);
+                        throw new MessageFormatException("Value is not a Boolean type.");
+                    }
+                }
+                catch(FormatException e)
+                {
+                    this.byteBuffer.Seek(startingPos, SeekOrigin.Begin);
+                    throw NMSExceptionSupport.CreateMessageFormatException(e);
+                }
+            }
+            catch(EndOfStreamException e)
+            {
+                throw NMSExceptionSupport.CreateMessageEOFException(e);
+            }
+            catch(IOException e)
+            {
+                throw NMSExceptionSupport.CreateMessageFormatException(e);
+            }
+        }
+
+        public byte ReadByte()
+        {
+            InitializeReading();
+
+            try
+            {
+                long startingPos = this.byteBuffer.Position;
+                try
+                {
+                    int type = this.dataIn.ReadByte();
+
+                    if(type == PrimitiveMap.BYTE_TYPE)
+                    {
+                        return this.dataIn.ReadByte();
+                    }
+                    else if(type == PrimitiveMap.STRING_TYPE)
+                    {
+                        return Byte.Parse(this.dataIn.ReadString16());
+                    }
+                    else if(type == PrimitiveMap.NULL)
+                    {
+                        this.byteBuffer.Seek(startingPos, SeekOrigin.Begin);
+                        throw new NMSException("Cannot convert Null type to a byte");
+                    }
+                    else
+                    {
+                        this.byteBuffer.Seek(startingPos, SeekOrigin.Begin);
+                        throw new MessageFormatException("Value is not a Byte type.");
+                    }
+                }
+                catch(FormatException e)
+                {
+                    this.byteBuffer.Seek(startingPos, SeekOrigin.Begin);
+                    throw NMSExceptionSupport.CreateMessageFormatException(e);
+                }
+            }
+            catch(EndOfStreamException e)
+            {
+                throw NMSExceptionSupport.CreateMessageEOFException(e);
+            }
+            catch(IOException e)
+            {
+                throw NMSExceptionSupport.CreateMessageFormatException(e);
+            }
+        }
+
+        public char ReadChar()
+        {
+            InitializeReading();
+
+            try
+            {
+                long startingPos = this.byteBuffer.Position;
+                try
+                {
+                    int type = this.dataIn.ReadByte();
+
+                    if(type == PrimitiveMap.CHAR_TYPE)
+                    {
+                        return this.dataIn.ReadChar();
+                    }
+                    else if(type == PrimitiveMap.NULL)
+                    {
+                        this.byteBuffer.Seek(startingPos, SeekOrigin.Begin);
+                        throw new NMSException("Cannot convert Null type to a char");
+                    }
+                    else
+                    {
+                        this.byteBuffer.Seek(startingPos, SeekOrigin.Begin);
+                        throw new MessageFormatException("Value is not a Char type.");
+                    }
+                }
+                catch(FormatException e)
+                {
+                    this.byteBuffer.Seek(startingPos, SeekOrigin.Begin);
+                    throw NMSExceptionSupport.CreateMessageFormatException(e);
+                }
+            }
+            catch(EndOfStreamException e)
+            {
+                throw NMSExceptionSupport.CreateMessageEOFException(e);
+            }
+            catch(IOException e)
+            {
+                throw NMSExceptionSupport.CreateMessageFormatException(e);
+            }
+        }
+
+        public short ReadInt16()
+        {
+            InitializeReading();
+
+            try
+            {
+                long startingPos = this.byteBuffer.Position;
+                try
+                {
+                    int type = this.dataIn.ReadByte();
+
+                    if(type == PrimitiveMap.SHORT_TYPE)
+                    {
+                        return this.dataIn.ReadInt16();
+                    }
+                    else if(type == PrimitiveMap.BYTE_TYPE)
+                    {
+                        return this.dataIn.ReadByte();
+                    }
+                    else if(type == PrimitiveMap.STRING_TYPE)
+                    {
+                        return Int16.Parse(this.dataIn.ReadString16());
+                    }
+                    else if(type == PrimitiveMap.NULL)
+                    {
+                        this.byteBuffer.Seek(startingPos, SeekOrigin.Begin);
+                        throw new NMSException("Cannot convert Null type to a short");
+                    }
+                    else
+                    {
+                        this.byteBuffer.Seek(startingPos, SeekOrigin.Begin);
+                        throw new MessageFormatException("Value is not a Int16 type.");
+                    }
+                }
+                catch(FormatException e)
+                {
+                    this.byteBuffer.Seek(startingPos, SeekOrigin.Begin);
+                    throw NMSExceptionSupport.CreateMessageFormatException(e);
+                }
+            }
+            catch(EndOfStreamException e)
+            {
+                throw NMSExceptionSupport.CreateMessageEOFException(e);
+            }
+            catch(IOException e)
+            {
+                throw NMSExceptionSupport.CreateMessageFormatException(e);
+            }
+        }
+
+        public int ReadInt32()
+        {
+            InitializeReading();
+
+            try
+            {
+                long startingPos = this.byteBuffer.Position;
+                try
+                {
+                    int type = this.dataIn.ReadByte();
+
+                    if(type == PrimitiveMap.INTEGER_TYPE)
+                    {
+                        return this.dataIn.ReadInt32();
+                    }
+                    else if(type == PrimitiveMap.SHORT_TYPE)
+                    {
+                        return this.dataIn.ReadInt16();
+                    }
+                    else if(type == PrimitiveMap.BYTE_TYPE)
+                    {
+                        return this.dataIn.ReadByte();
+                    }
+                    else if(type == PrimitiveMap.STRING_TYPE)
+                    {
+                        return Int32.Parse(this.dataIn.ReadString16());
+                    }
+                    else if(type == PrimitiveMap.NULL)
+                    {
+                        this.byteBuffer.Seek(startingPos, SeekOrigin.Begin);
+                        throw new NMSException("Cannot convert Null type to a int");
+                    }
+                    else
+                    {
+                        this.byteBuffer.Seek(startingPos, SeekOrigin.Begin);
+                        throw new MessageFormatException("Value is not a Int32 type.");
+                    }
+                }
+                catch(FormatException e)
+                {
+                    this.byteBuffer.Seek(startingPos, SeekOrigin.Begin);
+                    throw NMSExceptionSupport.CreateMessageFormatException(e);
+                }
+            }
+            catch(EndOfStreamException e)
+            {
+                throw NMSExceptionSupport.CreateMessageEOFException(e);
+            }
+            catch(IOException e)
+            {
+                throw NMSExceptionSupport.CreateMessageFormatException(e);
+            }
+        }
+
+        public long ReadInt64()
+        {
+            InitializeReading();
+
+            try
+            {
+                long startingPos = this.byteBuffer.Position;
+                try
+                {
+                    int type = this.dataIn.ReadByte();
+
+                    if(type == PrimitiveMap.LONG_TYPE)
+                    {
+                        return this.dataIn.ReadInt64();
+                    }
+                    else if(type == PrimitiveMap.INTEGER_TYPE)
+                    {
+                        return this.dataIn.ReadInt32();
+                    }
+                    else if(type == PrimitiveMap.SHORT_TYPE)
+                    {
+                        return this.dataIn.ReadInt16();
+                    }
+                    else if(type == PrimitiveMap.BYTE_TYPE)
+                    {
+                        return this.dataIn.ReadByte();
+                    }
+                    else if(type == PrimitiveMap.STRING_TYPE)
+                    {
+                        return Int64.Parse(this.dataIn.ReadString16());
+                    }
+                    else if(type == PrimitiveMap.NULL)
+                    {
+                        this.byteBuffer.Seek(startingPos, SeekOrigin.Begin);
+                        throw new NMSException("Cannot convert Null type to a long");
+                    }
+                    else
+                    {
+                        this.byteBuffer.Seek(startingPos, SeekOrigin.Begin);
+                        throw new MessageFormatException("Value is not a Int64 type.");
+                    }
+                }
+                catch(FormatException e)
+                {
+                    this.byteBuffer.Seek(startingPos, SeekOrigin.Begin);
+                    throw NMSExceptionSupport.CreateMessageFormatException(e);
+                }
+            }
+            catch(EndOfStreamException e)
+            {
+                throw NMSExceptionSupport.CreateMessageEOFException(e);
+            }
+            catch(IOException e)
+            {
+                throw NMSExceptionSupport.CreateMessageFormatException(e);
+            }
+        }
+
+        public float ReadSingle()
+        {
+            InitializeReading();
+
+            try
+            {
+                long startingPos = this.byteBuffer.Position;
+                try
+                {
+                    int type = this.dataIn.ReadByte();
+
+                    if(type == PrimitiveMap.FLOAT_TYPE)
+                    {
+                        return this.dataIn.ReadSingle();
+                    }
+                    else if(type == PrimitiveMap.STRING_TYPE)
+                    {
+                        return Single.Parse(this.dataIn.ReadString16());
+                    }
+                    else if(type == PrimitiveMap.NULL)
+                    {
+                        this.byteBuffer.Seek(startingPos, SeekOrigin.Begin);
+                        throw new NMSException("Cannot convert Null type to a float");
+                    }
+                    else
+                    {
+                        this.byteBuffer.Seek(startingPos, SeekOrigin.Begin);
+                        throw new MessageFormatException("Value is not a Single type.");
+                    }
+                }
+                catch(FormatException e)
+                {
+                    this.byteBuffer.Seek(startingPos, SeekOrigin.Begin);
+                    throw NMSExceptionSupport.CreateMessageFormatException(e);
+                }
+            }
+            catch(EndOfStreamException e)
+            {
+                throw NMSExceptionSupport.CreateMessageEOFException(e);
+            }
+            catch(IOException e)
+            {
+                throw NMSExceptionSupport.CreateMessageFormatException(e);
+            }
+        }
+
+        public double ReadDouble()
+        {
+            InitializeReading();
+
+            try
+            {
+                long startingPos = this.byteBuffer.Position;
+                try
+                {
+                    int type = this.dataIn.ReadByte();
+
+                    if(type == PrimitiveMap.DOUBLE_TYPE)
+                    {
+                        return this.dataIn.ReadDouble();
+                    }
+                    else if(type == PrimitiveMap.FLOAT_TYPE)
+                    {
+                        return this.dataIn.ReadSingle();
+                    }
+                    else if(type == PrimitiveMap.STRING_TYPE)
+                    {
+                        return Single.Parse(this.dataIn.ReadString16());
+                    }
+                    else if(type == PrimitiveMap.NULL)
+                    {
+                        this.byteBuffer.Seek(startingPos, SeekOrigin.Begin);
+                        throw new NMSException("Cannot convert Null type to a double");
+                    }
+                    else
+                    {
+                        this.byteBuffer.Seek(startingPos, SeekOrigin.Begin);
+                        throw new MessageFormatException("Value is not a Double type.");
+                    }
+                }
+                catch(FormatException e)
+                {
+                    this.byteBuffer.Seek(startingPos, SeekOrigin.Begin);
+                    throw NMSExceptionSupport.CreateMessageFormatException(e);
+                }
+            }
+            catch(EndOfStreamException e)
+            {
+                throw NMSExceptionSupport.CreateMessageEOFException(e);
+            }
+            catch(IOException e)
+            {
+                throw NMSExceptionSupport.CreateMessageFormatException(e);
+            }
+        }
+
+        public string ReadString()
+        {
+            InitializeReading();
+
+            long startingPos = this.byteBuffer.Position;
+
+            try
+            {
+                int type = this.dataIn.ReadByte();
+
+                if(type == PrimitiveMap.BIG_STRING_TYPE)
+                {
+                    return this.dataIn.ReadString32();
+                }
+                else if(type == PrimitiveMap.STRING_TYPE)
+                {
+                    return this.dataIn.ReadString16();
+                }
+                else if(type == PrimitiveMap.LONG_TYPE)
+                {
+                    return this.dataIn.ReadInt64().ToString();
+                }
+                else if(type == PrimitiveMap.INTEGER_TYPE)
+                {
+                    return this.dataIn.ReadInt32().ToString();
+                }
+                else if(type == PrimitiveMap.SHORT_TYPE)
+                {
+                    return this.dataIn.ReadInt16().ToString();
+                }
+                else if(type == PrimitiveMap.FLOAT_TYPE)
+                {
+                    return this.dataIn.ReadSingle().ToString();
+                }
+                else if(type == PrimitiveMap.DOUBLE_TYPE)
+                {
+                    return this.dataIn.ReadDouble().ToString();
+                }
+                else if(type == PrimitiveMap.CHAR_TYPE)
+                {
+                    return this.dataIn.ReadChar().ToString();
+                }
+                else if(type == PrimitiveMap.BYTE_TYPE)
+                {
+                    return this.dataIn.ReadByte().ToString();
+                }
+                else if(type == PrimitiveMap.BOOLEAN_TYPE)
+                {
+                    return this.dataIn.ReadBoolean().ToString();
+                }
+                else if(type == PrimitiveMap.NULL)
+                {
+                    return null;
+                }
+                else
+                {
+                    this.byteBuffer.Seek(startingPos, SeekOrigin.Begin);
+                    throw new MessageFormatException("Value is not a known type.");
+                }
+            }
+            catch(FormatException e)
+            {
+                this.byteBuffer.Seek(startingPos, SeekOrigin.Begin);
+                throw NMSExceptionSupport.CreateMessageFormatException(e);
+            }
+            catch(EndOfStreamException e)
+            {
+                throw NMSExceptionSupport.CreateMessageEOFException(e);
+            }
+            catch(IOException e)
+            {
+                throw NMSExceptionSupport.CreateMessageFormatException(e);
+            }
+        }
+
+        public int ReadBytes(byte[] value)
+        {
+            InitializeReading();
+
+            if(value == null)
+            {
+                throw new NullReferenceException("Passed Byte Array is null");
+            }
+
+            try
+            {
+                if(this.bytesRemaining == -1)
+                {
+                    long startingPos = this.byteBuffer.Position;
+                    byte type = this.dataIn.ReadByte();
+
+                    if(type != PrimitiveMap.BYTE_ARRAY_TYPE)
+                    {
+                        this.byteBuffer.Seek(startingPos, SeekOrigin.Begin);
+                        throw new MessageFormatException("Not a byte array");
+                    }
+
+                    this.bytesRemaining = this.dataIn.ReadInt32();
+                }
+                else if(this.bytesRemaining == 0)
+                {
+                    this.bytesRemaining = -1;
+                    return -1;
+                }
+
+                if(value.Length <= this.bytesRemaining)
+                {
+                    // small buffer
+                    this.bytesRemaining -= value.Length;
+                    this.dataIn.Read(value, 0, value.Length);
+                    return value.Length;
+                }
+                else
+                {
+                    // big buffer
+                    int rc = this.dataIn.Read(value, 0, this.bytesRemaining);
+                    this.bytesRemaining = 0;
+                    return rc;
+                }
+            }
+            catch(EndOfStreamException ex)
+            {
+                throw NMSExceptionSupport.CreateMessageEOFException(ex);
+            }
+            catch(IOException ex)
+            {
+                throw NMSExceptionSupport.CreateMessageFormatException(ex);
+            }
+        }
+
+        public Object ReadObject()
+        {
+            InitializeReading();
+
+            long startingPos = this.byteBuffer.Position;
+
+            try
+            {
+                int type = this.dataIn.ReadByte();
+
+                if(type == PrimitiveMap.BIG_STRING_TYPE)
+                {
+                    return this.dataIn.ReadString32();
+                }
+                else if(type == PrimitiveMap.STRING_TYPE)
+                {
+                    return this.dataIn.ReadString16();
+                }
+                else if(type == PrimitiveMap.LONG_TYPE)
+                {
+                    return this.dataIn.ReadInt64();
+                }
+                else if(type == PrimitiveMap.INTEGER_TYPE)
+                {
+                    return this.dataIn.ReadInt32();
+                }
+                else if(type == PrimitiveMap.SHORT_TYPE)
+                {
+                    return this.dataIn.ReadInt16();
+                }
+                else if(type == PrimitiveMap.FLOAT_TYPE)
+                {
+                    return this.dataIn.ReadSingle();
+                }
+                else if(type == PrimitiveMap.DOUBLE_TYPE)
+                {
+                    return this.dataIn.ReadDouble();
+                }
+                else if(type == PrimitiveMap.CHAR_TYPE)
+                {
+                    return this.dataIn.ReadChar();
+                }
+                else if(type == PrimitiveMap.BYTE_TYPE)
+                {
+                    return this.dataIn.ReadByte();
+                }
+                else if(type == PrimitiveMap.BOOLEAN_TYPE)
+                {
+                    return this.dataIn.ReadBoolean();
+                }
+                else if(type == PrimitiveMap.BYTE_ARRAY_TYPE)
+                {
+                    int length = this.dataIn.ReadInt32();
+                    byte[] data = new byte[length];
+                    this.dataIn.Read(data, 0, length);
+                    return data;
+                }
+                else if(type == PrimitiveMap.NULL)
+                {
+                    return null;
+                }
+                else
+                {
+                    this.byteBuffer.Seek(startingPos, SeekOrigin.Begin);
+                    throw new MessageFormatException("Value is not a known type.");
+                }
+            }
+            catch(FormatException e)
+            {
+                this.byteBuffer.Seek(startingPos, SeekOrigin.Begin);
+                throw NMSExceptionSupport.CreateMessageFormatException(e);
+            }
+            catch(EndOfStreamException e)
+            {
+                throw NMSExceptionSupport.CreateMessageEOFException(e);
+            }
+            catch(IOException e)
+            {
+                throw NMSExceptionSupport.CreateMessageFormatException(e);
+            }
+        }
+
+        public void WriteBoolean(bool value)
+        {
+            InitializeWriting();
+            try
+            {
+                this.dataOut.Write(PrimitiveMap.BOOLEAN_TYPE);
+                this.dataOut.Write(value);
+            }
+            catch(IOException e)
+            {
+                NMSExceptionSupport.Create(e);
+            }
+        }
+
+        public void WriteByte(byte value)
+        {
+            InitializeWriting();
+            try
+            {
+                this.dataOut.Write(PrimitiveMap.BYTE_TYPE);
+                this.dataOut.Write(value);
+            }
+            catch(IOException e)
+            {
+                NMSExceptionSupport.Create(e);
+            }
+        }
+
+        public void WriteBytes(byte[] value)
+        {
+            InitializeWriting();
+            this.WriteBytes(value, 0, value.Length);
+        }
+
+        public void WriteBytes(byte[] value, int offset, int length)
+        {
+            InitializeWriting();
+            try
+            {
+                this.dataOut.Write(PrimitiveMap.BYTE_ARRAY_TYPE);
+                this.dataOut.Write((int) length);
+                this.dataOut.Write(value, offset, length);
+            }
+            catch(IOException e)
+            {
+                NMSExceptionSupport.Create(e);
+            }
+        }
+
+        public void WriteChar(char value)
+        {
+            InitializeWriting();
+            try
+            {
+                this.dataOut.Write(PrimitiveMap.CHAR_TYPE);
+                this.dataOut.Write(value);
+            }
+            catch(IOException e)
+            {
+                NMSExceptionSupport.Create(e);
+            }
+        }
+
+        public void WriteInt16(short value)
+        {
+            InitializeWriting();
+            try
+            {
+                this.dataOut.Write(PrimitiveMap.SHORT_TYPE);
+                this.dataOut.Write(value);
+            }
+            catch(IOException e)
+            {
+                NMSExceptionSupport.Create(e);
+            }
+        }
+
+        public void WriteInt32(int value)
+        {
+            InitializeWriting();
+            try
+            {
+                this.dataOut.Write(PrimitiveMap.INTEGER_TYPE);
+                this.dataOut.Write(value);
+            }
+            catch(IOException e)
+            {
+                NMSExceptionSupport.Create(e);
+            }
+        }
+
+        public void WriteInt64(long value)
+        {
+            InitializeWriting();
+            try
+            {
+                this.dataOut.Write(PrimitiveMap.LONG_TYPE);
+                this.dataOut.Write(value);
+            }
+            catch(IOException e)
+            {
+                NMSExceptionSupport.Create(e);
+            }
+        }
+
+        public void WriteSingle(float value)
+        {
+            InitializeWriting();
+            try
+            {
+                this.dataOut.Write(PrimitiveMap.FLOAT_TYPE);
+                this.dataOut.Write(value);
+            }
+            catch(IOException e)
+            {
+                NMSExceptionSupport.Create(e);
+            }
+        }
+
+        public void WriteDouble(double value)
+        {
+            InitializeWriting();
+            try
+            {
+                this.dataOut.Write(PrimitiveMap.DOUBLE_TYPE);
+                this.dataOut.Write(value);
+            }
+            catch(IOException e)
+            {
+                NMSExceptionSupport.Create(e);
+            }
+        }
+
+        public void WriteString(string value)
+        {
+            InitializeWriting();
+            try
+            {
+                if( value.Length > 8192 )
+                {
+                    this.dataOut.Write(PrimitiveMap.BIG_STRING_TYPE);
+                    this.dataOut.WriteString32(value);
+                }
+                else
+                {
+                    this.dataOut.Write(PrimitiveMap.STRING_TYPE);
+                    this.dataOut.WriteString16(value);
+                }
+            }
+            catch(IOException e)
+            {
+                NMSExceptionSupport.Create(e);
+            }
+        }
+
+        public void WriteObject(Object value)
+        {
+            InitializeWriting();
+            if( value is System.Byte )
+            {
+                this.WriteByte( (byte) value );
+            }
+            else if( value is Char )
+            {
+                this.WriteChar( (char) value );
+            }
+            else if( value is Boolean )
+            {
+                this.WriteBoolean( (bool) value );
+            }
+            else if( value is Int16 )
+            {
+                this.WriteInt16( (short) value );
+            }
+            else if( value is Int32 )
+            {
+                this.WriteInt32( (int) value );
+            }
+            else if( value is Int64 )
+            {
+                this.WriteInt64( (long) value );
+            }
+            else if( value is Single )
+            {
+                this.WriteSingle( (float) value );
+            }
+            else if( value is Double )
+            {
+                this.WriteDouble( (double) value );
+            }
+            else if( value is byte[] )
+            {
+                this.WriteBytes( (byte[]) value );
+            }
+            else if( value is String )
+            {
+                this.WriteString( (string) value );
+            }
+            else
+            {
+                throw new MessageFormatException("Cannot write non-primitive type:" + value.GetType());
+            }
+        }
+
+        public override Object Clone()
+        {
+            StoreContent();
+            return base.Clone();
+        }
+
+        public override void ClearBody()
+        {
+            base.ClearBody();
+            this.byteBuffer = null;
+            this.dataIn = null;
+            this.dataOut = null;
+            this.bytesRemaining = -1;
+        }
+
+        public void Reset()
+        {
+            StoreContent();
+            this.dataIn = null;
+            this.dataOut = null;
+            this.byteBuffer = null;
+            this.bytesRemaining = -1;
+            this.ReadOnlyBody = true;
+        }
+
+        private void InitializeReading()
+        {
+            FailIfWriteOnlyBody();
+            if(this.dataIn == null)
+            {
+                this.byteBuffer = new MemoryStream(this.Content, false);
+                this.dataIn = new EndianBinaryReader(this.byteBuffer);
+            }
+        }
+
+        private void InitializeWriting()
+        {
+            FailIfReadOnlyBody();
+            if(this.dataOut == null)
+            {
+                this.byteBuffer = new MemoryStream();
+                this.dataOut = new EndianBinaryWriter(this.byteBuffer);
+            }
+        }
+
+        private void StoreContent()
+        {
+            if( dataOut != null)
+            {
+                dataOut.Close();
+
+                this.Content = byteBuffer.ToArray();
+                this.dataOut = null;
+                this.byteBuffer = null;
+            }
+        }
+
+    }
+}
+

Propchange: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/StreamMessage.cs
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/StreamMessage.cs
------------------------------------------------------------------------------
    svn:executable = *

Added: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/TempDestination.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/TempDestination.cs?rev=989852&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/TempDestination.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/TempDestination.cs Thu Aug 26 18:04:52 2010
@@ -0,0 +1,70 @@
+/*
+ * 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;
+
+namespace Apache.NMS.Commands
+{
+    public abstract class TempDestination : Destination
+    {
+        /// <summary>
+        /// Method CreateDestination
+        /// </summary>
+        /// <returns>An Destination</returns>
+        /// <param name="name">A  String</param>
+        public override Destination CreateDestination(String name)
+        {
+            return null;
+        }
+
+        abstract override public DestinationType DestinationType
+        {
+            get;
+        }
+
+        public TempDestination()
+            : base()
+        {
+        }
+
+        public TempDestination(String name)
+            : base(name)
+        {
+        }
+
+        public override Object Clone()
+        {
+            // Since we are a derived class use the base's Clone()
+            // to perform the shallow copy. Since it is shallow it
+            // will include our derived class. Since we are derived,
+            // this method is an override.
+            TempDestination o = (TempDestination) base.Clone();
+
+            // Now do the deep work required
+            // If any new variables are added then this routine will
+            // likely need updating
+
+            return o;
+        }
+
+        public void Delete()
+        {
+            throw new NotSupportedException("Stomp Cannot Delete Temporary Destinations");
+        }
+    }
+}
+

Propchange: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/TempDestination.cs
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/TempDestination.cs
------------------------------------------------------------------------------
    svn:executable = *

Added: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/TempQueue.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/TempQueue.cs?rev=989852&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/TempQueue.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/TempQueue.cs Thu Aug 26 18:04:52 2010
@@ -0,0 +1,81 @@
+/*
+ * 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;
+
+namespace Apache.NMS.Commands
+{
+    /// <summary>
+    /// A Temporary Queue
+    /// </summary>
+    public class TempQueue : TempDestination, ITemporaryQueue
+    {
+        public TempQueue()
+            : base()
+        {
+        }
+
+        public TempQueue(String name)
+            : base(name)
+        {
+        }
+
+        override public DestinationType DestinationType
+        {
+            get
+            {
+                return DestinationType.TemporaryQueue;
+            }
+        }
+
+        public String QueueName
+        {
+            get { return PhysicalName; }
+        }
+
+        public String GetQueueName()
+        {
+            return PhysicalName;
+        }
+
+        public override int GetDestinationType()
+        {
+            return TEMPORARY_QUEUE;
+        }
+
+        public override Destination CreateDestination(String name)
+        {
+            return new TempQueue(name);
+        }
+
+        public override Object Clone()
+        {
+            // Since we are a derived class use the base's Clone()
+            // to perform the shallow copy. Since it is shallow it
+            // will include our derived class. Since we are derived,
+            // this method is an override.
+            TempQueue o = (TempQueue) base.Clone();
+
+            // Now do the deep work required
+            // If any new variables are added then this routine will
+            // likely need updating
+
+            return o;
+        }
+
+    }
+}
+

Propchange: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/TempQueue.cs
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/TempQueue.cs
------------------------------------------------------------------------------
    svn:executable = *

Added: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/TempTopic.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/TempTopic.cs?rev=989852&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/TempTopic.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/Commands/TempTopic.cs Thu Aug 26 18:04:52 2010
@@ -0,0 +1,77 @@
+/*
+ * 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;
+
+namespace Apache.NMS.Commands
+{
+
+    /// <summary>
+    /// A Temporary Topic
+    /// </summary>
+    public class TempTopic : TempDestination, ITemporaryTopic
+    {
+        public TempTopic() : base()
+        {
+        }
+
+        public TempTopic(String name) : base(name)
+        {
+        }
+
+        override public DestinationType DestinationType
+        {
+            get { return DestinationType.TemporaryTopic; }
+        }
+
+        public String TopicName
+        {
+            get { return PhysicalName; }
+        }
+
+        public String GetTopicName()
+        {
+            return PhysicalName;
+        }
+
+        public override int GetDestinationType()
+        {
+            return TEMPORARY_TOPIC;
+        }
+
+        public override Destination CreateDestination(String name)
+        {
+            return new TempTopic(name);
+        }
+
+        public override Object Clone()
+        {
+            // Since we are a derived class use the base's Clone()
+            // to perform the shallow copy. Since it is shallow it
+            // will include our derived class. Since we are derived,
+            // this method is an override.
+            TempTopic o = (TempTopic) base.Clone();
+
+            // Now do the deep work required
+            // If any new variables are added then this routine will
+            // likely need updating
+
+            return o;
+        }
+
+    }
+}
+



Mime
View raw message