http://git-wip-us.apache.org/repos/asf/activemq-nms-msmq/blob/7274a80a/src/test/csharp/RequestResponseTest.cs
----------------------------------------------------------------------
diff --git a/src/test/csharp/RequestResponseTest.cs 
b/src/test/csharp/RequestResponseTest.cs
new file mode 100644
index 0000000..d6f0489
--- /dev/null
+++ b/src/test/csharp/RequestResponseTest.cs
@@ -0,0 +1,74 @@
+/*
+ * 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 Apache.NMS.Util;
+using NUnit.Framework;
+
+namespace Apache.NMS.Test
+{
+       //[TestFixture]
+       public class RequestResponseTest : NMSTest
+       {
+               protected RequestResponseTest(NMSTestSupport testSupport)
+                       : base(testSupport)
+               {
+               }
+
+               //[Test]
+               //[Category("RequestResponse")]         
+               public virtual void TestRequestResponseMessaging(string 
testDestRef, string testRespDestRef)
+               {
+                       using(IConnection connection = CreateConnection())
+                       {
+                               connection.Start();
+                               using(ISession session = 
connection.CreateSession(AcknowledgementMode.AutoAcknowledge))
+                               {
+                                       IDestination destination = 
GetClearDestinationByNodeReference(session, testDestRef);
+                                       IDestination replyTo = 
GetClearDestinationByNodeReference(session, testRespDestRef);
+
+                                       using(IMessageConsumer consumer = 
session.CreateConsumer(destination))
+                                       using(IMessageProducer producer = 
session.CreateProducer(destination))
+                                       {
+                                               IMessage request = 
session.CreateMessage();
+                                               
+                                               request.NMSReplyTo = replyTo;
+                                               
+                                               producer.Send(request);
+                                               
+                                               request = 
consumer.Receive(TimeSpan.FromMilliseconds(3000));
+                                               Assert.IsNotNull(request);
+                                               
Assert.IsNotNull(request.NMSReplyTo);
+                                               
+                                               using(IMessageProducer 
responder = session.CreateProducer(request.NMSReplyTo))
+                                               {
+                                                       IMessage response = 
session.CreateTextMessage("RESPONSE");                                          
            
+                                                       
responder.Send(response);
+                                               }                               
                
+                                       }
+                                       
+                                       using(IMessageConsumer consumer = 
session.CreateConsumer(replyTo))
+                                       {
+                                               ITextMessage response = 
consumer.Receive(TimeSpan.FromMilliseconds(3000)) as ITextMessage;
+                                               Assert.IsNotNull(response);
+                                               Assert.AreEqual("RESPONSE", 
response.Text);
+                                       }
+                               }
+                       }
+               }
+       }
+}
+

http://git-wip-us.apache.org/repos/asf/activemq-nms-msmq/blob/7274a80a/src/test/csharp/StreamMessageTest.cs
----------------------------------------------------------------------
diff --git a/src/test/csharp/StreamMessageTest.cs 
b/src/test/csharp/StreamMessageTest.cs
new file mode 100644
index 0000000..be690a4
--- /dev/null
+++ b/src/test/csharp/StreamMessageTest.cs
@@ -0,0 +1,111 @@
+/*
+ * 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.Util;
+using NUnit.Framework;
+
+namespace Apache.NMS.Test
+{
+       //[TestFixture]
+       public class StreamMessageTest : NMSTest
+       {
+               protected bool a = true;
+               protected byte b = 123;
+               protected char c = 'c';
+               protected short d = 0x1234;
+               protected int e = 0x12345678;
+               protected long f = 0x1234567812345678;
+               protected string g = "Hello World!";
+               protected bool h = false;
+               protected byte i = 0xFF;
+               protected short j = -0x1234;
+               protected int k = -0x12345678;
+               protected long l = -0x1234567812345678;
+               protected float m = 2.1F;
+               protected double n = 2.3;
+
+               protected StreamMessageTest(NMSTestSupport testSupport)
+                       : base(testSupport)
+               {
+               }
+
+               //[Test]
+               public virtual void TestSendReceiveStreamMessage(
+                       //[Values(MsgDeliveryMode.Persistent, 
MsgDeliveryMode.NonPersistent)]
+                       MsgDeliveryMode deliveryMode, string testDestRef)
+               {
+                       using(IConnection connection = 
CreateConnection(GetTestClientId()))
+                       {
+                               connection.Start();
+                               using(ISession session = 
connection.CreateSession(AcknowledgementMode.AutoAcknowledge))
+                               {
+                                       IDestination destination = 
GetClearDestinationByNodeReference(session, testDestRef);
+                                       using(IMessageConsumer consumer = 
session.CreateConsumer(destination))
+                                       using(IMessageProducer producer = 
session.CreateProducer(destination))
+                                       {
+                                               producer.DeliveryMode = 
deliveryMode;
+                                               IStreamMessage request;
+
+                                               try
+                                               {
+                                                       request = 
session.CreateStreamMessage();
+                                               }
+                                               
catch(System.NotSupportedException)
+                                               {
+                                                       return;
+                                               }
+
+                                               request.WriteBoolean(a);
+                                               request.WriteByte(b);
+                                               request.WriteChar(c);
+                                               request.WriteInt16(d);
+                                               request.WriteInt32(e);
+                                               request.WriteInt64(f);
+                                               request.WriteString(g);
+                                               request.WriteBoolean(h);
+                                               request.WriteByte(i);
+                                               request.WriteInt16(j);
+                                               request.WriteInt32(k);
+                                               request.WriteInt64(l);
+                                               request.WriteSingle(m);
+                                               request.WriteDouble(n);
+                                               producer.Send(request);
+
+                                               IStreamMessage message = 
consumer.Receive(receiveTimeout) as IStreamMessage;
+                                               Assert.IsNotNull(message, "No 
message returned!");
+                                               Assert.AreEqual(deliveryMode, 
message.NMSDeliveryMode, "NMSDeliveryMode does not match");
+
+                                               // use generic API to access 
entries
+                                               Assert.AreEqual(a, 
message.ReadBoolean(), "Stream Boolean Value: a");
+                                               Assert.AreEqual(b, 
message.ReadByte(), "Stream Byte Value: b");
+                                               Assert.AreEqual(c, 
message.ReadChar(), "Stream Char Value: c");
+                                               Assert.AreEqual(d, 
message.ReadInt16(), "Stream Int16 Value: d");
+                                               Assert.AreEqual(e, 
message.ReadInt32(), "Stream Int32 Value: e");
+                                               Assert.AreEqual(f, 
message.ReadInt64(), "Stream Int64 Value: f");
+                                               Assert.AreEqual(g, 
message.ReadString(), "Stream String Value: g");
+                                               Assert.AreEqual(h, 
message.ReadBoolean(), "Stream Boolean Value: h");
+                                               Assert.AreEqual(i, 
message.ReadByte(), "Stream Byte Value: i");
+                                               Assert.AreEqual(j, 
message.ReadInt16(), "Stream Int16 Value: j");
+                                               Assert.AreEqual(k, 
message.ReadInt32(), "Stream Int32 Value: k");
+                                               Assert.AreEqual(l, 
message.ReadInt64(), "Stream Int64 Value: l");
+                                               Assert.AreEqual(m, 
message.ReadSingle(), "Stream Single Value: m");
+                                               Assert.AreEqual(n, 
message.ReadDouble(), "Stream Double Value: n");
+                                       }
+                               }
+                       }
+               }
+       }
+}

http://git-wip-us.apache.org/repos/asf/activemq-nms-msmq/blob/7274a80a/src/test/csharp/TempDestinationDeletionTest.cs
----------------------------------------------------------------------
diff --git a/src/test/csharp/TempDestinationDeletionTest.cs 
b/src/test/csharp/TempDestinationDeletionTest.cs
new file mode 100644
index 0000000..834193e
--- /dev/null
+++ b/src/test/csharp/TempDestinationDeletionTest.cs
@@ -0,0 +1,80 @@
+/*
+ * 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 Apache.NMS.Util;
+using NUnit.Framework;
+
+namespace Apache.NMS.Test
+{
+       //[TestFixture]
+       public class TempDestinationDeletionTest : NMSTest
+       {
+               protected TempDestinationDeletionTest(NMSTestSupport 
testSupport)
+                       : base(testSupport)
+               {
+               }
+
+               //[Test]
+               public virtual void TestTempDestinationDeletion(
+                       //[Values(MsgDeliveryMode.Persistent, 
MsgDeliveryMode.NonPersistent)]
+                       MsgDeliveryMode deliveryMode,
+                       //[Values(DELETION_TEST_QUEUE, DELETION_TEST_TOPIC, 
DELETION_TEST_TEMP_QUEUE, DELETION_TEST_TEMP_TOPIC)]
+                       string testDestRef)
+               {
+                       using(IConnection connection1 = 
CreateConnection(GetTestClientId()))
+                       {
+                               connection1.Start();
+                               using(ISession session = 
connection1.CreateSession(AcknowledgementMode.AutoAcknowledge))
+                               {
+                                       const int MaxNumDestinations = 100;
+
+                                       for(int index = 1; index <= 
MaxNumDestinations; index++)
+                                       {
+                                               IDestination destination = 
GetClearDestinationByNodeReference(session, testDestRef);
+
+                                               using(IMessageProducer producer 
= session.CreateProducer(destination))
+                                               using(IMessageConsumer consumer 
= session.CreateConsumer(destination))
+                                               {
+                                                       producer.DeliveryMode = 
deliveryMode;
+
+                                                       IMessage request = 
session.CreateTextMessage("Hello World, Just Passing Through!");
+
+                                                       request.NMSType = 
"TEMP_MSG";
+                                                       producer.Send(request);
+                                                       IMessage receivedMsg = 
consumer.Receive(TimeSpan.FromMilliseconds(5000));
+                                                       
Assert.IsNotNull(receivedMsg);
+                                                       
Assert.AreEqual(receivedMsg.NMSType, "TEMP_MSG");
+                                                       
+                                                       // Ensures that 
Consumer closes out its subscription
+                                                       consumer.Close();
+                                               }
+
+                                               try
+                                               {
+                                                       
session.DeleteDestination(destination);
+                                               }
+                                               catch(NotSupportedException)
+                                               {
+                                                       // Might as well not 
try this again.
+                                                       break;
+                                               }
+                                       }
+                               }
+                       }
+               }
+       }
+}

http://git-wip-us.apache.org/repos/asf/activemq-nms-msmq/blob/7274a80a/src/test/csharp/TempDestinationTest.cs
----------------------------------------------------------------------
diff --git a/src/test/csharp/TempDestinationTest.cs 
b/src/test/csharp/TempDestinationTest.cs
new file mode 100644
index 0000000..b9a75e4
--- /dev/null
+++ b/src/test/csharp/TempDestinationTest.cs
@@ -0,0 +1,175 @@
+/*
+ * 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 NUnit.Framework;
+
+namespace Apache.NMS.Test
+{
+    //[TestFixture]
+    public class TempDestinationTest : NMSTest
+    {
+        private IConnection connection;
+        private IList connections = ArrayList.Synchronized(new ArrayList());
+
+               protected TempDestinationTest(NMSTestSupport testSupport)
+                       : base(testSupport)
+               {
+               }
+
+        //[SetUp]
+        public override void SetUp()
+        {
+            base.SetUp();
+
+            this.connection = CreateConnection();
+            this.connections.Add(connection);
+        }
+
+        //[TearDown]
+        public override void TearDown()
+        {
+            foreach(IConnection conn in this.connections)
+            {
+                try
+                {
+                    conn.Close();
+                }
+                catch
+                {
+                }
+            }
+
+            connections.Clear();
+
+            base.TearDown();
+        }
+
+        //[Test]
+        public virtual void TestTempDestOnlyConsumedByLocalConn()
+        {
+            connection.Start();
+
+            ISession tempSession = 
connection.CreateSession(AcknowledgementMode.AutoAcknowledge);
+            ITemporaryQueue queue = tempSession.CreateTemporaryQueue();
+            IMessageProducer producer = tempSession.CreateProducer(queue);
+            producer.DeliveryMode = (MsgDeliveryMode.NonPersistent);
+            ITextMessage message = tempSession.CreateTextMessage("First");
+            producer.Send(message);
+
+            // temp destination should not be consume when using another 
connection
+            IConnection otherConnection = CreateConnection();
+            connections.Add(otherConnection);
+            ISession otherSession = 
otherConnection.CreateSession(AcknowledgementMode.AutoAcknowledge);
+            ITemporaryQueue otherQueue = otherSession.CreateTemporaryQueue();
+            IMessageConsumer consumer = 
otherSession.CreateConsumer(otherQueue);
+            IMessage msg = consumer.Receive(TimeSpan.FromMilliseconds(3000));
+            Assert.IsNull(msg);
+
+            // should be able to consume temp destination from the same 
connection
+            consumer = tempSession.CreateConsumer(queue);
+            msg = consumer.Receive(TimeSpan.FromMilliseconds(3000));
+            Assert.IsNotNull(msg);
+        }
+
+        //[Test]
+        public virtual void TestTempQueueHoldsMessagesWithConsumers()
+        {
+            ISession session = 
connection.CreateSession(AcknowledgementMode.AutoAcknowledge);
+            ITemporaryQueue queue = session.CreateTemporaryQueue();
+            IMessageConsumer consumer = session.CreateConsumer(queue);
+            connection.Start();
+
+            IMessageProducer producer = session.CreateProducer(queue);
+            producer.DeliveryMode = (MsgDeliveryMode.NonPersistent);
+            ITextMessage message = session.CreateTextMessage("Hello");
+            producer.Send(message);
+
+            IMessage message2 = 
consumer.Receive(TimeSpan.FromMilliseconds(1000));
+            Assert.IsNotNull(message2);
+            Assert.IsTrue(message2 is ITextMessage, "Expected message to be a 
ITextMessage");
+            Assert.IsTrue(((ITextMessage)message2).Text == message.Text, 
"Expected message to be a '" + message.Text + "'");
+        }
+
+        //[Test]
+        public virtual void TestTempQueueHoldsMessagesWithoutConsumers()
+        {
+            ISession session = 
connection.CreateSession(AcknowledgementMode.AutoAcknowledge);
+            ITemporaryQueue queue = session.CreateTemporaryQueue();
+            IMessageProducer producer = session.CreateProducer(queue);
+            producer.DeliveryMode = MsgDeliveryMode.NonPersistent;
+            ITextMessage message = session.CreateTextMessage("Hello");
+            producer.Send(message);
+
+            connection.Start();
+            IMessageConsumer consumer = session.CreateConsumer(queue);
+            IMessage message2 = 
consumer.Receive(TimeSpan.FromMilliseconds(3000));
+            Assert.IsNotNull(message2);
+            Assert.IsTrue(message2 is ITextMessage, "Expected message to be a 
ITextMessage");
+            Assert.IsTrue(((ITextMessage)message2).Text == message.Text, 
"Expected message to be a '" + message.Text + "'");
+        }
+
+        //[Test]
+        public virtual void TestTmpQueueWorksUnderLoad()
+        {
+            int count = 500;
+            int dataSize = 1024;
+
+            ArrayList list = new ArrayList(count);
+            ISession session = 
connection.CreateSession(AcknowledgementMode.AutoAcknowledge);
+            ITemporaryQueue queue = session.CreateTemporaryQueue();
+            IBytesMessage message;
+            IBytesMessage message2;
+            IMessageProducer producer = session.CreateProducer(queue);
+            producer.DeliveryMode = MsgDeliveryMode.NonPersistent;
+
+            byte[] srcdata = new byte[dataSize];
+            srcdata[0] = (byte) 'B';
+            srcdata[1] = (byte) 'A';
+            srcdata[2] = (byte) 'D';
+            srcdata[3] = (byte) 'W';
+            srcdata[4] = (byte) 'O';
+            srcdata[5] = (byte) 'L';
+            srcdata[6] = (byte) 'F';
+            for(int i = 0; i < count; i++)
+            {
+                message = session.CreateBytesMessage();
+                message.WriteBytes(srcdata);
+                message.Properties.SetInt("c", i);
+                producer.Send(message);
+                list.Add(message);
+            }
+
+            connection.Start();
+            byte[] data = new byte[dataSize];
+            byte[] data2 = new byte[dataSize];
+            IMessageConsumer consumer = session.CreateConsumer(queue);
+            for(int i = 0; i < count; i++)
+            {
+                message2 = consumer.Receive(TimeSpan.FromMilliseconds(2000)) 
as IBytesMessage;
+                Assert.IsNotNull(message2);
+                Assert.AreEqual(i, message2.Properties.GetInt("c"));
+                message = list[i] as IBytesMessage;
+                Assert.IsNotNull(message);
+                               message.Reset();
+                message.ReadBytes(data);
+                message2.ReadBytes(data2);
+                Assert.AreEqual(data, data2);
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/activemq-nms-msmq/blob/7274a80a/src/test/csharp/TextMessageTest.cs
----------------------------------------------------------------------
diff --git a/src/test/csharp/TextMessageTest.cs 
b/src/test/csharp/TextMessageTest.cs
new file mode 100644
index 0000000..a5f23fd
--- /dev/null
+++ b/src/test/csharp/TextMessageTest.cs
@@ -0,0 +1,71 @@
+/*
+ * 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 Apache.NMS.Util;
+using NUnit.Framework;
+
+namespace Apache.NMS.Test
+{
+       //[TestFixture]
+       public class TextMessageTest : NMSTest
+       {
+               protected TextMessageTest(NMSTestSupport testSupport)
+                       : base(testSupport)
+               {
+               }
+
+               //[Test]
+               public virtual void TestSendReceiveTextMessage(
+                       //[Values(MsgDeliveryMode.Persistent, 
MsgDeliveryMode.NonPersistent)]
+                       MsgDeliveryMode deliveryMode, string testDestRef)
+               {
+                       using(IConnection connection = 
CreateConnection(GetTestClientId()))
+                       {
+                               connection.Start();
+                               using(ISession session = 
connection.CreateSession(AcknowledgementMode.AutoAcknowledge))
+                               {
+                                       IDestination destination = 
GetClearDestinationByNodeReference(session, testDestRef);
+                                       using(IMessageConsumer consumer = 
session.CreateConsumer(destination))
+                                       using(IMessageProducer producer = 
session.CreateProducer(destination))
+                                       {
+                                               producer.DeliveryMode = 
deliveryMode;
+                                               IMessage request = 
session.CreateTextMessage("Hello World!");
+                                               producer.Send(request);
+
+                                               IMessage message = 
consumer.Receive(receiveTimeout);
+                                               AssertTextMessageEqual(request, 
message);
+                                               Assert.AreEqual(deliveryMode, 
message.NMSDeliveryMode, "NMSDeliveryMode does not match");
+                                       }
+                               }
+                       }
+               }
+
+               /// <summary>
+               /// Assert that two messages are ITextMessages and their text 
bodies are equal.
+               /// </summary>
+               /// <param name="expected"></param>
+               /// <param name="actual"></param>
+               protected void AssertTextMessageEqual(IMessage expected, 
IMessage actual)
+               {
+                       ITextMessage expectedTextMsg = expected as ITextMessage;
+                       Assert.IsNotNull(expectedTextMsg, "'expected' message 
not a text message");
+                       ITextMessage actualTextMsg = actual as ITextMessage;
+                       Assert.IsNotNull(actualTextMsg, "'actual' message not a 
text message");
+                       Assert.AreEqual(expectedTextMsg.Text, 
actualTextMsg.Text, "Text message does not match.");
+               }
+       }
+}

http://git-wip-us.apache.org/repos/asf/activemq-nms-msmq/blob/7274a80a/src/test/csharp/TransactionTest.cs
----------------------------------------------------------------------
diff --git a/src/test/csharp/TransactionTest.cs 
b/src/test/csharp/TransactionTest.cs
new file mode 100644
index 0000000..8fd7f93
--- /dev/null
+++ b/src/test/csharp/TransactionTest.cs
@@ -0,0 +1,439 @@
+/*
+ * 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 Apache.NMS.Util;
+using NUnit.Framework;
+
+namespace Apache.NMS.Test
+{
+       //[TestFixture]
+       public class TransactionTest : NMSTest
+       {
+               protected TransactionTest(NMSTestSupport testSupport)
+                       : base(testSupport)
+               {
+               }
+
+               //[Test]
+               public virtual void TestSendRollback(
+                       //[Values(MsgDeliveryMode.Persistent, 
MsgDeliveryMode.NonPersistent)]
+                       MsgDeliveryMode deliveryMode, string testDestRef)
+               {
+                       using(IConnection connection = 
CreateConnection(GetTestClientId()))
+                       {
+                               connection.Start();
+                               using(ISession session = 
connection.CreateSession(AcknowledgementMode.Transactional))
+                               {
+                                       IDestination destination = 
GetClearDestinationByNodeReference(session, testDestRef);
+                                       using(IMessageConsumer consumer = 
session.CreateConsumer(destination))
+                                       using(IMessageProducer producer = 
session.CreateProducer(destination))
+                                       {
+                                               producer.DeliveryMode = 
deliveryMode;
+                                               ITextMessage firstMsgSend = 
session.CreateTextMessage("First Message");
+                                               producer.Send(firstMsgSend);
+                                               session.Commit();
+
+                                               ITextMessage rollbackMsg = 
session.CreateTextMessage("I'm going to get rolled back.");
+                                               producer.Send(rollbackMsg);
+                                               session.Rollback();
+
+                                               ITextMessage secondMsgSend = 
session.CreateTextMessage("Second Message");
+                                               producer.Send(secondMsgSend);
+                                               session.Commit();
+
+                                               // Receive the messages
+
+                                               IMessage message = 
consumer.Receive(receiveTimeout);
+                                               
AssertTextMessageEqual(firstMsgSend, message, "First message does not match.");
+
+                                               message = 
consumer.Receive(receiveTimeout);
+                                               
AssertTextMessageEqual(secondMsgSend, message, "Second message does not 
match.");
+
+                                               // validates that the rollback 
was not consumed
+                                               session.Commit();
+                                       }
+                               }
+                       }
+               }
+
+               //[Test]
+               public virtual void TestSendSessionClose(
+                       //[Values(MsgDeliveryMode.Persistent, 
MsgDeliveryMode.NonPersistent)]
+                       MsgDeliveryMode deliveryMode, string testDestRef)
+               {
+                       ITextMessage firstMsgSend;
+                       ITextMessage secondMsgSend;
+
+                       using(IConnection connection1 = 
CreateConnection(GetTestClientId()))
+                       {
+                               connection1.Start();
+                               using(ISession session1 = 
connection1.CreateSession(AcknowledgementMode.Transactional))
+                               {
+                                       IDestination destination1 = 
GetClearDestinationByNodeReference(session1, testDestRef);
+                                       using(IMessageConsumer consumer = 
session1.CreateConsumer(destination1))
+                                       {
+                                               // First connection session 
that sends one message, and the
+                                               // second message is implicitly 
rolled back as the session is
+                                               // disposed before Commit() can 
be called.
+                                               using(IConnection connection2 = 
CreateConnection(GetTestClientId()))
+                                               {
+                                                       connection2.Start();
+                                                       using(ISession session2 
= connection2.CreateSession(AcknowledgementMode.Transactional))
+                                                       {
+                                                               IDestination 
destination2 = GetClearDestinationByNodeReference(session2, testDestRef);
+                                                               
using(IMessageProducer producer = session2.CreateProducer(destination2))
+                                                               {
+                                                                       
producer.DeliveryMode = deliveryMode;
+                                                                       
firstMsgSend = session2.CreateTextMessage("First Message");
+                                                                       
producer.Send(firstMsgSend);
+                                                                       
session2.Commit();
+
+                                                                       
ITextMessage rollbackMsg = session2.CreateTextMessage("I'm going to get rolled 
back.");
+                                                                       
producer.Send(rollbackMsg);
+                                                               }
+                                                       }
+                                               }
+
+                                               // Second connection session 
that will send one message.
+                                               using(IConnection connection2 = 
CreateConnection(GetTestClientId()))
+                                               {
+                                                       connection2.Start();
+                                                       using(ISession session2 
= connection2.CreateSession(AcknowledgementMode.Transactional))
+                                                       {
+                                                               IDestination 
destination2 = GetClearDestinationByNodeReference(session2, testDestRef);
+                                                               
using(IMessageProducer producer = session2.CreateProducer(destination2))
+                                                               {
+                                                                       
producer.DeliveryMode = deliveryMode;
+                                                                       
secondMsgSend = session2.CreateTextMessage("Second Message");
+                                                                       
producer.Send(secondMsgSend);
+                                                                       
session2.Commit();
+                                                               }
+                                                       }
+                                               }
+
+                                               // Check the consumer to verify 
which messages were actually received.
+                                               IMessage message = 
consumer.Receive(receiveTimeout);
+                                               
AssertTextMessageEqual(firstMsgSend, message, "First message does not match.");
+
+                                               message = 
consumer.Receive(receiveTimeout);
+                                               
AssertTextMessageEqual(secondMsgSend, message, "Second message does not 
match.");
+
+                                               // validates that the rollback 
was not consumed
+                                               session1.Commit();
+                                       }
+                               }
+                       }
+               }
+
+               //[Test]
+               public virtual void TestReceiveRollback(
+                       //[Values(MsgDeliveryMode.Persistent, 
MsgDeliveryMode.NonPersistent)]
+                       MsgDeliveryMode deliveryMode, string testDestRef)
+               {
+                       using(IConnection connection = 
CreateConnection(GetTestClientId()))
+                       {
+                               connection.Start();
+                               using(ISession session = 
connection.CreateSession(AcknowledgementMode.Transactional))
+                               {
+                                       IDestination destination = 
GetClearDestinationByNodeReference(session, testDestRef);
+                                       using(IMessageConsumer consumer = 
session.CreateConsumer(destination))
+                                       using(IMessageProducer producer = 
session.CreateProducer(destination))
+                                       {
+                                               producer.DeliveryMode = 
deliveryMode;
+                                               // Send both messages
+                                               ITextMessage firstMsgSend = 
session.CreateTextMessage("First Message");
+                                               producer.Send(firstMsgSend);
+                                               ITextMessage secondMsgSend = 
session.CreateTextMessage("Second Message");
+                                               producer.Send(secondMsgSend);
+                                               session.Commit();
+
+                                               // Receive the messages
+
+                                               IMessage message = 
consumer.Receive(receiveTimeout);
+                                               
AssertTextMessageEqual(firstMsgSend, message, "First message does not match.");
+                                               session.Commit();
+
+                                               message = 
consumer.Receive(receiveTimeout);
+                                               
AssertTextMessageEqual(secondMsgSend, message, "Second message does not 
match.");
+
+                                               // Rollback so we can get that 
last message again.
+                                               session.Rollback();
+                                               IMessage rollbackMsg = 
consumer.Receive(receiveTimeout);
+                                               
AssertTextMessageEqual(secondMsgSend, rollbackMsg, "Rollback message does not 
match.");
+                                               session.Commit();
+                                       }
+                               }
+                       }
+               }
+
+
+               //[Test]
+               public virtual void TestReceiveTwoThenRollback(
+                       //[Values(MsgDeliveryMode.Persistent, 
MsgDeliveryMode.NonPersistent)]
+                       MsgDeliveryMode deliveryMode, string testDestRef)
+               {
+                       using(IConnection connection = 
CreateConnection(GetTestClientId()))
+                       {
+                               connection.Start();
+                               using(ISession session = 
connection.CreateSession(AcknowledgementMode.Transactional))
+                               {
+                                       IDestination destination = 
GetClearDestinationByNodeReference(session, testDestRef);
+                                       using(IMessageConsumer consumer = 
session.CreateConsumer(destination))
+                                       using(IMessageProducer producer = 
session.CreateProducer(destination))
+                                       {
+                                               producer.DeliveryMode = 
deliveryMode;
+                                               // Send both messages
+                                               ITextMessage firstMsgSend = 
session.CreateTextMessage("First Message");
+                                               producer.Send(firstMsgSend);
+                                               ITextMessage secondMsgSend = 
session.CreateTextMessage("Second Message");
+                                               producer.Send(secondMsgSend);
+                                               session.Commit();
+
+                                               // Receive the messages
+
+                                               IMessage message = 
consumer.Receive(receiveTimeout);
+                                               
AssertTextMessageEqual(firstMsgSend, message, "First message does not match.");
+                                               message = 
consumer.Receive(receiveTimeout);
+                                               
AssertTextMessageEqual(secondMsgSend, message, "Second message does not 
match.");
+
+                                               // Rollback so we can get that 
last two messages again.
+                                               session.Rollback();
+                                               IMessage rollbackMsg = 
consumer.Receive(receiveTimeout);
+                                               
AssertTextMessageEqual(firstMsgSend, rollbackMsg, "First rollback message does 
not match.");
+                                               rollbackMsg = 
consumer.Receive(receiveTimeout);
+                                               
AssertTextMessageEqual(secondMsgSend, rollbackMsg, "Second rollback message 
does not match.");
+
+                                               
Assert.IsNull(consumer.ReceiveNoWait());
+                                               session.Commit();
+                                       }
+                               }
+                       }
+               }
+
+               //[Test]
+               public virtual void TestSendCommitNonTransaction(
+                       //[Values(AcknowledgementMode.AutoAcknowledge, 
AcknowledgementMode.ClientAcknowledge)]
+                       AcknowledgementMode ackMode,
+                       //[Values(MsgDeliveryMode.Persistent, 
MsgDeliveryMode.NonPersistent)]
+                       MsgDeliveryMode deliveryMode, string testDestRef)
+               {
+                       using(IConnection connection = 
CreateConnection(GetTestClientId()))
+                       {
+                               connection.Start();
+                               using(ISession session = 
connection.CreateSession(ackMode))
+                               {
+                                       IDestination destination = 
GetClearDestinationByNodeReference(session, testDestRef);
+                                       using(IMessageConsumer consumer = 
session.CreateConsumer(destination))
+                                       using(IMessageProducer producer = 
session.CreateProducer(destination))
+                                       {
+                                               producer.DeliveryMode = 
deliveryMode;
+                                               ITextMessage firstMsgSend = 
session.CreateTextMessage("SendCommitNonTransaction Message");
+                                               producer.Send(firstMsgSend);
+                                               try
+                                               {
+                                                       session.Commit();
+                                                       Assert.Fail("Should 
have thrown an InvalidOperationException.");
+                                               }
+                                               catch(InvalidOperationException)
+                                               {
+                                               }
+                                       }
+                               }
+                       }
+               }
+
+               //[Test]
+               public virtual void TestReceiveCommitNonTransaction(
+                       //[Values(AcknowledgementMode.AutoAcknowledge, 
AcknowledgementMode.ClientAcknowledge)]
+                       AcknowledgementMode ackMode,
+                       //[Values(MsgDeliveryMode.Persistent, 
MsgDeliveryMode.NonPersistent)]
+                       MsgDeliveryMode deliveryMode, string testDestRef)
+               {
+                       using(IConnection connection = 
CreateConnection(GetTestClientId()))
+                       {
+                               connection.Start();
+                               using(ISession session = 
connection.CreateSession(ackMode))
+                               {
+                                       IDestination destination = 
GetClearDestinationByNodeReference(session, testDestRef);
+                                       using(IMessageConsumer consumer = 
session.CreateConsumer(destination))
+                                       using(IMessageProducer producer = 
session.CreateProducer(destination))
+                                       {
+                                               producer.DeliveryMode = 
deliveryMode;
+                                               ITextMessage firstMsgSend = 
session.CreateTextMessage("ReceiveCommitNonTransaction Message");
+                                               producer.Send(firstMsgSend);
+
+                                               // Receive the messages
+
+                                               IMessage message = 
consumer.Receive(receiveTimeout);
+                                               
AssertTextMessageEqual(firstMsgSend, message, "First message does not match.");
+                                               
if(AcknowledgementMode.ClientAcknowledge == ackMode)
+                                               {
+                                                       message.Acknowledge();
+                                               }
+
+                                               try
+                                               {
+                                                       session.Commit();
+                                                       Assert.Fail("Should 
have thrown an InvalidOperationException.");
+                                               }
+                                               catch(InvalidOperationException)
+                                               {
+                                               }
+                                       }
+                               }
+                       }
+               }
+
+               //[Test]
+               public virtual void TestReceiveRollbackNonTransaction(
+                       //[Values(AcknowledgementMode.AutoAcknowledge, 
AcknowledgementMode.ClientAcknowledge)]
+                       AcknowledgementMode ackMode,
+                       //[Values(MsgDeliveryMode.Persistent, 
MsgDeliveryMode.NonPersistent)]
+                       MsgDeliveryMode deliveryMode, string testDestRef)
+               {
+                       using(IConnection connection = 
CreateConnection(GetTestClientId()))
+                       {
+                               connection.Start();
+                               using(ISession session = 
connection.CreateSession(ackMode))
+                               {
+                                       IDestination destination = 
GetClearDestinationByNodeReference(session, testDestRef);
+                                       using(IMessageConsumer consumer = 
session.CreateConsumer(destination))
+                                       using(IMessageProducer producer = 
session.CreateProducer(destination))
+                                       {
+                                               producer.DeliveryMode = 
deliveryMode;
+                                               ITextMessage firstMsgSend = 
session.CreateTextMessage("ReceiveCommitNonTransaction Message");
+                                               producer.Send(firstMsgSend);
+
+                                               // Receive the messages
+
+                                               IMessage message = 
consumer.Receive(receiveTimeout);
+                                               
AssertTextMessageEqual(firstMsgSend, message, "First message does not match.");
+                                               
if(AcknowledgementMode.ClientAcknowledge == ackMode)
+                                               {
+                                                       message.Acknowledge();
+                                               }
+
+                                               try
+                                               {
+                                                       session.Rollback();
+                                                       Assert.Fail("Should 
have thrown an InvalidOperationException.");
+                                               }
+                                               catch(InvalidOperationException)
+                                               {
+                                               }
+                                       }
+                               }
+                       }
+               }
+
+               /// <summary>
+               /// Assert that two messages are ITextMessages and their text 
bodies are equal.
+               /// </summary>
+               /// <param name="expected"></param>
+               /// <param name="actual"></param>
+               /// <param name="message"></param>
+               protected void AssertTextMessageEqual(IMessage expected, 
IMessage actual, String message)
+               {
+                       ITextMessage expectedTextMsg = expected as ITextMessage;
+                       Assert.IsNotNull(expectedTextMsg, "'expected' message 
not a text message");
+                       ITextMessage actualTextMsg = actual as ITextMessage;
+                       Assert.IsNotNull(actualTextMsg, "'actual' message not a 
text message");
+                       Assert.AreEqual(expectedTextMsg.Text, 
actualTextMsg.Text, message);
+               }
+
+               //[Test]
+               public virtual void TestRedispatchOfRolledbackTx(
+                       //[Values(MsgDeliveryMode.Persistent, 
MsgDeliveryMode.NonPersistent)]
+                       MsgDeliveryMode deliveryMode, string testDestRef)
+               {
+                       using(IConnection connection = 
CreateConnection(GetTestClientId()))
+                       {
+                               connection.Start();
+                               ISession session = 
connection.CreateSession(AcknowledgementMode.Transactional);
+                               IDestination destination = 
GetClearDestinationByNodeReference(session, testDestRef);
+
+                               SendMessages(connection, destination, 
deliveryMode, 2);
+
+                               IMessageConsumer consumer = 
session.CreateConsumer(destination);
+                               
Assert.IsNotNull(consumer.Receive(TimeSpan.FromMilliseconds(1500)));
+                               
Assert.IsNotNull(consumer.Receive(TimeSpan.FromMilliseconds(1500)));
+
+                               // install another consumer while message 
dispatch is unacked/uncommitted
+                               ISession redispatchSession = 
connection.CreateSession(AcknowledgementMode.Transactional);
+                               IMessageConsumer redispatchConsumer = 
redispatchSession.CreateConsumer(destination);
+
+                               session.Rollback();
+                               session.Close();
+
+                               IMessage msg = 
redispatchConsumer.Receive(TimeSpan.FromMilliseconds(1500));
+                               Assert.IsNotNull(msg);
+                               Assert.IsTrue(msg.NMSRedelivered);
+                               Assert.AreEqual(2, 
msg.Properties.GetLong("NMSXDeliveryCount"));
+                               msg = 
redispatchConsumer.Receive(TimeSpan.FromMilliseconds(1500));
+                               Assert.IsNotNull(msg);
+                               Assert.IsTrue(msg.NMSRedelivered);
+                               Assert.AreEqual(2, 
msg.Properties.GetLong("NMSXDeliveryCount"));
+                               redispatchSession.Commit();
+
+                               
Assert.IsNull(redispatchConsumer.Receive(TimeSpan.FromMilliseconds(500)));
+                               redispatchSession.Close();
+                       }
+               }
+
+               //[Test]
+               public virtual void TestRedispatchOfUncommittedTx(
+                       //[Values(MsgDeliveryMode.Persistent, 
MsgDeliveryMode.NonPersistent)]
+                       MsgDeliveryMode deliveryMode, string testDestRef)
+               {
+                       using(IConnection connection = 
CreateConnection(GetTestClientId()))
+                       {
+                               connection.Start();
+                               ISession session = 
connection.CreateSession(AcknowledgementMode.Transactional);
+                               IDestination destination = 
GetClearDestinationByNodeReference(session, testDestRef);
+
+                               SendMessages(connection, destination, 
deliveryMode, 2);
+
+                               IMessageConsumer consumer = 
session.CreateConsumer(destination);
+                               
Assert.IsNotNull(consumer.Receive(TimeSpan.FromMilliseconds(2000)));
+                               
Assert.IsNotNull(consumer.Receive(TimeSpan.FromMilliseconds(2000)));
+
+                               // install another consumer while message 
dispatch is unacked/uncommitted
+                               ISession redispatchSession = 
connection.CreateSession(AcknowledgementMode.Transactional);
+                               IMessageConsumer redispatchConsumer = 
redispatchSession.CreateConsumer(destination);
+
+                               // no commit so will auto rollback and get 
re-dispatched to redisptachConsumer
+                               session.Close();
+
+                               IMessage msg = 
redispatchConsumer.Receive(TimeSpan.FromMilliseconds(2000));
+                               Assert.IsNotNull(msg);
+                               Assert.IsTrue(msg.NMSRedelivered);
+                               Assert.AreEqual(2, 
msg.Properties.GetLong("NMSXDeliveryCount"));
+
+                               msg = 
redispatchConsumer.Receive(TimeSpan.FromMilliseconds(2000));
+                               Assert.IsNotNull(msg);
+                               Assert.IsTrue(msg.NMSRedelivered);
+                               Assert.AreEqual(2, 
msg.Properties.GetLong("NMSXDeliveryCount"));
+                               redispatchSession.Commit();
+
+                               
Assert.IsNull(redispatchConsumer.Receive(TimeSpan.FromMilliseconds(500)));
+                               redispatchSession.Close();
+                       }
+               }
+       }
+}
+
+

http://git-wip-us.apache.org/repos/asf/activemq-nms-msmq/blob/7274a80a/src/test/csharp/XmlMessageTest.cs
----------------------------------------------------------------------
diff --git a/src/test/csharp/XmlMessageTest.cs 
b/src/test/csharp/XmlMessageTest.cs
new file mode 100644
index 0000000..9c9fc88
--- /dev/null
+++ b/src/test/csharp/XmlMessageTest.cs
@@ -0,0 +1,186 @@
+/*
+ * 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 Apache.NMS.Util;
+using NUnit.Framework;
+
+namespace Apache.NMS.Test
+{
+       // For ease of cross-platform exchange of information, you might 
generate objects from
+       // an XSD file using XSDObjectGen. However, C# has built-in support for 
serializing.
+       // All of the XML attributes that are commented out are optional, but 
give you fine-grained
+       // control over the serialized format if you need it.
+
+       // [Serializable]
+       public enum CheckType
+       {
+               // [XmlEnum(Name = "message")]
+               message,
+               // [XmlEnum(Name = "command")]
+               command,
+               // [XmlEnum(Name = "response")]
+               response
+       }
+
+       // [XmlRoot(ElementName = "NMSTestXmlType1", IsNullable = false), 
Serializable]
+       public class NMSTestXmlType1
+       {
+               // [XmlElement(ElementName = "crcCheck", IsNullable = false, 
DataType = "int")]
+               public int crcCheck;
+
+               // [XmlElement(Type = typeof(CheckType), ElementName = 
"checkType", IsNullable = false)]
+               public CheckType checkType;
+
+               public NMSTestXmlType1()
+               {
+                       crcCheck = 0;
+                       checkType = CheckType.message;
+               }
+       }
+
+       // [XmlRoot(ElementName = "NMSTestXmlType2", IsNullable = false), 
Serializable]
+       public class NMSTestXmlType2
+       {
+               // [XmlElement(ElementName = "stringCheck", IsNullable = false, 
DataType = "string")]
+               public string stringCheck;
+
+               public NMSTestXmlType2()
+               {
+                       stringCheck = String.Empty;
+               }
+       }
+
+       //[TestFixture]
+       public class XmlMessageTest : NMSTest
+       {
+               public XmlMessageTest(NMSTestSupport testSupport)
+                       : base(testSupport)
+               {
+               }
+
+#if NET_3_5 || MONO
+
+               //[Test]
+               public virtual void TestSendReceiveXmlMessage_Net35(string 
testDestRef)
+               {
+                       using(IConnection connection = 
CreateConnection(GetTestClientId()))
+                       {
+                               connection.Start();
+                               using(ISession session = 
connection.CreateSession(AcknowledgementMode.AutoAcknowledge))
+                               {
+                                       IDestination destination = 
GetClearDestinationByNodeReference(session, testDestRef);
+                                       using(IMessageConsumer consumer = 
session.CreateConsumer(destination))
+                                       using(IMessageProducer producer = 
session.CreateProducer(destination))
+                                       {
+                                               NMSTestXmlType1 srcIntObject = 
new NMSTestXmlType1();
+                                               srcIntObject.crcCheck = 
0xbadf00d;
+                                               srcIntObject.checkType = 
CheckType.command;
+                                               producer.Send(srcIntObject);
+
+                                               NMSTestXmlType2 srcStringObject 
= new NMSTestXmlType2();
+                                               srcStringObject.stringCheck = 
"BadFood";
+                                               producer.Send(srcStringObject);
+
+                                               // Demonstrate the ability to 
generically handle multiple object types
+                                               // sent to the same consumer.  
If only one object type is ever sent to
+                                               // the destination, then a 
simple inline cast is all that is necessary
+                                               // when calling the 
NMSConvert.FromXmlMessage() function.
+
+                                               for(int index = 0; index < 2; 
index++)
+                                               {
+                                                       object receivedObject = 
consumer.Receive(receiveTimeout).ToObject();
+                                                       
Assert.IsNotNull(receivedObject, "Failed to retrieve XML message object.");
+
+                                                       if(receivedObject is 
NMSTestXmlType1)
+                                                       {
+                                                               NMSTestXmlType1 
destObject = (NMSTestXmlType1) receivedObject;
+                                                               
Assert.AreEqual(srcIntObject.crcCheck, destObject.crcCheck, "CRC integer 
mis-match.");
+                                                               
Assert.AreEqual(srcIntObject.checkType, destObject.checkType, "Check type 
mis-match.");
+                                                       }
+                                                       else if(receivedObject 
is NMSTestXmlType2)
+                                                       {
+                                                               NMSTestXmlType2 
destObject = (NMSTestXmlType2) receivedObject;
+                                                               
Assert.AreEqual(srcStringObject.stringCheck, destObject.stringCheck, "CRC 
string mis-match.");
+                                                       }
+                                                       else
+                                                       {
+                                                               
Assert.Fail("Invalid object type.");
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+               }
+
+#else
+
+               // Test the obsolete API versions until they are completely 
removed.
+               //[Test]
+               public virtual void TestSendReceiveXmlMessage(string 
testDestRef)
+               {
+                       using(IConnection connection = 
CreateConnection(GetTestClientId()))
+                       {
+                               connection.Start();
+                               using(ISession session = 
connection.CreateSession(AcknowledgementMode.AutoAcknowledge))
+                               {
+                                       IDestination destination = 
GetClearDestinationByNodeReference(session, testDestRef);
+                                       using(IMessageConsumer consumer = 
session.CreateConsumer(destination))
+                                       using(IMessageProducer producer = 
session.CreateProducer(destination))
+                                       {
+                                               NMSTestXmlType1 srcIntObject = 
new NMSTestXmlType1();
+                                               srcIntObject.crcCheck = 
0xbadf00d;
+                                               srcIntObject.checkType = 
CheckType.command;
+                                               
producer.Send(NMSConvert.ToXmlMessage(session, srcIntObject));
+
+                                               NMSTestXmlType2 srcStringObject 
= new NMSTestXmlType2();
+                                               srcStringObject.stringCheck = 
"BadFood";
+                                               
producer.Send(NMSConvert.ToXmlMessage(session, srcStringObject));
+
+                                               // Demonstrate the ability to 
generically handle multiple object types
+                                               // sent to the same consumer.  
If only one object type is ever sent to
+                                               // the destination, then a 
simple inline cast is all that is necessary
+                                               // when calling the 
NMSConvert.FromXmlMessage() function.
+
+                                               for(int index = 0; index < 2; 
index++)
+                                               {
+                                                       object receivedObject = 
NMSConvert.FromXmlMessage(consumer.Receive(receiveTimeout));
+                                                       
Assert.IsNotNull(receivedObject, "Failed to retrieve XML message object.");
+
+                                                       if(receivedObject is 
NMSTestXmlType1)
+                                                       {
+                                                               NMSTestXmlType1 
destObject = (NMSTestXmlType1) receivedObject;
+                                                               
Assert.AreEqual(srcIntObject.crcCheck, destObject.crcCheck, "CRC integer 
mis-match.");
+                                                               
Assert.AreEqual(srcIntObject.checkType, destObject.checkType, "Check type 
mis-match.");
+                                                       }
+                                                       else if(receivedObject 
is NMSTestXmlType2)
+                                                       {
+                                                               NMSTestXmlType2 
destObject = (NMSTestXmlType2) receivedObject;
+                                                               
Assert.AreEqual(srcStringObject.stringCheck, destObject.stringCheck, "CRC 
string mis-match.");
+                                                       }
+                                                       else
+                                                       {
+                                                               
Assert.Fail("Invalid object type.");
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+               }
+
+#endif
+       }
+}

http://git-wip-us.apache.org/repos/asf/activemq-nms-msmq/blob/7274a80a/vs2008-msmq-test.csproj
----------------------------------------------------------------------
diff --git a/vs2008-msmq-test.csproj b/vs2008-msmq-test.csproj
index 685f1fc..e330436 100644
--- a/vs2008-msmq-test.csproj
+++ b/vs2008-msmq-test.csproj
@@ -1,9 +1,8 @@
-<Project DefaultTargets="Build" 
xmlns="http://schemas.microsoft.com/developer/msbuild/2003"; ToolsVersion="3.5">
+<Project DefaultTargets="Build" 
xmlns="http://schemas.microsoft.com/developer/msbuild/2003"; ToolsVersion="4.0">
   <PropertyGroup>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
     <ProductVersion>9.0.30729</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
     <ProjectGuid>{2F31ED5C-44A2-464A-BD55-2B5B010654E8}</ProjectGuid>
     <OutputType>Library</OutputType>
     <RootNamespace>Apache.NMS.MSMQ.Test</RootNamespace>
@@ -79,6 +78,67 @@
     <Compile Include="src\test\csharp\MSMQTest.cs">
       <SubType>Code</SubType>
     </Compile>
+    <Compile Include="src\test\csharp\AsyncConsumeTest.cs" />
+    <Compile Include="src\test\csharp\BadConsumeTest.cs" />
+    <Compile Include="src\test\csharp\BytesMessageTest.cs" />
+    <Compile Include="src\test\csharp\ConnectionTest.cs" />
+    <Compile Include="src\test\csharp\ConsumerTest.cs" />
+    <Compile Include="src\test\csharp\DurableTest.cs" />
+    <Compile Include="src\test\csharp\EndianBinaryReaderTest.cs" />
+    <Compile Include="src\test\csharp\EndianBinaryWriterTest.cs" />
+    <Compile Include="src\test\csharp\EndianTest.cs" />
+    <Compile Include="src\test\csharp\ForeignMessageTransformationTest.cs" />
+    <Compile Include="src\test\csharp\MapMessageTest.cs" />
+    <Compile Include="src\test\csharp\MessageSelectorTest.cs" />
+    <Compile Include="src\test\csharp\MessageTest.cs" />
+    <Compile Include="src\test\csharp\MessageTransformerTest.cs" />
+    <Compile Include="src\test\csharp\MSMQAsyncConsumeTest.cs" />
+    <Compile Include="src\test\csharp\MSMQBadConsumeTest.cs" />
+    <Compile Include="src\test\csharp\MSMQBytesMessageTest.cs" />
+    <Compile Include="src\test\csharp\MSMQConnectionTest.cs" />
+    <Compile Include="src\test\csharp\MSMQConsumerTest.cs" />
+    <Compile Include="src\test\csharp\MSMQDurableTest.cs" />
+    <Compile Include="src\test\csharp\MSMQForeignMessageTransformationTest.cs" 
/>
+    <Compile Include="src\test\csharp\MSMQMapMessageTest.cs" />
+    <Compile Include="src\test\csharp\MSMQMessageSelectorTest.cs" />
+    <Compile Include="src\test\csharp\MSMQMessageTest.cs" />
+    <Compile Include="src\test\csharp\MSMQMessageTransformerTest.cs" />
+    <Compile Include="src\test\csharp\MSMQNMSPropertyTest.cs" />
+    <Compile Include="src\test\csharp\MSMQProducerTest.cs" />
+    <Compile Include="src\test\csharp\MSMQRequestResponseTest.cs" />
+    <Compile Include="src\test\csharp\MSMQStreamMessageTest.cs" />
+    <Compile Include="src\test\csharp\MSMQTempDestinationDeletionTest.cs" />
+    <Compile Include="src\test\csharp\MSMQTempDestinationTest.cs" />
+    <Compile Include="src\test\csharp\MSMQTestSupport.cs" />
+    <Compile Include="src\test\csharp\MSMQTextMessageTest.cs" />
+    <Compile Include="src\test\csharp\MSMQTransactionTest.cs" />
+    <Compile Include="src\test\csharp\MSMQXmlMessageTest.cs" />
+    <Compile Include="src\test\csharp\NMSPropertyTest.cs" />
+    <Compile Include="src\test\csharp\NMSTest.cs" />
+    <Compile Include="src\test\csharp\NMSTestSupport.cs" />
+    <Compile Include="src\test\csharp\NMSTracer.cs" />
+    <Compile Include="src\test\csharp\PrimitiveMapTest.cs" />
+    <Compile Include="src\test\csharp\ProducerTest.cs" />
+    <Compile Include="src\test\csharp\RedeliveryPolicyTest.cs" />
+    <Compile Include="src\test\csharp\RequestResponseTest.cs" />
+    <Compile Include="src\test\csharp\StreamMessageTest.cs" />
+    <Compile Include="src\test\csharp\TempDestinationDeletionTest.cs" />
+    <Compile Include="src\test\csharp\TempDestinationTest.cs" />
+    <Compile Include="src\test\csharp\TextMessageTest.cs" />
+    <Compile Include="src\test\csharp\TransactionTest.cs" />
+    <Compile Include="src\test\csharp\XmlMessageTest.cs" />
+    <Compile Include="src\test\csharp\Commands\BytesMessage.cs" />
+    <Compile Include="src\test\csharp\Commands\Destination.cs" />
+    <Compile Include="src\test\csharp\Commands\MapMessage.cs" />
+    <Compile Include="src\test\csharp\Commands\Message.cs" />
+    <Compile Include="src\test\csharp\Commands\ObjectMessage.cs" />
+    <Compile Include="src\test\csharp\Commands\Queue.cs" />
+    <Compile Include="src\test\csharp\Commands\StreamMessage.cs" />
+    <Compile Include="src\test\csharp\Commands\TempDestination.cs" />
+    <Compile Include="src\test\csharp\Commands\TempQueue.cs" />
+    <Compile Include="src\test\csharp\Commands\TempTopic.cs" />
+    <Compile Include="src\test\csharp\Commands\TextMessage.cs" />
+    <Compile Include="src\test\csharp\Commands\Topic.cs" />
   </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="vs2008-msmq.csproj">
@@ -110,6 +170,7 @@
   </ItemGroup>
   <ItemGroup>
     <None Include="keyfile\NMSKey.snk" />
+    <None Include="msmqprovider-test.config" />
   </ItemGroup>
   <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
   <PropertyGroup>

http://git-wip-us.apache.org/repos/asf/activemq-nms-msmq/blob/7274a80a/vs2008-msmq.csproj
----------------------------------------------------------------------
diff --git a/vs2008-msmq.csproj b/vs2008-msmq.csproj
index 3023e88..76ab1dc 100644
--- a/vs2008-msmq.csproj
+++ b/vs2008-msmq.csproj
@@ -1,9 +1,8 @@
-<Project DefaultTargets="Build" 
xmlns="http://schemas.microsoft.com/developer/msbuild/2003"; ToolsVersion="3.5">
+<Project DefaultTargets="Build" 
xmlns="http://schemas.microsoft.com/developer/msbuild/2003"; ToolsVersion="4.0">
   <PropertyGroup>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
     <ProductVersion>9.0.30729</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
     <ProjectGuid>{A5FCA129-991B-4CB2-987A-B25E43B0F5EC}</ProjectGuid>
     <OutputType>Library</OutputType>
     <RootNamespace>Apache.NMS.MSMQ</RootNamespace>

http://git-wip-us.apache.org/repos/asf/activemq-nms-msmq/blob/7274a80a/vs2008-msmq.sln
----------------------------------------------------------------------
diff --git a/vs2008-msmq.sln b/vs2008-msmq.sln
index a51006f..010ea3c 100644
--- a/vs2008-msmq.sln
+++ b/vs2008-msmq.sln
@@ -1,30 +1,30 @@
-
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "vs2008-msmq", 
"vs2008-msmq.csproj", "{A5FCA129-991B-4CB2-987A-B25E43B0F5EC}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "vs2008-msmq-test", 
"vs2008-msmq-test.csproj", "{2F31ED5C-44A2-464A-BD55-2B5B010654E8}"
-EndProject
-Global
-       GlobalSection(SubversionScc) = preSolution
-               Svn-Managed = True
-               Manager = AnkhSVN - Subversion Support for Visual Studio
-       EndGlobalSection
-       GlobalSection(SolutionConfigurationPlatforms) = preSolution
-               Debug|Any CPU = Debug|Any CPU
-               Release|Any CPU = Release|Any CPU
-       EndGlobalSection
-       GlobalSection(ProjectConfigurationPlatforms) = postSolution
-               {A5FCA129-991B-4CB2-987A-B25E43B0F5EC}.Debug|Any CPU.ActiveCfg 
= Debug|Any CPU
-               {A5FCA129-991B-4CB2-987A-B25E43B0F5EC}.Debug|Any CPU.Build.0 = 
Debug|Any CPU
-               {A5FCA129-991B-4CB2-987A-B25E43B0F5EC}.Release|Any 
CPU.ActiveCfg = Release|Any CPU
-               {A5FCA129-991B-4CB2-987A-B25E43B0F5EC}.Release|Any CPU.Build.0 
= Release|Any CPU
-               {2F31ED5C-44A2-464A-BD55-2B5B010654E8}.Debug|Any CPU.ActiveCfg 
= Debug|Any CPU
-               {2F31ED5C-44A2-464A-BD55-2B5B010654E8}.Debug|Any CPU.Build.0 = 
Debug|Any CPU
-               {2F31ED5C-44A2-464A-BD55-2B5B010654E8}.Release|Any 
CPU.ActiveCfg = Release|Any CPU
-               {2F31ED5C-44A2-464A-BD55-2B5B010654E8}.Release|Any CPU.Build.0 
= Release|Any CPU
-       EndGlobalSection
-       GlobalSection(SolutionProperties) = preSolution
-               HideSolutionNode = FALSE
-       EndGlobalSection
-EndGlobal
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2008
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "vs2008-msmq", 
"vs2008-msmq.csproj", "{A5FCA129-991B-4CB2-987A-B25E43B0F5EC}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "vs2008-msmq-test", 
"vs2008-msmq-test.csproj", "{2F31ED5C-44A2-464A-BD55-2B5B010654E8}"
+EndProject
+Global
+       GlobalSection(SubversionScc) = preSolution
+               Svn-Managed = True
+               Manager = AnkhSVN - Subversion Support for Visual Studio
+       EndGlobalSection
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|Any CPU = Debug|Any CPU
+               Release|Any CPU = Release|Any CPU
+       EndGlobalSection
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution
+               {A5FCA129-991B-4CB2-987A-B25E43B0F5EC}.Debug|Any CPU.ActiveCfg 
= Debug|Any CPU
+               {A5FCA129-991B-4CB2-987A-B25E43B0F5EC}.Debug|Any CPU.Build.0 = 
Debug|Any CPU
+               {A5FCA129-991B-4CB2-987A-B25E43B0F5EC}.Release|Any 
CPU.ActiveCfg = Release|Any CPU
+               {A5FCA129-991B-4CB2-987A-B25E43B0F5EC}.Release|Any CPU.Build.0 
= Release|Any CPU
+               {2F31ED5C-44A2-464A-BD55-2B5B010654E8}.Debug|Any CPU.ActiveCfg 
= Debug|Any CPU
+               {2F31ED5C-44A2-464A-BD55-2B5B010654E8}.Debug|Any CPU.Build.0 = 
Debug|Any CPU
+               {2F31ED5C-44A2-464A-BD55-2B5B010654E8}.Release|Any 
CPU.ActiveCfg = Release|Any CPU
+               {2F31ED5C-44A2-464A-BD55-2B5B010654E8}.Release|Any CPU.Build.0 
= Release|Any CPU
+       EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+EndGlobal

Reply via email to