From activemq-commits-return-941-apmail-geronimo-activemq-commits-archive=geronimo.apache.org@geronimo.apache.org Mon Mar 06 03:40:22 2006 Return-Path: Delivered-To: apmail-geronimo-activemq-commits-archive@www.apache.org Received: (qmail 29807 invoked from network); 6 Mar 2006 03:40:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Mar 2006 03:40:22 -0000 Received: (qmail 66309 invoked by uid 500); 6 Mar 2006 03:41:08 -0000 Delivered-To: apmail-geronimo-activemq-commits-archive@geronimo.apache.org Received: (qmail 66282 invoked by uid 500); 6 Mar 2006 03:41:08 -0000 Mailing-List: contact activemq-commits-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-dev@geronimo.apache.org Delivered-To: mailing list activemq-commits@geronimo.apache.org Received: (qmail 66273 invoked by uid 99); 6 Mar 2006 03:41:08 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Mar 2006 19:41:08 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Sun, 05 Mar 2006 19:41:07 -0800 Received: (qmail 29596 invoked by uid 65534); 6 Mar 2006 03:40:00 -0000 Message-ID: <20060306034000.29584.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r383459 [2/2] - in /incubator/activemq/trunk/openwire-dotnet: src/ src/ActiveMQ/OpenWire/ src/ActiveMQ/OpenWire/V1/ src/ActiveMQ/Transport/Tcp/ tests/ tests/ActiveMQ/OpenWire/ tests/JMS/ Date: Mon, 06 Mar 2006 03:39:54 -0000 To: activemq-commits@geronimo.apache.org From: chirino@apache.org X-Mailer: svnmailer-1.0.7 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Modified: incubator/activemq/trunk/openwire-dotnet/tests/JMS/MapMessageTest.cs URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/tests/JMS/MapMessageTest.cs?rev=383459&r1=383458&r2=383459&view=diff ============================================================================== --- incubator/activemq/trunk/openwire-dotnet/tests/JMS/MapMessageTest.cs (original) +++ incubator/activemq/trunk/openwire-dotnet/tests/JMS/MapMessageTest.cs Sun Mar 5 19:39:51 2006 @@ -31,6 +31,11 @@ int e = 0x12345678; long f = 0x1234567812345678; string g = "Hello World!"; + bool h = false; + byte i = 0xFF; + short j = -0x1234; + int k = -0x12345678; + long l = -0x1234567812345678; [SetUp] override public void SetUp() @@ -61,6 +66,11 @@ message.Body["e"] = e; message.Body["f"] = f; message.Body["g"] = g; + message.Body["h"] = h; + message.Body["i"] = i; + message.Body["j"] = j; + message.Body["k"] = k; + message.Body["l"] = l; return message; } @@ -83,6 +93,11 @@ Assert.AreEqual(e, mapMessage.Body["e"], "generic map entry: e"); Assert.AreEqual(f, mapMessage.Body["f"], "generic map entry: f"); Assert.AreEqual(g, mapMessage.Body["g"], "generic map entry: g"); + Assert.AreEqual(h, mapMessage.Body["h"], "generic map entry: h"); + Assert.AreEqual(i, mapMessage.Body["i"], "generic map entry: i"); + Assert.AreEqual(j, mapMessage.Body["j"], "generic map entry: j"); + Assert.AreEqual(k, mapMessage.Body["k"], "generic map entry: k"); + Assert.AreEqual(l, mapMessage.Body["l"], "generic map entry: l"); // use type safe APIs Assert.AreEqual(a, mapMessage.Body.GetBool("a"), "map entry: a"); @@ -92,8 +107,12 @@ Assert.AreEqual(e, mapMessage.Body.GetInt("e"), "map entry: e"); Assert.AreEqual(f, mapMessage.Body.GetLong("f"), "map entry: f"); Assert.AreEqual(g, mapMessage.Body.GetString("g"), "map entry: g"); - - + Assert.AreEqual(h, mapMessage.Body.GetBool("h"), "map entry: h"); + Assert.AreEqual(i, mapMessage.Body.GetByte("i"), "map entry: i"); + Assert.AreEqual(j, mapMessage.Body.GetShort("j"), "map entry: j"); + Assert.AreEqual(k, mapMessage.Body.GetInt("k"), "map entry: k"); + Assert.AreEqual(l, mapMessage.Body.GetLong("l"), "map entry: l"); + } protected string ToHex(long value) Added: incubator/activemq/trunk/openwire-dotnet/tests/JMS/MessageTest.cs URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/tests/JMS/MessageTest.cs?rev=383459&view=auto ============================================================================== --- incubator/activemq/trunk/openwire-dotnet/tests/JMS/MessageTest.cs (added) +++ incubator/activemq/trunk/openwire-dotnet/tests/JMS/MessageTest.cs Sun Mar 5 19:39:51 2006 @@ -0,0 +1,120 @@ +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * Licensed 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 JMS; +using NUnit.Framework; +using System; + +namespace tests +{ + [ TestFixture ] + public class MessageTest : JMSTestSupport + { + bool a = true; + byte b = 123; + char c = 'c'; + short d = 0x1234; + int e = 0x12345678; + long f = 0x1234567812345678; + string g = "Hello World!"; + bool h = false; + byte i = 0xFF; + short j = -0x1234; + int k = -0x12345678; + long l = -0x1234567812345678; + + [SetUp] + override public void SetUp() + { + base.SetUp(); + } + + [TearDown] + override public void TearDown() + { + base.TearDown(); + } + + [ Test ] + public override void SendAndSyncReceive() + { + base.SendAndSyncReceive(); + } + + protected override IMessage CreateMessage() + { + IMessage message = session.CreateMessage(); + + message.Properties["a"] = a; + message.Properties["b"] = b; + message.Properties["c"] = c; + message.Properties["d"] = d; + message.Properties["e"] = e; + message.Properties["f"] = f; + message.Properties["g"] = g; + message.Properties["h"] = h; + message.Properties["i"] = i; + message.Properties["j"] = j; + message.Properties["k"] = k; + message.Properties["l"] = l; + + return message; + } + + protected override void AssertValidMessage(IMessage message) + { + Console.WriteLine("Received message: " + message); + Console.WriteLine("Received Count: " + message.Properties.Count); + + Assert.AreEqual(ToHex(f), ToHex(message.Properties.GetLong("f")), "map entry: f as hex"); + + // use generic API to access entries + Assert.AreEqual(a, message.Properties["a"], "generic map entry: a"); + Assert.AreEqual(b, message.Properties["b"], "generic map entry: b"); + Assert.AreEqual(c, message.Properties["c"], "generic map entry: c"); + Assert.AreEqual(d, message.Properties["d"], "generic map entry: d"); + Assert.AreEqual(e, message.Properties["e"], "generic map entry: e"); + Assert.AreEqual(f, message.Properties["f"], "generic map entry: f"); + Assert.AreEqual(g, message.Properties["g"], "generic map entry: g"); + Assert.AreEqual(h, message.Properties["h"], "generic map entry: h"); + Assert.AreEqual(i, message.Properties["i"], "generic map entry: i"); + Assert.AreEqual(j, message.Properties["j"], "generic map entry: j"); + Assert.AreEqual(k, message.Properties["k"], "generic map entry: k"); + Assert.AreEqual(l, message.Properties["l"], "generic map entry: l"); + + // use type safe APIs + Assert.AreEqual(a, message.Properties.GetBool("a"), "map entry: a"); + Assert.AreEqual(b, message.Properties.GetByte("b"), "map entry: b"); + Assert.AreEqual(c, message.Properties.GetChar("c"), "map entry: c"); + Assert.AreEqual(d, message.Properties.GetShort("d"), "map entry: d"); + Assert.AreEqual(e, message.Properties.GetInt("e"), "map entry: e"); + Assert.AreEqual(f, message.Properties.GetLong("f"), "map entry: f"); + Assert.AreEqual(g, message.Properties.GetString("g"), "map entry: g"); + Assert.AreEqual(h, message.Properties.GetBool("h"), "map entry: h"); + Assert.AreEqual(i, message.Properties.GetByte("i"), "map entry: i"); + Assert.AreEqual(j, message.Properties.GetShort("j"), "map entry: j"); + Assert.AreEqual(k, message.Properties.GetInt("k"), "map entry: k"); + Assert.AreEqual(l, message.Properties.GetLong("l"), "map entry: l"); + + } + + protected string ToHex(long value) + { + return String.Format("{0:x}", value); + } + + } +} Modified: incubator/activemq/trunk/openwire-dotnet/tests/tests.csproj URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/tests/tests.csproj?rev=383459&r1=383458&r2=383459&view=diff ============================================================================== --- incubator/activemq/trunk/openwire-dotnet/tests/tests.csproj (original) +++ incubator/activemq/trunk/openwire-dotnet/tests/tests.csproj Sun Mar 5 19:39:51 2006 @@ -52,6 +52,7 @@ +