http://git-wip-us.apache.org/repos/asf/activemq-nms-amqp/blob/9122762b/src/test/csharp/HelloWorld/HelloWorld.cs ---------------------------------------------------------------------- diff --git a/src/test/csharp/HelloWorld/HelloWorld.cs b/src/test/csharp/HelloWorld/HelloWorld.cs deleted file mode 100644 index 120ec49..0000000 --- a/src/test/csharp/HelloWorld/HelloWorld.cs +++ /dev/null @@ -1,119 +0,0 @@ -/* - * 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; -using Apache.NMS.Util; -using Apache.NMS.Amqp; - -namespace Apache.NMS.Amqp.Test -{ - public class TestMain - { - /// <summary> - /// AMQP Hello World - /// Using the AMQP protocol, send a message to a topic and retrieve that message again. - /// </summary> - /// <param name="uri">AMQP peer network address string. This string selects - /// the Apache.NMS.AMQP provider and further specifies the TCP address and port of the - /// peer AMQP entity.</param> - /// <param name="protocolVersion">Selects AMQP protocol version. Use 'amqp0-10' or 'amqp1.0'. - /// amqp1.0 is the default version if none is specified.</param> - /// <param name="topicAddress">The name of the topic through which the message is passed - /// in the AMQP peer.</param> - public static void AMQP_HelloWorld(string uri, string protocolVersion, string topicAddress) - { - // AMQP Hello World - // - // Notes: - // * Run qpidd broker, activemq broker, or dispatch router on given uri. - // * Ensure the nmsprovider-amqp.config file exists - // in the executable folder (build\net4-0\debug). - // * Ensure the unmanaged qpid*.dll and boost*.dll files from - // .nant\library\local\org.apache.qpid\Apache.Qpid\<version>\net-4.0\debug - // are in project's Output Path (build\net-4.0\debug) so that they may be - // loaded by org.apache.qpid.messaging.dll. - try - { - Uri connecturi = new Uri(uri); - - Console.WriteLine("About to connect to " + connecturi); - - IConnectionFactory factory = - new NMSConnectionFactory(connecturi, "Bob", "protocol:" + protocolVersion); - - using (IConnection connection = factory.CreateConnection()) - using (ISession session = connection.CreateSession()) - { - IDestination destination = SessionUtil.GetDestination(session, topicAddress); - - // Create a consumer and producer - using (IMessageConsumer consumer = session.CreateConsumer(destination)) - using (IMessageProducer producer = session.CreateProducer(destination)) - { - // Start the connection so that messages will be processed. - connection.Start(); - - // Create a text message - ITextMessage request = session.CreateTextMessage("Hello World! " + DateTime.Now.ToString("HH:mm:ss tt")); - request.Properties["NMSXGroupID"] = "cheese"; - request.Properties["myHeader"] = "Cheddar"; - - // For dispatch router 0.1 messages require a routing property - request.Properties["x-amqp-to"] = topicAddress; - - // Send the message - producer.Send(request); - - // Consume a message - ITextMessage message = consumer.Receive() as ITextMessage; - if (message == null) - { - Console.WriteLine("No message received!"); - } - else - { - Console.WriteLine("Received message text: " + message.Text); - Console.WriteLine("Received message properties: " + message.Properties.ToString()); - } - producer.Close(); - consumer.Close(); - session.Close(); - connection.Stop(); - } - } - } catch (Exception e) { - Console.WriteLine("Exception {0}.", e); - } - } - - - public static void Main(string[] args) - { - string uriQpidd = "amqp:localhost:5672"; - string uriActivemq = "amqp:localhost:5672"; - string uriDispatch = "amqp:localhost:5672"; - - //AMQP_HelloWorld(uriQpidd, "amqp0-10", "amq.topic"); - //AMQP_HelloWorld(uriQpidd, "amqp1.0", "amq.topic"); - - AMQP_HelloWorld(uriActivemq, "amqp1.0", "amq.topic"); - - //AMQP_HelloWorld(uriDispatch, "amqp1.0", "amq.topic"); - } - } -} \ No newline at end of file
http://git-wip-us.apache.org/repos/asf/activemq-nms-amqp/blob/9122762b/src/test/csharp/HelloWorld/app.config ---------------------------------------------------------------------- diff --git a/src/test/csharp/HelloWorld/app.config b/src/test/csharp/HelloWorld/app.config deleted file mode 100644 index 2b34199..0000000 --- a/src/test/csharp/HelloWorld/app.config +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0"?> -<!-- -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. ---> -<configuration> -<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration> http://git-wip-us.apache.org/repos/asf/activemq-nms-amqp/blob/9122762b/src/test/csharp/MapMessageTest.cs ---------------------------------------------------------------------- diff --git a/src/test/csharp/MapMessageTest.cs b/src/test/csharp/MapMessageTest.cs deleted file mode 100644 index da2193c..0000000 --- a/src/test/csharp/MapMessageTest.cs +++ /dev/null @@ -1,556 +0,0 @@ -/* - * 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 NUnit.Framework; -using System; -using System.Text; -using System.Collections; -using System.Globalization; -using Apache.NMS.Amqp; - -namespace Apache.NMS.Amqp.Test -{ - [TestFixture] - public class MapMessageTest - { - - private string name = "testName"; - - [Test] - public void TestBytesConversion() - { - MapMessage msg = new MapMessage(); - msg.Body.SetBool("boolean", true); - msg.Body.SetByte("byte", (byte)1); - msg.Body["bytes"] = new byte[1]; - msg.Body.SetChar("char", 'a'); - msg.Body.SetDouble("double", 1.5); - msg.Body.SetFloat("float", 1.5f); - msg.Body.SetInt("int", 1); - msg.Body.SetLong("long", 1); - msg.Body["object"] = "stringObj"; - msg.Body.SetShort("short", (short)1); - msg.Body.SetString("string", "string"); - - // Test with a 1Meg String - StringBuilder bigSB = new StringBuilder(1024 * 1024); - for(int i = 0; i < 1024 * 1024; i++) - { - bigSB.Append((char)'a' + i % 26); - } - String bigString = bigSB.ToString(); - - msg.Body.SetString("bigString", bigString); - - msg = (MapMessage)msg.Clone(); - - Assert.AreEqual(msg.Body.GetBool("boolean"), true); - Assert.AreEqual(msg.Body.GetByte("byte"), (byte)1); - Assert.AreEqual((msg.Body["bytes"] as byte[]).Length, 1); - Assert.AreEqual(msg.Body.GetChar("char"), 'a'); - Assert.AreEqual(msg.Body.GetDouble("double"), 1.5, 0); - Assert.AreEqual(msg.Body.GetFloat("float"), 1.5f, 0); - Assert.AreEqual(msg.Body.GetInt("int"), 1); - Assert.AreEqual(msg.Body.GetLong("long"), 1); - Assert.AreEqual(msg.Body["object"], "stringObj"); - Assert.AreEqual(msg.Body.GetShort("short"), (short)1); - Assert.AreEqual(msg.Body.GetString("string"), "string"); - Assert.AreEqual(msg.Body.GetString("bigString"), bigString); - } - - [Test] - public void TestGetBoolean() - { - MapMessage msg = new MapMessage(); - msg.Body.SetBool(name, true); - msg.ReadOnlyBody = true; - Assert.IsTrue(msg.Body.GetBool(name)); - } - - [Test] - public void TestGetByte() - { - MapMessage msg = new MapMessage(); - msg.Body.SetByte(this.name, (byte)1); - msg = (MapMessage)msg.Clone(); - Assert.IsTrue(msg.Body.GetByte(this.name) == (byte)1); - } - - [Test] - public void TestGetShort() - { - MapMessage msg = new MapMessage(); - try - { - msg.Body.SetShort(this.name, (short)1); - msg = (MapMessage)msg.Clone(); - Assert.IsTrue(msg.Body.GetShort(this.name) == (short)1); - } - catch(NMSException) - { - Assert.IsTrue(false); - } - } - - [Test] - public void TestGetChar() - { - MapMessage msg = new MapMessage(); - try - { - msg.Body.SetChar(this.name, 'a'); - msg = (MapMessage)msg.Clone(); - Assert.IsTrue(msg.Body.GetChar(this.name) == 'a'); - } - catch(NMSException) - { - Assert.IsTrue(false); - } - } - - [Test] - public void TestGetInt() - { - MapMessage msg = new MapMessage(); - try - { - msg.Body.SetInt(this.name, 1); - msg = (MapMessage)msg.Clone(); - Assert.IsTrue(msg.Body.GetInt(this.name) == 1); - } - catch(NMSException) - { - Assert.IsTrue(false); - } - } - - [Test] - public void TestGetLong() - { - MapMessage msg = new MapMessage(); - try - { - msg.Body.SetLong(this.name, 1); - msg = (MapMessage)msg.Clone(); - Assert.IsTrue(msg.Body.GetLong(this.name) == 1); - } - catch(NMSException) - { - Assert.IsTrue(false); - } - } - - [Test] - public void TestGetFloat() - { - MapMessage msg = new MapMessage(); - try - { - msg.Body.SetFloat(this.name, 1.5f); - msg = (MapMessage)msg.Clone(); - Assert.IsTrue(msg.Body.GetFloat(this.name) == 1.5f); - } - catch(NMSException) - { - Assert.IsTrue(false); - } - } - - [Test] - public void TestGetDouble() - { - MapMessage msg = new MapMessage(); - try - { - msg.Body.SetDouble(this.name, 1.5); - msg = (MapMessage)msg.Clone(); - Assert.IsTrue(msg.Body.GetDouble(this.name) == 1.5); - } - catch(NMSException) - { - Assert.IsTrue(false); - } - } - - [Test] - public void TestGetString() - { - MapMessage msg = new MapMessage(); - try - { - String str = "test"; - msg.Body.SetString(this.name, str); - msg = (MapMessage)msg.Clone(); - Assert.AreEqual(msg.Body.GetString(this.name), str); - } - catch(NMSException) - { - Assert.IsTrue(false); - } - } - - [Test] - public void TestGetBytes() - { - MapMessage msg = new MapMessage(); - try - { - byte[] bytes1 = new byte[3]; - byte[] bytes2 = new byte[2]; - System.Array.Copy(bytes1, 0, bytes2, 0, 2); - msg.Body[this.name] = bytes1; - msg.Body[this.name + "2"] = bytes2; - msg = (MapMessage)msg.Clone(); - Assert.IsTrue(System.Array.Equals(msg.Body[this.name], bytes1)); - Assert.AreEqual(((byte[]) msg.Body[this.name + "2"]).Length, bytes2.Length); - } - catch(NMSException) - { - Assert.IsTrue(false); - } - } - - [Test] - public void TestGetObject() - { - MapMessage msg = new MapMessage(); - Boolean booleanValue = true; - Byte byteValue = Byte.Parse("1"); - byte[] bytesValue = new byte[3]; - Char charValue = (Char) 'a'; - Double doubleValue = Double.Parse("1.5", CultureInfo.InvariantCulture); - Single floatValue = Single.Parse("1.5", CultureInfo.InvariantCulture); - Int32 intValue = Int32.Parse("1"); - Int64 longValue = Int64.Parse("1"); - Int16 shortValue = Int16.Parse("1"); - String stringValue = "string"; - UInt16 ushortValue = UInt16.Parse("1"); - UInt32 uintValue = UInt32.Parse("1"); - UInt64 ulongValue = UInt64.Parse("1"); - - try - { - msg.Body["boolean"] = booleanValue; - msg.Body["byte"] = byteValue; - msg.Body["bytes"] = bytesValue; - msg.Body["char"] = charValue; - msg.Body["double"] = doubleValue; - msg.Body["float"] = floatValue; - msg.Body["int"] = intValue; - msg.Body["long"] = longValue; - msg.Body["short"] = shortValue; - msg.Body["string"] = stringValue; - msg.Body["uint"] = uintValue; - msg.Body["ulong"] = ulongValue; - msg.Body["ushort"] = ushortValue; - } - catch(MessageFormatException) - { - Assert.Fail("object formats should be correct"); - } - - msg = (MapMessage)msg.Clone(); - - Assert.IsTrue(msg.Body["boolean"] is Boolean); - Assert.AreEqual(msg.Body["boolean"], booleanValue); - Assert.AreEqual(msg.Body.GetBool("boolean"), booleanValue); - Assert.IsTrue(msg.Body["byte"] is Byte); - Assert.AreEqual(msg.Body["byte"], byteValue); - Assert.AreEqual(msg.Body.GetByte("byte"), byteValue); - Assert.IsTrue(msg.Body["bytes"] is byte[]); - Assert.AreEqual(((byte[])msg.Body["bytes"]).Length, bytesValue.Length); - Assert.AreEqual((msg.Body["bytes"] as byte[]).Length, bytesValue.Length); - Assert.IsTrue(msg.Body["char"] is Char); - Assert.AreEqual(msg.Body["char"], charValue); - Assert.AreEqual(msg.Body.GetChar("char"), charValue); - Assert.IsTrue(msg.Body["double"] is Double); - Assert.AreEqual(msg.Body["double"], doubleValue); - Assert.AreEqual(msg.Body.GetDouble("double"), doubleValue, 0); - Assert.IsTrue(msg.Body["float"] is Single); - Assert.AreEqual(msg.Body["float"], floatValue); - Assert.AreEqual(msg.Body.GetFloat("float"), floatValue, 0); - Assert.IsTrue(msg.Body["int"] is Int32); - Assert.AreEqual(msg.Body["int"], intValue); - Assert.AreEqual(msg.Body.GetInt("int"), intValue); - Assert.IsTrue(msg.Body["long"] is Int64); - Assert.AreEqual(msg.Body["long"], longValue); - Assert.AreEqual(msg.Body.GetLong("long"), longValue); - Assert.IsTrue(msg.Body["short"] is Int16); - Assert.AreEqual(msg.Body["short"], shortValue); - Assert.AreEqual(msg.Body.GetShort("short"), shortValue); - Assert.IsTrue(msg.Body["string"] is String); - Assert.AreEqual(msg.Body["string"], stringValue); - Assert.AreEqual(msg.Body.GetString("string"), stringValue); - - Assert.IsTrue(msg.Body["uint"] is UInt32); - Assert.AreEqual(msg.Body["uint"], uintValue); - Assert.IsTrue(msg.Body["ulong"] is UInt64); - Assert.AreEqual(msg.Body["ulong"], ulongValue); - Assert.IsTrue(msg.Body["ushort"] is UInt16); - Assert.AreEqual(msg.Body["ushort"], ushortValue); - - msg.ClearBody(); - try - { - msg.Body["object"] = new Object(); - Assert.Fail("should have thrown exception"); - } - catch(NMSException) - { - } - } - - [Test] - public void TestGetMapNames() - { - MapMessage msg = new MapMessage(); - msg.Body.SetBool("boolean", true); - msg.Body.SetByte("byte", (byte)1); - msg.Body["bytes1"] = new byte[1]; - msg.Body.SetChar("char", 'a'); - msg.Body.SetDouble("double", 1.5); - msg.Body.SetFloat("float", 1.5f); - msg.Body.SetInt("int", 1); - msg.Body.SetLong("long", 1); - msg.Body["object"] = "stringObj"; - msg.Body.SetShort("short", (short)1); - msg.Body.SetString("string", "string"); - - msg = (MapMessage)msg.Clone(); - - ICollection mapNames = msg.Body.Keys; - System.Collections.ArrayList mapNamesList = new System.Collections.ArrayList(mapNames); - - Assert.AreEqual(mapNamesList.Count, 11); - Assert.IsTrue(mapNamesList.Contains("boolean")); - Assert.IsTrue(mapNamesList.Contains("byte")); - Assert.IsTrue(mapNamesList.Contains("bytes1")); - Assert.IsTrue(mapNamesList.Contains("char")); - Assert.IsTrue(mapNamesList.Contains("double")); - Assert.IsTrue(mapNamesList.Contains("float")); - Assert.IsTrue(mapNamesList.Contains("int")); - Assert.IsTrue(mapNamesList.Contains("long")); - Assert.IsTrue(mapNamesList.Contains("object")); - Assert.IsTrue(mapNamesList.Contains("short")); - Assert.IsTrue(mapNamesList.Contains("string")); - } - - [Test] - public void TestItemExists() - { - MapMessage mapMessage = new MapMessage(); - - mapMessage.Body.SetString("exists", "test"); - - mapMessage = (MapMessage)mapMessage.Clone(); - - Assert.IsTrue(mapMessage.Body.Contains("exists")); - Assert.IsFalse(mapMessage.Body.Contains("doesntExist")); - } - - [Test] - public void TestClearBody() - { - MapMessage mapMessage = new MapMessage(); - mapMessage.Body.SetString("String", "String"); - mapMessage.ClearBody(); - Assert.IsFalse(mapMessage.ReadOnlyBody); - - //mapMessage.OnSend(); - mapMessage.Content = mapMessage.Content; - Assert.IsNull(mapMessage.Body.GetString("String")); - mapMessage.ClearBody(); - mapMessage.Body.SetString("String", "String"); - - mapMessage = (MapMessage)mapMessage.Clone(); - - mapMessage.Body.GetString("String"); - } - - [Test] - public void TestReadOnlyBody() - { - MapMessage msg = new MapMessage(); - msg.Body.SetBool("boolean", true); - msg.Body.SetByte("byte", (byte)1); - msg.Body["bytes"] = new byte[1]; - msg.Body.SetChar("char", 'a'); - msg.Body.SetDouble("double", 1.5); - msg.Body.SetFloat("float", 1.5f); - msg.Body.SetInt("int", 1); - msg.Body.SetLong("long", 1); - msg.Body["object"] = "stringObj"; - msg.Body.SetShort("short", (short)1); - msg.Body.SetString("string", "string"); - - msg.ReadOnlyBody = true; - - try - { - msg.Body.GetBool("boolean"); - msg.Body.GetByte("byte"); - Assert.IsNotNull(msg.Body["bytes"]); - msg.Body.GetChar("char"); - msg.Body.GetDouble("double"); - msg.Body.GetFloat("float"); - msg.Body.GetInt("int"); - msg.Body.GetLong("long"); - Assert.IsNotNull(msg.Body["object"]); - msg.Body.GetShort("short"); - msg.Body.GetString("string"); - } - catch(MessageNotReadableException) - { - Assert.Fail("should be readable"); - } -#if false - //TODO: add property interceptor - try - { - msg.Body.SetBool("boolean", true); - Assert.Fail("should throw exception"); - } - catch(MessageNotWriteableException) - { - } - - try - { - msg.Body.SetByte("byte", (byte)1); - Assert.Fail("should throw exception"); - } - catch(MessageNotWriteableException) - { - } - - try - { - msg.Body["bytes"] = new byte[1]; - Assert.Fail("should throw exception"); - } - catch(MessageNotWriteableException) - { - } - - try - { - msg.Body.SetChar("char", 'a'); - Assert.Fail("should throw exception"); - } - catch(MessageNotWriteableException) - { - } - - try - { - msg.Body.SetDouble("double", 1.5); - Assert.Fail("should throw exception"); - } - catch(MessageNotWriteableException) - { - } - - try { - msg.Body.SetFloat("float", 1.5f); - Assert.Fail("should throw exception"); - } - catch(MessageNotWriteableException) - { - } - - try - { - msg.Body.SetInt("int", 1); - Assert.Fail("should throw exception"); - } - catch(MessageNotWriteableException) - { - } - - try - { - msg.Body.SetLong("long", 1); - Assert.Fail("should throw exception"); - } - catch(MessageNotWriteableException) - { - } - - try - { - msg.Body["object"] = "stringObj"; - Assert.Fail("should throw exception"); - } - catch(MessageNotWriteableException) - { - } - - try - { - msg.Body.SetShort("short", (short)1); - Assert.Fail("should throw exception"); - } - catch(MessageNotWriteableException) - { - } - - try - { - msg.Body.SetString("string", "string"); - Assert.Fail("should throw exception"); - } - catch(MessageNotWriteableException) - { - } -#endif - } - - [Test] - public void TestWriteOnlyBody() - { - MapMessage msg = new MapMessage(); - msg.ReadOnlyBody = false; - - msg.Body.SetBool("boolean", true); - msg.Body.SetByte("byte", (byte)1); - msg.Body["bytes"] = new byte[1]; - msg.Body.SetChar("char", 'a'); - msg.Body.SetDouble("double", 1.5); - msg.Body.SetFloat("float", 1.5f); - msg.Body.SetInt("int", 1); - msg.Body.SetLong("long", 1); - msg.Body["object"] = "stringObj"; - msg.Body.SetShort("short", (short)1); - msg.Body.SetString("string", "string"); - - msg.ReadOnlyBody = true; - - msg.Body.GetBool("boolean"); - msg.Body.GetByte("byte"); - Assert.IsNotNull(msg.Body["bytes"]); - msg.Body.GetChar("char"); - msg.Body.GetDouble("double"); - msg.Body.GetFloat("float"); - msg.Body.GetInt("int"); - msg.Body.GetLong("long"); - Assert.IsNotNull(msg.Body["object"]); - msg.Body.GetShort("short"); - msg.Body.GetString("string"); - } - - } -} http://git-wip-us.apache.org/repos/asf/activemq-nms-amqp/blob/9122762b/src/test/csharp/MessageDeliveryTest.cs ---------------------------------------------------------------------- diff --git a/src/test/csharp/MessageDeliveryTest.cs b/src/test/csharp/MessageDeliveryTest.cs deleted file mode 100644 index 5636807..0000000 --- a/src/test/csharp/MessageDeliveryTest.cs +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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.Threading; -using Apache.NMS; -using Apache.NMS.Policies; -using Apache.NMS.Util; -using Apache.NMS.Amqp; -using Apache.NMS.Test; -using NUnit.Framework; - -namespace Apache.NMS.Amqp.Test -{ - [TestFixture] - public class MessageDeliveryTest : NMSTestSupport - { - private Uri uri = new Uri(NMSTestSupport.ReplaceEnvVar("amqp:localhost:5672")); - private IConnectionFactory factory; - private Connection connection; - private ISession session; - private IDestination destination; - private IMessageProducer producer; - private IMessageConsumer consumer; - - [SetUp] - public override void SetUp() - { - factory = new NMSConnectionFactory(uri); - this.connection = (Connection) factory.CreateConnection(); - session = connection.CreateSession(); - destination = SessionUtil.GetDestination(session, "my-dest; {create:always}"); - producer = session.CreateProducer(destination); - consumer = session.CreateConsumer(destination); - } - - [TearDown] - public override void TearDown() - { - this.session = null; - - if(this.connection != null) - { - this.connection.Close(); - this.connection = null; - } - - base.TearDown(); - } - - - [Test] - public void TestMessageDelivery() - { - connection.Start(); - - IMessage message = session.CreateTextMessage("Test Message"); - producer.Send(message); - - IMessage resultMessage = consumer.Receive(); - - AssertEquals(message, resultMessage); - } - - } -} http://git-wip-us.apache.org/repos/asf/activemq-nms-amqp/blob/9122762b/src/test/csharp/MessageTest.cs ---------------------------------------------------------------------- diff --git a/src/test/csharp/MessageTest.cs b/src/test/csharp/MessageTest.cs deleted file mode 100644 index eb51ed2..0000000 --- a/src/test/csharp/MessageTest.cs +++ /dev/null @@ -1,789 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor licensete 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 NUnit.Framework; -using System; -using System.Text; -using System.Collections; -using Apache.NMS.Util; -using Apache.NMS.Amqp; - -namespace Apache.NMS.Amqp.Test -{ - [TestFixture] - public class MessageTest - { - private string nmsMessageID; - private string nmsCorrelationID; - private Topic nmsDestination; - private Topic nmsReplyTo; - private MsgDeliveryMode nmsDeliveryMode; - private bool nmsRedelivered; - private string nmsType; - private MsgPriority nmsPriority; - private DateTime nmsTimestamp; - private long[] consumerIDs; - - [SetUp] - public virtual void SetUp() - { - this.nmsMessageID = "testid"; - this.nmsCorrelationID = "testcorrelationid"; - this.nmsDestination = new Topic("TEST.Message"); - this.nmsReplyTo = new Topic("TEST.Message.replyto.topic:001"); - this.nmsDeliveryMode = MsgDeliveryMode.NonPersistent; - this.nmsRedelivered = true; - this.nmsType = "test type"; - this.nmsPriority = MsgPriority.High; - this.nmsTimestamp = DateTime.Now; - this.consumerIDs = new long[3]; - - for(int i = 0; i < this.consumerIDs.Length; i++) - { - this.consumerIDs[i] = i; - } - } - - [Test] - public void TestSetToForeignNMSID() - { - TextMessage msg = new TextMessage(); - msg.NMSMessageId = "SomeString"; - } - - [Test] - public void TestShallowCopy() - { - TextMessage msg1 = new TextMessage(); - msg1.NMSMessageId = nmsMessageID; - TextMessage msg2 = (TextMessage)msg1.Clone(); - Assert.IsTrue(msg1 != msg2); - Assert.IsTrue(msg1.Equals(msg2)); - msg2.NMSPriority = MsgPriority.Highest; - Assert.IsFalse(msg1.Equals(msg2)); - } - - [Test] - public void TestCopy() - { - this.nmsMessageID = "ID:1141:45278:429"; - this.nmsCorrelationID = "testcorrelationid"; - this.nmsDestination = new Topic("test.topic"); - this.nmsReplyTo = new Topic("test.replyto.topic:001"); - this.nmsDeliveryMode = MsgDeliveryMode.NonPersistent; - this.nmsType = "test type"; - this.nmsPriority = MsgPriority.High; - this.nmsTimestamp = DateTime.Now; - - TextMessage msg1 = new TextMessage(); - msg1.NMSMessageId = this.nmsMessageID; - msg1.NMSCorrelationID = this.nmsCorrelationID; - msg1.NMSDestination = this.nmsDestination; - msg1.NMSReplyTo = this.nmsReplyTo; - msg1.NMSDeliveryMode = this.nmsDeliveryMode; - msg1.NMSType = this.nmsType; - msg1.NMSPriority = this.nmsPriority; - msg1.NMSTimestamp = this.nmsTimestamp; - - TextMessage msg2 = msg1; - - Assert.IsTrue(msg1.NMSMessageId.Equals(msg2.NMSMessageId)); - Assert.IsTrue(msg1.NMSCorrelationID.Equals(msg2.NMSCorrelationID)); - Assert.IsTrue(msg1.NMSDestination.Equals(msg2.NMSDestination)); - Assert.IsTrue(msg1.NMSReplyTo.Equals(msg2.NMSReplyTo)); - Assert.IsTrue(msg1.NMSDeliveryMode == msg2.NMSDeliveryMode); - Assert.IsTrue(msg1.NMSRedelivered == msg2.NMSRedelivered); - Assert.IsTrue(msg1.NMSType.Equals(msg2.NMSType)); - Assert.IsTrue(msg1.NMSPriority == msg2.NMSPriority); - Assert.IsTrue(msg1.NMSTimestamp == msg2.NMSTimestamp); - } - - [Test] - public void TestGetAndSetNMSCorrelationID() - { - TextMessage msg = new TextMessage(); - msg.NMSCorrelationID = this.nmsCorrelationID; - Assert.IsTrue(msg.NMSCorrelationID.Equals(this.nmsCorrelationID)); - } - - [Test] - public void TestGetAndSetNMSReplyTo() - { - TextMessage msg = new TextMessage(); - msg.NMSReplyTo = this.nmsReplyTo; - Assert.AreEqual(msg.NMSReplyTo, this.nmsReplyTo); - } - - [Test] - public void TestGetAndSetNMSDeliveryMode() - { - TextMessage msg = new TextMessage(); - msg.NMSDeliveryMode = this.nmsDeliveryMode; - Assert.IsTrue(msg.NMSDeliveryMode == this.nmsDeliveryMode); - } - - [Test] - public void TestGetAndSetNMSType() - { - TextMessage msg = new TextMessage(); - msg.NMSType = this.nmsType; - Assert.AreEqual(msg.NMSType, this.nmsType); - } - - [Test] - public void TestGetAndSetNMSPriority() - { - TextMessage msg = new TextMessage(); - msg.NMSPriority = this.nmsPriority; - Assert.IsTrue(msg.NMSPriority == this.nmsPriority); - } - - public void TestClearProperties() - { - TextMessage msg = new TextMessage(); - msg.Properties.SetString("test", "test"); - msg.Content = new byte[1]; - msg.NMSMessageId = this.nmsMessageID; - msg.ClearProperties(); - Assert.IsNull(msg.Properties.GetString("test")); - Assert.IsNotNull(msg.NMSMessageId); - Assert.IsNotNull(msg.Content); - } - - [Test] - public void TestPropertyExists() - { - TextMessage msg = new TextMessage(); - msg.Properties.SetString("test", "test"); - Assert.IsTrue(msg.Properties.Contains("test")); - } - - [Test] - public void TestGetBooleanProperty() - { - TextMessage msg = new TextMessage(); - string name = "booleanProperty"; - msg.Properties.SetBool(name, true); - Assert.IsTrue(msg.Properties.GetBool(name)); - } - - [Test] - public void TestGetByteProperty() - { - TextMessage msg = new TextMessage(); - string name = "byteProperty"; - msg.Properties.SetByte(name, (byte)1); - Assert.IsTrue(msg.Properties.GetByte(name) == 1); - } - - [Test] - public void TestGetShortProperty() - { - TextMessage msg = new TextMessage(); - string name = "shortProperty"; - msg.Properties.SetShort(name, (short)1); - Assert.IsTrue(msg.Properties.GetShort(name) == 1); - } - - [Test] - public void TestGetIntProperty() - { - TextMessage msg = new TextMessage(); - string name = "intProperty"; - msg.Properties.SetInt(name, 1); - Assert.IsTrue(msg.Properties.GetInt(name) == 1); - } - - [Test] - public void TestGetLongProperty() - { - TextMessage msg = new TextMessage(); - string name = "longProperty"; - msg.Properties.SetLong(name, 1); - Assert.IsTrue(msg.Properties.GetLong(name) == 1); - } - - [Test] - public void TestGetFloatProperty() - { - TextMessage msg = new TextMessage(); - string name = "floatProperty"; - msg.Properties.SetFloat(name, 1.3f); - Assert.IsTrue(msg.Properties.GetFloat(name) == 1.3f); - } - - [Test] - public void TestGetDoubleProperty() - { - TextMessage msg = new TextMessage(); - string name = "doubleProperty"; - msg.Properties.SetDouble(name, 1.3d); - Assert.IsTrue(msg.Properties.GetDouble(name) == 1.3); - } - - [Test] - public void TestGetStringProperty() - { - TextMessage msg = new TextMessage(); - string name = "stringProperty"; - msg.Properties.SetString(name, name); - Assert.IsTrue(msg.Properties.GetString(name).Equals(name)); - } - - [Test] - public void TestGetObjectProperty() - { - TextMessage msg = new TextMessage(); - string name = "floatProperty"; - msg.Properties.SetFloat(name, 1.3f); - Assert.IsTrue(msg.Properties[name] is float); - Assert.IsTrue((float)msg.Properties[name] == 1.3f); - } - - [Test] - public void TestGetPropertyNames() - { - TextMessage msg = new TextMessage(); - string name = "floatProperty"; - msg.Properties.SetFloat(name, 1.3f); - - foreach(string key in msg.Properties.Keys) - { - Assert.IsTrue(key.Equals(name)); - } - } - - [Test] - public void TestSetObjectProperty() - { - TextMessage msg = new TextMessage(); - string name = "property"; - - try - { - msg.Properties[name] = "string"; - msg.Properties[name] = (Char) 1; - msg.Properties[name] = (Int16) 1; - msg.Properties[name] = (Int32) 1; - msg.Properties[name] = (Int64) 1; - msg.Properties[name] = (Byte)1; - msg.Properties[name] = (UInt16)1; - msg.Properties[name] = (UInt32)1; - msg.Properties[name] = (UInt64)1; - msg.Properties[name] = (Single)1.1f; - msg.Properties[name] = (Double) 1.1; - msg.Properties[name] = (Boolean) true; - msg.Properties[name] = null; - } - catch(NMSException) - { - Assert.Fail("should accept object primitives and String"); - } - - try - { - msg.Properties[name] = new Object(); - Assert.Fail("should accept only object primitives and String"); - } - catch(NMSException) - { - } - - try - { - msg.Properties[name] = new StringBuilder(); - Assert.Fail("should accept only object primitives and String"); - } - catch(NMSException) - { - } - } - - [Test] - public void TestConvertProperties() - { - TextMessage msg = new TextMessage(); - - // Set/verify a property using each supported AMQP data type - - msg.Properties["stringProperty"] = "string"; - msg.Properties["booleanProperty"] = (Boolean)true; - - msg.Properties["charProperty"] = (Char)'h'; - msg.Properties["shortProperty"] = (Int16) 2; - msg.Properties["intProperty"] = (Int32) 3; - msg.Properties["longProperty"] = (Int64) 4; - - msg.Properties["byteProperty"] = (Byte)5; - msg.Properties["ushortProperty"] = (UInt16)6; - msg.Properties["uintProperty"] = (UInt32)7; - msg.Properties["ulongProperty"] = (UInt64)8; - - msg.Properties["floatProperty"] = (Single)9.9f; - msg.Properties["doubleProperty"] = (Double) 10.1; - msg.Properties["nullProperty"] = null; - msg.Properties["guidProperty"] = new Guid("000102030405060708090a0b0c0d0e0f"); - - IPrimitiveMap properties = msg.Properties; - Assert.AreEqual(properties["stringProperty"], "string"); - Assert.AreEqual(properties["booleanProperty"], true); - - Assert.AreEqual((Char)properties["charProperty"], (Char)'h'); - Assert.AreEqual(properties["shortProperty"], (short) 2); - Assert.AreEqual(properties["intProperty"], (int) 3); - Assert.AreEqual(properties["longProperty"], (long) 4); - - Assert.AreEqual(properties["byteProperty"], (byte)5); - Assert.AreEqual(properties["ushortProperty"], (UInt16)6); - Assert.AreEqual(properties["uintProperty"], (int)7); - Assert.AreEqual(properties["ulongProperty"], (long)8); - - Assert.AreEqual(properties["floatProperty"], 9.9f); - Assert.AreEqual(properties["doubleProperty"], 10.1); - Assert.IsNull(properties["nullProperty"]); - Guid rxGuid = (Guid)properties["guidProperty"]; - Assert.AreEqual(rxGuid.ToString(), "00010203-0405-0607-0809-0a0b0c0d0e0f"); - } - - [Test] - public void TestSetNullProperty() - { - TextMessage msg = new TextMessage(); - string name = "cheese"; - msg.Properties.SetString(name, "Cheddar"); - Assert.AreEqual("Cheddar", msg.Properties.GetString(name)); - - msg.Properties.SetString(name, null); - Assert.AreEqual(null, msg.Properties.GetString(name)); - } - - [Test] - public void TestSetNullPropertyName() - { - TextMessage msg = new TextMessage(); - - try - { - msg.Properties.SetString(null, "Cheese"); - Assert.Fail("Should have thrown exception"); - } - catch(Exception) - { - } - } - - [Test] - public void TestSetEmptyPropertyName() - { - TextMessage msg = new TextMessage(); - - try - { - msg.Properties.SetString("", "Cheese"); - Assert.Fail("Should have thrown exception"); - } - catch(Exception) - { - } - } - - [Test] - public void TestGetAndSetNMSXDeliveryCount() - { - TextMessage msg = new TextMessage(); - msg.Properties.SetInt("NMSXDeliveryCount", 1); - int count = msg.Properties.GetInt("NMSXDeliveryCount"); - Assert.IsTrue(count == 1, "expected delivery count = 1 - got: " + count); - } - - [Test] - public void TestClearBody() - { - BytesMessage message = new BytesMessage(); - message.ClearBody(); - Assert.IsFalse(message.ReadOnlyBody); - } - - // - // Helper functions for TestPropertyConversionXxx tests. - // Demonstrate properties are inaccessible using various methods. - // Get the named property from the map. - // Assert that the Get function throws; display message on failure. - // - public void TestGetBoolThrows(IPrimitiveMap map, string name, string message) - { - try - { - map.GetBool(name); - Assert.Fail(message); - } - catch (NMSException) - { - } - } - - public void TestGetByteThrows(IPrimitiveMap map, string name, string message) - { - try - { - map.GetByte(name); - Assert.Fail(message); - } - catch (NMSException) - { - } - } - - public void TestGetBytesThrows(IPrimitiveMap map, string name, string message) - { - try - { - map.GetBytes(name); - Assert.Fail(message); - } - catch (NMSException) - { - } - } - - public void TestGetCharThrows(IPrimitiveMap map, string name, string message) - { - try - { - map.GetChar(name); - Assert.Fail(message); - } - catch (NMSException) - { - } - } - - public void TestGetDictionaryThrows(IPrimitiveMap map, string name, string message) - { - try - { - map.GetDictionary(name); - Assert.Fail(message); - } - catch (NMSException) - { - } - } - - public void TestGetDoubleThrows(IPrimitiveMap map, string name, string message) - { - try - { - map.GetDouble(name); - Assert.Fail(message); - } - catch (NMSException) - { - } - } - - public void TestGetFloatThrows(IPrimitiveMap map, string name, string message) - { - try - { - map.GetFloat(name); - Assert.Fail(message); - } - catch (NMSException) - { - } - } - - public void TestGetIntThrows(IPrimitiveMap map, string name, string message) - { - try - { - map.GetInt(name); - Assert.Fail(message); - } - catch (NMSException) - { - } - } - - public void TestGetListThrows(IPrimitiveMap map, string name, string message) - { - try - { - map.GetList(name); - Assert.Fail(message); - } - catch (NMSException) - { - } - } - - public void TestGetLongThrows(IPrimitiveMap map, string name, string message) - { - try - { - map.GetLong(name); - Assert.Fail(message); - } - catch (NMSException) - { - } - } - - public void TestGetShortThrows(IPrimitiveMap map, string name, string message) - { - try - { - map.GetShort(name); - Assert.Fail(message); - } - catch (NMSException) - { - } - } - - public void TestGetStringThrows(IPrimitiveMap map, string name, string message) - { - try - { - map.GetString(name); - Assert.Fail(message); - } - catch (NMSException) - { - } - } - - [Test] - public void TestPropertyConversionBoolean() - { - TextMessage msg = new TextMessage(); - String propertyName = "property"; - msg.Properties.SetBool(propertyName, true); - - Assert.AreEqual(msg.Properties[propertyName], true); - Assert.IsTrue(msg.Properties.GetBool(propertyName)); - Assert.AreEqual(msg.Properties[propertyName].ToString(), "True"); - - //TestGetBoolThrows(msg.Properties, propertyName, "GetBool should have thrown"); - TestGetByteThrows(msg.Properties, propertyName, "GetByte should have thrown"); - TestGetBytesThrows(msg.Properties, propertyName, "GetBytes should have thrown"); - TestGetCharThrows(msg.Properties, propertyName, "GetChar should have thrown"); - TestGetDictionaryThrows(msg.Properties, propertyName, "GetDictionary should have thrown"); - TestGetDoubleThrows(msg.Properties, propertyName, "GetDouble should have thrown"); - TestGetFloatThrows(msg.Properties, propertyName, "GetFloat should have thrown"); - TestGetIntThrows(msg.Properties, propertyName, "GetInt should have thrown"); - TestGetListThrows(msg.Properties, propertyName, "GetList should have thrown"); - TestGetLongThrows(msg.Properties, propertyName, "GetLong should have thrown"); - TestGetShortThrows(msg.Properties, propertyName, "GetShort should have thrown"); - TestGetStringThrows(msg.Properties, propertyName, "GetString should have thrown"); - } - - - [Test] - public void TestPropertyConversionByte() - { - TextMessage msg = new TextMessage(); - String propertyName = "property"; - msg.Properties.SetByte(propertyName, (byte)1); - - Assert.AreEqual(msg.Properties[propertyName], 1); - Assert.AreEqual(msg.Properties.GetByte(propertyName), 1); - Assert.AreEqual(msg.Properties[propertyName].ToString(), "1"); - - TestGetBoolThrows(msg.Properties, propertyName, "GetBool should have thrown"); - //TestGetByteThrows(msg.Properties, propertyName, "GetByte should have thrown"); - TestGetBytesThrows(msg.Properties, propertyName, "GetBytes should have thrown"); - TestGetCharThrows(msg.Properties, propertyName, "GetChar should have thrown"); - TestGetDictionaryThrows(msg.Properties, propertyName, "GetDictionary should have thrown"); - TestGetDoubleThrows(msg.Properties, propertyName, "GetDouble should have thrown"); - TestGetFloatThrows(msg.Properties, propertyName, "GetFloat should have thrown"); - TestGetIntThrows(msg.Properties, propertyName, "GetInt should have thrown"); - TestGetListThrows(msg.Properties, propertyName, "GetList should have thrown"); - TestGetLongThrows(msg.Properties, propertyName, "GetLong should have thrown"); - TestGetShortThrows(msg.Properties, propertyName, "GetShort should have thrown"); - TestGetStringThrows(msg.Properties, propertyName, "GetString should have thrown"); - } - - [Test] - public void TestPropertyConversionShort() - { - TextMessage msg = new TextMessage(); - String propertyName = "property"; - msg.Properties.SetShort(propertyName, (short)1); - - Assert.AreEqual((short)msg.Properties[propertyName], 1); - Assert.AreEqual(msg.Properties.GetShort(propertyName), 1); - Assert.AreEqual(msg.Properties[propertyName].ToString(), "1"); - - TestGetBoolThrows(msg.Properties, propertyName, "GetBool should have thrown"); - TestGetByteThrows(msg.Properties, propertyName, "GetByte should have thrown"); - TestGetBytesThrows(msg.Properties, propertyName, "GetBytes should have thrown"); - TestGetCharThrows(msg.Properties, propertyName, "GetChar should have thrown"); - TestGetDictionaryThrows(msg.Properties, propertyName, "GetDictionary should have thrown"); - TestGetDoubleThrows(msg.Properties, propertyName, "GetDouble should have thrown"); - TestGetFloatThrows(msg.Properties, propertyName, "GetFloat should have thrown"); - TestGetIntThrows(msg.Properties, propertyName, "GetInt should have thrown"); - TestGetListThrows(msg.Properties, propertyName, "GetList should have thrown"); - TestGetLongThrows(msg.Properties, propertyName, "GetLong should have thrown"); - //TestGetShortThrows(msg.Properties, propertyName, "GetShort should have thrown"); - TestGetStringThrows(msg.Properties, propertyName, "GetString should have thrown"); - } - - [Test] - public void TestPropertyConversionInt() - { - TextMessage msg = new TextMessage(); - String propertyName = "property"; - msg.Properties.SetInt(propertyName, (int)1); - - Assert.AreEqual((int)msg.Properties[propertyName], 1); - Assert.AreEqual(msg.Properties.GetInt(propertyName), 1); - Assert.AreEqual(msg.Properties[propertyName].ToString(), "1"); - - TestGetBoolThrows(msg.Properties, propertyName, "GetBool should have thrown"); - TestGetByteThrows(msg.Properties, propertyName, "GetByte should have thrown"); - TestGetBytesThrows(msg.Properties, propertyName, "GetBytes should have thrown"); - TestGetCharThrows(msg.Properties, propertyName, "GetChar should have thrown"); - TestGetDictionaryThrows(msg.Properties, propertyName, "GetDictionary should have thrown"); - TestGetDoubleThrows(msg.Properties, propertyName, "GetDouble should have thrown"); - TestGetFloatThrows(msg.Properties, propertyName, "GetFloat should have thrown"); - //TestGetIntThrows(msg.Properties, propertyName, "GetInt should have thrown"); - TestGetListThrows(msg.Properties, propertyName, "GetList should have thrown"); - TestGetLongThrows(msg.Properties, propertyName, "GetLong should have thrown"); - TestGetShortThrows(msg.Properties, propertyName, "GetShort should have thrown"); - TestGetStringThrows(msg.Properties, propertyName, "GetString should have thrown"); - } - - [Test] - public void TestPropertyConversionLong() - { - TextMessage msg = new TextMessage(); - String propertyName = "property"; - msg.Properties.SetLong(propertyName, 1); - - Assert.AreEqual((long)msg.Properties[propertyName], 1); - Assert.AreEqual(msg.Properties.GetLong(propertyName), 1); - Assert.AreEqual(msg.Properties[propertyName].ToString(), "1"); - - TestGetBoolThrows(msg.Properties, propertyName, "GetBool should have thrown"); - TestGetByteThrows(msg.Properties, propertyName, "GetByte should have thrown"); - TestGetBytesThrows(msg.Properties, propertyName, "GetBytes should have thrown"); - TestGetCharThrows(msg.Properties, propertyName, "GetChar should have thrown"); - TestGetDictionaryThrows(msg.Properties, propertyName, "GetDictionary should have thrown"); - TestGetDoubleThrows(msg.Properties, propertyName, "GetDouble should have thrown"); - TestGetFloatThrows(msg.Properties, propertyName, "GetFloat should have thrown"); - TestGetIntThrows(msg.Properties, propertyName, "GetInt should have thrown"); - TestGetListThrows(msg.Properties, propertyName, "GetList should have thrown"); - //TestGetLongThrows(msg.Properties, propertyName, "GetLong should have thrown"); - TestGetShortThrows(msg.Properties, propertyName, "GetShort should have thrown"); - TestGetStringThrows(msg.Properties, propertyName, "GetString should have thrown"); - } - - [Test] - public void TestPropertyConversionFloat() - { - TextMessage msg = new TextMessage(); - String propertyName = "property"; - float floatValue = (float)1.5; - msg.Properties.SetFloat(propertyName, floatValue); - Assert.AreEqual((float)msg.Properties[propertyName], floatValue, 0); - Assert.AreEqual(msg.Properties.GetFloat(propertyName), floatValue, 0); - Assert.AreEqual(msg.Properties[propertyName].ToString(), floatValue.ToString()); - - TestGetBoolThrows(msg.Properties, propertyName, "GetBool should have thrown"); - TestGetByteThrows(msg.Properties, propertyName, "GetByte should have thrown"); - TestGetBytesThrows(msg.Properties, propertyName, "GetBytes should have thrown"); - TestGetCharThrows(msg.Properties, propertyName, "GetChar should have thrown"); - TestGetDictionaryThrows(msg.Properties, propertyName, "GetDictionary should have thrown"); - TestGetDoubleThrows(msg.Properties, propertyName, "GetDouble should have thrown"); - //TestGetFloatThrows(msg.Properties, propertyName, "GetFloat should have thrown"); - TestGetIntThrows(msg.Properties, propertyName, "GetInt should have thrown"); - TestGetListThrows(msg.Properties, propertyName, "GetList should have thrown"); - TestGetLongThrows(msg.Properties, propertyName, "GetLong should have thrown"); - TestGetShortThrows(msg.Properties, propertyName, "GetShort should have thrown"); - TestGetStringThrows(msg.Properties, propertyName, "GetString should have thrown"); - } - - [Test] - public void TestPropertyConversionDouble() - { - TextMessage msg = new TextMessage(); - String propertyName = "property"; - Double doubleValue = 1.5; - msg.Properties.SetDouble(propertyName, doubleValue); - Assert.AreEqual((double)msg.Properties[propertyName], doubleValue, 0); - Assert.AreEqual(msg.Properties.GetDouble(propertyName), doubleValue, 0); - Assert.AreEqual(msg.Properties[propertyName].ToString(), doubleValue.ToString()); - - TestGetBoolThrows(msg.Properties, propertyName, "GetBool should have thrown"); - TestGetByteThrows(msg.Properties, propertyName, "GetByte should have thrown"); - TestGetBytesThrows(msg.Properties, propertyName, "GetBytes should have thrown"); - TestGetCharThrows(msg.Properties, propertyName, "GetChar should have thrown"); - TestGetDictionaryThrows(msg.Properties, propertyName, "GetDictionary should have thrown"); - //TestGetDoubleThrows(msg.Properties, propertyName, "GetDouble should have thrown"); - TestGetFloatThrows(msg.Properties, propertyName, "GetFloat should have thrown"); - TestGetIntThrows(msg.Properties, propertyName, "GetInt should have thrown"); - TestGetListThrows(msg.Properties, propertyName, "GetList should have thrown"); - TestGetLongThrows(msg.Properties, propertyName, "GetLong should have thrown"); - TestGetShortThrows(msg.Properties, propertyName, "GetShort should have thrown"); - TestGetStringThrows(msg.Properties, propertyName, "GetString should have thrown"); - } - - [Test] - public void TestPropertyConversionString() - { - TextMessage msg = new TextMessage(); - String propertyName = "property"; - String stringValue = "True"; - msg.Properties.SetString(propertyName, stringValue); - Assert.AreEqual(msg.Properties.GetString(propertyName), stringValue); - Assert.AreEqual((string)msg.Properties[propertyName], stringValue); - - stringValue = "1"; - msg.Properties.SetString(propertyName, stringValue); - // TODO: - //Assert.AreEqual(msg.Properties.GetByte(propertyName), 1); - //Assert.AreEqual(msg.Properties.GetShort(propertyName), 1); - //Assert.AreEqual(msg.Properties.GetInt(propertyName), 1); - //Assert.AreEqual(msg.Properties.GetLong(propertyName), 1); - - Double doubleValue = 1.5; - stringValue = doubleValue.ToString(); - msg.Properties.SetString(propertyName, stringValue); - // TODO: - //Assert.AreEqual(msg.Properties.GetFloat(propertyName), 1.5, 0); - //Assert.AreEqual(msg.Properties.GetDouble(propertyName), 1.5, 0); - - stringValue = "bad"; - msg.Properties.SetString(propertyName, stringValue); - - TestGetBoolThrows(msg.Properties, propertyName, "GetBool should have thrown"); - TestGetByteThrows(msg.Properties, propertyName, "GetByte should have thrown"); - TestGetBytesThrows(msg.Properties, propertyName, "GetBytes should have thrown"); - TestGetCharThrows(msg.Properties, propertyName, "GetChar should have thrown"); - TestGetDictionaryThrows(msg.Properties, propertyName, "GetDictionary should have thrown"); - TestGetDoubleThrows(msg.Properties, propertyName, "GetDouble should have thrown"); - TestGetFloatThrows(msg.Properties, propertyName, "GetFloat should have thrown"); - TestGetIntThrows(msg.Properties, propertyName, "GetInt should have thrown"); - TestGetListThrows(msg.Properties, propertyName, "GetList should have thrown"); - TestGetLongThrows(msg.Properties, propertyName, "GetLong should have thrown"); - TestGetShortThrows(msg.Properties, propertyName, "GetShort should have thrown"); - //TestGetStringThrows(msg.Properties, propertyName, "GetString should have thrown"); - } - } -} http://git-wip-us.apache.org/repos/asf/activemq-nms-amqp/blob/9122762b/src/test/csharp/NMSConnectionFactoryTest.cs ---------------------------------------------------------------------- diff --git a/src/test/csharp/NMSConnectionFactoryTest.cs b/src/test/csharp/NMSConnectionFactoryTest.cs deleted file mode 100644 index efb55a5..0000000 --- a/src/test/csharp/NMSConnectionFactoryTest.cs +++ /dev/null @@ -1,87 +0,0 @@ -/* - * 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.Net.Sockets; -using Apache.NMS.Test; -using NUnit.Framework; - -namespace Apache.NMS.Amqp.Test -{ - [TestFixture] - public class NMSConnectionFactoryTest - { - // These tests assume that a broker is running on amqp port 5672. - [Test] - // These cases should be accepted - [TestCase("amqp:localhost")] - [TestCase("amqp:tcp:localhost")] - [TestCase("amqp:user/pass@localhost")] - [TestCase("amqp:user/pass@tcp:localhost")] - [TestCase("amqp:user/pass@localhost:5672")] - [TestCase("amqp:user/pass@tcp:localhost:5672")] - [TestCase("amqp:[::1]")] - [TestCase("amqp:tcp:[::1]")] - [TestCase("amqp:user/pass@[::1]")] - [TestCase("amqp:user/pass@tcp:[::1]")] - [TestCase("amqp:user/pass@tcp:[::1]:5672")] - - // This case fails to connect to two hosts but then connects to the third - [TestCase("amqp:bogushost1,bogushost2:9988,localhost:5672")] - - // This test case causes NUnit to assert but is OK for a host name - //[TestCase("amqp:tcp:host-._~%ff%23:42")] - - // These test cases fail to parse the URI - [TestCase("amqp:tcp:", ExpectedException = typeof(ConnectionClosedException))] - [TestCase("amqp:", ExpectedException = typeof(ConnectionClosedException))] - [TestCase("amqp::5672", ExpectedException = typeof(ConnectionClosedException))] - - // These test cases pass parsing the URI but fail to connect - [TestCase("amqp:tcp:localhost:42", ExpectedException = typeof(ConnectionClosedException))] - [TestCase("amqp:hostlocal:42", ExpectedException = typeof(ConnectionClosedException))] - [TestCase("amqp:tcp", ExpectedException = typeof(ConnectionClosedException))] - [TestCase("amqp:876", ExpectedException = typeof(ConnectionClosedException))] - [TestCase("amqp:tcp:567", ExpectedException = typeof(ConnectionClosedException))] - [TestCase("amqp:[::]", ExpectedException = typeof(ConnectionClosedException))] - [TestCase("amqp:[::127.0.0.1]", ExpectedException = typeof(ConnectionClosedException))] - [TestCase("amqp:[2002::222:68ff:fe0b:e61a]", ExpectedException = typeof(ConnectionClosedException))] - [TestCase("amqp:[2002::222:68ff:fe0b:e61a]:123", ExpectedException = typeof(ConnectionClosedException))] - [TestCase("amqp:user@tcp:badhost:123", ExpectedException = typeof(ConnectionClosedException))] - [TestCase("amqp:user/pass@badhost", ExpectedException = typeof(ConnectionClosedException))] - [TestCase("amqp:user@badhost", ExpectedException = typeof(ConnectionClosedException))] - - public void TestURI(string connectionURI) - { - //Apache.NMS.Tracer.Trace = new Apache.NMS.Amqp.Test.NmsConsoleTracer(); - Tracer.Debug("Connecting to URI: " + connectionURI); - NMSConnectionFactory factory = new NMSConnectionFactory(connectionURI); - Assert.IsNotNull(factory); - Assert.IsNotNull(factory.ConnectionFactory); - using (IConnection connection = factory.CreateConnection("", "")) - { - Assert.IsNotNull(connection); - - // The connection URI values are not used when a factory is created - // nor when a connection is created. - // They are used when the connection is started. - connection.Start(); - } - } - - } -} http://git-wip-us.apache.org/repos/asf/activemq-nms-amqp/blob/9122762b/src/test/csharp/NmsConsoleTracer.cs ---------------------------------------------------------------------- diff --git a/src/test/csharp/NmsConsoleTracer.cs b/src/test/csharp/NmsConsoleTracer.cs deleted file mode 100644 index edce59b..0000000 --- a/src/test/csharp/NmsConsoleTracer.cs +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -namespace Apache.NMS.Amqp.Test -{ - public class NmsConsoleTracer : Apache.NMS.ITrace - { - #region ITrace Members - public void Debug(string message) - { - System.Console.WriteLine(string.Format("DEBUG: {0}", message)); - } - - public void Error(string message) - { - System.Console.WriteLine(string.Format("ERROR: {0}", message)); - } - - public void Fatal(string message) - { - System.Console.WriteLine(string.Format("FATAL: {0}", message)); - } - - public void Info(string message) - { - System.Console.WriteLine(string.Format("INFO: {0}", message)); - } - - public void Warn(string message) - { - System.Console.WriteLine(string.Format("WARN: {0}", message)); - } - - public bool IsDebugEnabled - { - get { return true; } - } - - public bool IsErrorEnabled - { - get { return true; } - } - - public bool IsFatalEnabled - { - get { return true; } - } - - public bool IsInfoEnabled - { - get { return true; } - } - - public bool IsWarnEnabled - { - get { return true; } - } - - #endregion - } -} http://git-wip-us.apache.org/repos/asf/activemq-nms-amqp/blob/9122762b/src/test/csharp/TextMessageTest.cs ---------------------------------------------------------------------- diff --git a/src/test/csharp/TextMessageTest.cs b/src/test/csharp/TextMessageTest.cs deleted file mode 100644 index 7b96192..0000000 --- a/src/test/csharp/TextMessageTest.cs +++ /dev/null @@ -1,160 +0,0 @@ -/* - * 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 NUnit.Framework; -using System; -using System.Text; -using System.IO; -using Apache.NMS.Amqp; - -namespace Apache.NMS.Amqp.Test -{ - [TestFixture] - public class TextMessageTest - { - [Test] - public void TestCommand() - { - TextMessage message = new TextMessage(); - - Assert.IsNull(message.Text); - - // Test with ASCII Data. - message.Text = "Hello World"; - Assert.IsNotNull(message.Text); - Assert.AreEqual("Hello World", message.Text); - - String unicodeString = - "This unicode string contains two characters " + - "with codes outside an 8-bit code range, " + - "Pi (\u03a0) and Sigma (\u03a3)."; - - message.Text = unicodeString; - Assert.IsNotNull(message.Text); - Assert.AreEqual(unicodeString, message.Text); - } - - [Test] - public void TestShallowCopy() - { - TextMessage msg = new TextMessage(); - string testString = "str"; - msg.Text = testString; - TextMessage copy = msg.Clone() as TextMessage; - Assert.IsTrue(msg.Text == ((TextMessage) copy).Text); - } - - [Test] - public void TestSetText() - { - TextMessage msg = new TextMessage(); - string str = "testText"; - msg.Text = str; - Assert.AreEqual(msg.Text, str); - } - - [Test] - public void TestClearBody() - { - TextMessage textMessage = new TextMessage(); - textMessage.Text = "string"; - textMessage.ClearBody(); - Assert.IsFalse(textMessage.ReadOnlyBody); - Assert.IsNull(textMessage.Text); - try - { - textMessage.Text = "String"; - Assert.IsTrue(textMessage.Text.Length > 0); - } - catch(MessageNotWriteableException) - { - Assert.Fail("should be writeable"); - } - catch(MessageNotReadableException) - { - Assert.Fail("should be readable"); - } - } - - // TODO: Support read-only/write-only -#if false - [Test] - public void TestReadOnlyBody() - { - TextMessage textMessage = new TextMessage(); - textMessage.Text = "test"; - textMessage.ReadOnlyBody = true; - try - { - Assert.IsTrue(textMessage.Text.Length > 0); - } - catch(MessageNotReadableException) - { - Assert.Fail("should be readable"); - } - try - { - textMessage.Text = "test"; - Assert.Fail("should throw exception"); - } - catch(MessageNotWriteableException) - { - } - } - - [Test] - public void TtestWriteOnlyBody() - { - // should always be readable - TextMessage textMessage = new TextMessage(); - textMessage.ReadOnlyBody = false; - try - { - textMessage.Text = "test"; - Assert.IsTrue(textMessage.Text.Length > 0); - } - catch(MessageNotReadableException) - { - Assert.Fail("should be readable"); - } - textMessage.ReadOnlyBody = true; - try - { - Assert.IsTrue(textMessage.Text.Length > 0); - textMessage.Text = "test"; - Assert.Fail("should throw exception"); - } - catch(MessageNotReadableException) - { - Assert.Fail("should be readable"); - } - catch(MessageNotWriteableException) - { - } - } -#endif - - [Test] - public void TestNullText() - { - TextMessage nullMessage = new TextMessage(); - Assert.IsNull(nullMessage.Text); - } - } -} http://git-wip-us.apache.org/repos/asf/activemq-nms-amqp/blob/9122762b/vs2008-HelloWorld.csproj ---------------------------------------------------------------------- diff --git a/vs2008-HelloWorld.csproj b/vs2008-HelloWorld.csproj deleted file mode 100644 index bcdcb7c..0000000 --- a/vs2008-HelloWorld.csproj +++ /dev/null @@ -1,115 +0,0 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">x86</Platform> - <ProductVersion>9.0.21022</ProductVersion> - <SchemaVersion>2.0</SchemaVersion> - <ProjectGuid>{DC7079D8-D4A1-41FB-9997-78914CFAACB0}</ProjectGuid> - <OutputType>Exe</OutputType> - <RootNamespace>Apache.NMS.AMQP.Test</RootNamespace> - <AssemblyName>vs2008-HelloWorld</AssemblyName> - <WarningLevel>4</WarningLevel> - <StartupObject> - </StartupObject> - <FileUpgradeFlags> - </FileUpgradeFlags> - <OldToolsVersion>2.0</OldToolsVersion> - <UpgradeBackupLocation> - </UpgradeBackupLocation> - <IsWebBootstrapper>false</IsWebBootstrapper> - <SignAssembly>true</SignAssembly> - <AssemblyOriginatorKeyFile>keyfile\NMSKey.snk</AssemblyOriginatorKeyFile> - <SccProjectName> - </SccProjectName> - <SccLocalPath> - </SccLocalPath> - <SccAuxPath> - </SccAuxPath> - <SccProvider> - </SccProvider> - <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> - <PublishUrl>publish\</PublishUrl> - <Install>true</Install> - <InstallFrom>Disk</InstallFrom> - <UpdateEnabled>false</UpdateEnabled> - <UpdateMode>Foreground</UpdateMode> - <UpdateInterval>7</UpdateInterval> - <UpdateIntervalUnits>Days</UpdateIntervalUnits> - <UpdatePeriodically>false</UpdatePeriodically> - <UpdateRequired>false</UpdateRequired> - <MapFileExtensions>true</MapFileExtensions> - <ApplicationRevision>0</ApplicationRevision> - <ApplicationVersion>1.0.0.%2a</ApplicationVersion> - <UseApplicationTrust>false</UseApplicationTrust> - <BootstrapperEnabled>true</BootstrapperEnabled> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> - <DebugSymbols>true</DebugSymbols> - <DebugType>full</DebugType> - <Optimize>false</Optimize> - <OutputPath>build\net-2.0\debug\</OutputPath> - <DefineConstants>TRACE;DEBUG;NET,NET_2_0</DefineConstants> - <AllowUnsafeBlocks>false</AllowUnsafeBlocks> - <NoWarn>3016</NoWarn> - <PlatformTarget>x86</PlatformTarget> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> - <DebugSymbols>true</DebugSymbols> - <Optimize>true</Optimize> - <OutputPath>build\net-2.0\release\</OutputPath> - <DefineConstants>TRACE;NET,NET_2_0</DefineConstants> - <AllowUnsafeBlocks>false</AllowUnsafeBlocks> - <DebugType>full</DebugType> - <NoWarn>3016</NoWarn> - <PlatformTarget>x86</PlatformTarget> - </PropertyGroup> - <ItemGroup> - <Reference Include="Apache.NMS, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL"> - <SpecificVersion>False</SpecificVersion> - <HintPath>lib\Apache.NMS\net-2.0\Apache.NMS.dll</HintPath> - </Reference> - <Reference Include="System" /> - <Reference Include="System.Messaging" /> - <Reference Include="System.Xml" /> - </ItemGroup> - <ItemGroup> - <Compile Include="src\test\csharp\CommonAssemblyInfo.cs" /> - <Compile Include="src\test\csharp\HelloWorld\HelloWorld.cs" /> - </ItemGroup> - <ItemGroup> - <BootstrapperPackage Include="Microsoft.Net.Framework.2.0"> - <Visible>False</Visible> - <ProductName>.NET Framework 2.0 %28x86%29</ProductName> - <Install>true</Install> - </BootstrapperPackage> - <BootstrapperPackage Include="Microsoft.Net.Framework.3.0"> - <Visible>False</Visible> - <ProductName>.NET Framework 3.0 %28x86%29</ProductName> - <Install>false</Install> - </BootstrapperPackage> - <BootstrapperPackage Include="Microsoft.Net.Framework.3.5"> - <Visible>False</Visible> - <ProductName>.NET Framework 3.5</ProductName> - <Install>false</Install> - </BootstrapperPackage> - </ItemGroup> - <ItemGroup> - <Content Include="nmsprovider-test.config"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - </ItemGroup> - <ItemGroup> - <None Include="keyfile\NMSKey.snk" /> - </ItemGroup> - <ItemGroup> - <ProjectReference Include="vs2008-amqp.csproj"> - <Project>{5CDFDA77-CFC2-4A6E-B731-6C06B59BFFE3}</Project> - <Name>vs2008-amqp</Name> - </ProjectReference> - </ItemGroup> - <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" /> - <PropertyGroup> - <PostBuildEvent>cd $(ProjectDir) -nant -nologo -q install-all -D:compile.skip=true</PostBuildEvent> - </PropertyGroup> -</Project> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/activemq-nms-amqp/blob/9122762b/vs2008-amqp-test.csproj ---------------------------------------------------------------------- diff --git a/vs2008-amqp-test.csproj b/vs2008-amqp-test.csproj deleted file mode 100644 index 11f123e..0000000 --- a/vs2008-amqp-test.csproj +++ /dev/null @@ -1,127 +0,0 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">x86</Platform> - <ProductVersion>9.0.30729</ProductVersion> - <SchemaVersion>2.0</SchemaVersion> - <ProjectGuid>{2F31ED5C-44A2-464A-BD55-2B5B010654E8}</ProjectGuid> - <OutputType>Library</OutputType> - <RootNamespace>Apache.NMS.AMQP.Test</RootNamespace> - <AssemblyName>Apache.NMS.AMQP.Test</AssemblyName> - <WarningLevel>4</WarningLevel> - <StartupObject> - </StartupObject> - <FileUpgradeFlags> - </FileUpgradeFlags> - <OldToolsVersion>2.0</OldToolsVersion> - <UpgradeBackupLocation> - </UpgradeBackupLocation> - <PublishUrl>publish\</PublishUrl> - <Install>true</Install> - <InstallFrom>Disk</InstallFrom> - <UpdateEnabled>false</UpdateEnabled> - <UpdateMode>Foreground</UpdateMode> - <UpdateInterval>7</UpdateInterval> - <UpdateIntervalUnits>Days</UpdateIntervalUnits> - <UpdatePeriodically>false</UpdatePeriodically> - <UpdateRequired>false</UpdateRequired> - <MapFileExtensions>true</MapFileExtensions> - <ApplicationRevision>0</ApplicationRevision> - <ApplicationVersion>1.0.0.%2a</ApplicationVersion> - <IsWebBootstrapper>false</IsWebBootstrapper> - <UseApplicationTrust>false</UseApplicationTrust> - <BootstrapperEnabled>true</BootstrapperEnabled> - <SignAssembly>true</SignAssembly> - <AssemblyOriginatorKeyFile>keyfile\NMSKey.snk</AssemblyOriginatorKeyFile> - <SccProjectName> - </SccProjectName> - <SccLocalPath> - </SccLocalPath> - <SccAuxPath> - </SccAuxPath> - <SccProvider> - </SccProvider> - <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> - <DebugSymbols>true</DebugSymbols> - <DebugType>full</DebugType> - <Optimize>false</Optimize> - <OutputPath>build\net-2.0\debug\</OutputPath> - <DefineConstants>TRACE;DEBUG;NET,NET_2_0</DefineConstants> - <AllowUnsafeBlocks>false</AllowUnsafeBlocks> - <NoWarn>3016</NoWarn> - <PlatformTarget>x86</PlatformTarget> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> - <DebugSymbols>true</DebugSymbols> - <Optimize>true</Optimize> - <OutputPath>build\net-2.0\release\</OutputPath> - <DefineConstants>TRACE;NET,NET_2_0</DefineConstants> - <AllowUnsafeBlocks>false</AllowUnsafeBlocks> - <DebugType>full</DebugType> - <NoWarn>3016</NoWarn> - <PlatformTarget>x86</PlatformTarget> - </PropertyGroup> - <ItemGroup> - <Reference Include="Apache.NMS, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL"> - <SpecificVersion>False</SpecificVersion> - <HintPath>lib\Apache.NMS\net-2.0\Apache.NMS.dll</HintPath> - </Reference> - <Reference Include="Apache.NMS.Test, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL"> - <SpecificVersion>False</SpecificVersion> - <HintPath>lib\Apache.NMS\net-2.0\Apache.NMS.Test.dll</HintPath> - </Reference> - <Reference Include="nunit.framework, Version=2.4.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL"> - <SpecificVersion>False</SpecificVersion> - <HintPath>lib\NUnit\net-2.0\nunit.framework.dll</HintPath> - </Reference> - <Reference Include="System" /> - <Reference Include="System.Xml" /> - </ItemGroup> - <ItemGroup> - <Compile Include="src\test\csharp\MessageTest.cs" /> - <Compile Include="src\test\csharp\MapMessageTest.cs" /> - <Compile Include="src\test\csharp\TextMessageTest.cs" /> - <Compile Include="src\test\csharp\NMSConnectionFactoryTest.cs" /> - <Compile Include="src\test\csharp\MessageDeliveryTest.cs" /> - <Compile Include="src\test\csharp\CommonAssemblyInfo.cs" /> - <Compile Include="src\test\csharp\NmsConsoleTracer.cs" /> - </ItemGroup> - <ItemGroup> - <BootstrapperPackage Include="Microsoft.Net.Framework.2.0"> - <Visible>False</Visible> - <ProductName>.NET Framework 2.0 %28x86%29</ProductName> - <Install>true</Install> - </BootstrapperPackage> - <BootstrapperPackage Include="Microsoft.Net.Framework.3.0"> - <Visible>False</Visible> - <ProductName>.NET Framework 3.0 %28x86%29</ProductName> - <Install>false</Install> - </BootstrapperPackage> - <BootstrapperPackage Include="Microsoft.Net.Framework.3.5"> - <Visible>False</Visible> - <ProductName>.NET Framework 3.5</ProductName> - <Install>false</Install> - </BootstrapperPackage> - </ItemGroup> - <ItemGroup> - <Content Include="nmsprovider-test.config"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - </ItemGroup> - <ItemGroup> - <None Include="keyfile\NMSKey.snk" /> - </ItemGroup> - <ItemGroup> - <ProjectReference Include="vs2008-amqp.csproj"> - <Project>{5CDFDA77-CFC2-4A6E-B731-6C06B59BFFE3}</Project> - <Name>vs2008-amqp</Name> - </ProjectReference> - </ItemGroup> - <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" /> - <PropertyGroup> - <PostBuildEvent>cd $(ProjectDir) -nant -nologo -q install-all -D:compile.skip=true</PostBuildEvent> - </PropertyGroup> -</Project> \ No newline at end of file
