Return-Path: Delivered-To: apmail-geronimo-activemq-commits-archive@www.apache.org Received: (qmail 1987 invoked from network); 4 Mar 2006 08:19:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 4 Mar 2006 08:19:38 -0000 Received: (qmail 31491 invoked by uid 500); 4 Mar 2006 08:20:24 -0000 Delivered-To: apmail-geronimo-activemq-commits-archive@geronimo.apache.org Received: (qmail 31465 invoked by uid 500); 4 Mar 2006 08:20:24 -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 31440 invoked by uid 99); 4 Mar 2006 08:20:24 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 04 Mar 2006 00:20:23 -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; Sat, 04 Mar 2006 00:20:20 -0800 Received: (qmail 1784 invoked by uid 65534); 4 Mar 2006 08:19:13 -0000 Message-ID: <20060304081913.1783.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r383072 [1/2] - in /incubator/activemq/trunk/openwire-dotnet: ./ src/ tests/ tests/ActiveMQ/ tests/ActiveMQ/OpenWire/ Date: Sat, 04 Mar 2006 08:19:10 -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 Author: chirino Date: Sat Mar 4 00:19:09 2006 New Revision: 383072 URL: http://svn.apache.org/viewcvs?rev=383072&view=rev Log: Get it to compile after refactor Modified: incubator/activemq/trunk/openwire-dotnet/OpenWire.build incubator/activemq/trunk/openwire-dotnet/src/src.csproj incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/AsyncConsumeTest.cs incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/BadConsumeTest.cs incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/BytesMessageTest.cs incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/ClientTest.cs incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/CommandTest.cs incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/ConsumerTest.cs incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/EndianTest.cs incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/JMSPropertyTest.cs incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/MapMessageTest.cs incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/OpenWire/BooleanStreamTest.cs incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/TestMain.cs incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/TestSupport.cs incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/TransactionTest.cs incubator/activemq/trunk/openwire-dotnet/tests/tests.csproj Modified: incubator/activemq/trunk/openwire-dotnet/OpenWire.build URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/OpenWire.build?rev=383072&r1=383071&r2=383072&view=diff ============================================================================== --- incubator/activemq/trunk/openwire-dotnet/OpenWire.build (original) +++ incubator/activemq/trunk/openwire-dotnet/OpenWire.build Sat Mar 4 00:19:09 2006 @@ -148,8 +148,8 @@ - - + + @@ -165,8 +165,8 @@ - - + + Modified: incubator/activemq/trunk/openwire-dotnet/src/src.csproj URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/src/src.csproj?rev=383072&r1=383071&r2=383072&view=diff ============================================================================== --- incubator/activemq/trunk/openwire-dotnet/src/src.csproj (original) +++ incubator/activemq/trunk/openwire-dotnet/src/src.csproj Sat Mar 4 00:19:09 2006 @@ -1,186 +1,186 @@ - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {F7BA9EF7-ADF7-40EF-9A9E-206649DBB10C} - Library - src - src - 4 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - false - - - false - true - bin\Release\ - TRACE - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {F7BA9EF7-ADF7-40EF-9A9E-206649DBB10C} + Library + src + src + 4 + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + false + + + false + true + bin\Release\ + TRACE + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Modified: incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/AsyncConsumeTest.cs URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/AsyncConsumeTest.cs?rev=383072&r1=383071&r2=383072&view=diff ============================================================================== --- incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/AsyncConsumeTest.cs (original) +++ incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/AsyncConsumeTest.cs Sat Mar 4 00:19:09 2006 @@ -1,77 +1,91 @@ -using System; -using System.IO; -using System.Threading; - -using NUnit.Framework; - -using OpenWire.Client; -using OpenWire.Client.Core; -namespace OpenWire.Client -{ - [TestFixture] - public class AsyncConsumeTest : TestSupport - { - protected Object semaphore = new Object(); - protected bool received; - - [Test] - public void TestAsynchronousConsume() - { - IConnectionFactory factory = new ConnectionFactory("localhost", 61616); - Assert.IsTrue(factory != null, "no factory created"); - - using (IConnection connection = factory.CreateConnection()) - { - Assert.IsTrue(connection != null, "no connection created"); - Console.WriteLine("Connected to ActiveMQ!"); - - ISession session = connection.CreateSession(); - IDestination destination = CreateDestination(session); - Assert.IsTrue(destination != null, "No queue available!"); - - // lets create an async consumer - // START SNIPPET: demo - IMessageConsumer consumer = session.CreateConsumer(destination); - consumer.Listener += new MessageListener(OnMessage); - // END SNIPPET: demo - - - // now lets send a message - session = connection.CreateSession(); - IMessageProducer producer = session.CreateProducer(destination); - IMessage request = CreateMessage(session); - request.JMSCorrelationID = "abc"; - request.JMSType = "Test"; - producer.Send(request); - - - WaitForMessageToArrive(); - } - - } - - protected void OnMessage(IMessage message) - { - Console.WriteLine("Received message: " + message); - lock (semaphore) - { - received = true; - Monitor.PulseAll(semaphore); - } - - } - - protected void WaitForMessageToArrive() - { - lock (semaphore) - { - if (!received) - { - Monitor.Wait(semaphore, 10000); - } - } - Assert.AreEqual(true, received, "Should have received a message by now!"); - } - - } -} +/* + * 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 System; +using System.IO; +using System.Threading; + +using NUnit.Framework; + +namespace ActiveMQ +{ + [TestFixture] + public class AsyncConsumeTest : TestSupport + { + protected Object semaphore = new Object(); + protected bool received; + + [Test] + public void TestAsynchronousConsume() + { + IConnectionFactory factory = new ConnectionFactory("localhost", 61616); + Assert.IsTrue(factory != null, "no factory created"); + + using (IConnection connection = factory.CreateConnection()) + { + Assert.IsTrue(connection != null, "no connection created"); + Console.WriteLine("Connected to ActiveMQ!"); + + ISession session = connection.CreateSession(); + IDestination destination = CreateDestination(session); + Assert.IsTrue(destination != null, "No queue available!"); + + // lets create an async consumer + // START SNIPPET: demo + IMessageConsumer consumer = session.CreateConsumer(destination); + consumer.Listener += new MessageListener(OnMessage); + // END SNIPPET: demo + + + // now lets send a message + session = connection.CreateSession(); + IMessageProducer producer = session.CreateProducer(destination); + IMessage request = CreateMessage(session); + request.JMSCorrelationID = "abc"; + request.JMSType = "Test"; + producer.Send(request); + + + WaitForMessageToArrive(); + } + + } + + protected void OnMessage(IMessage message) + { + Console.WriteLine("Received message: " + message); + lock (semaphore) + { + received = true; + Monitor.PulseAll(semaphore); + } + + } + + protected void WaitForMessageToArrive() + { + lock (semaphore) + { + if (!received) + { + Monitor.Wait(semaphore, 10000); + } + } + Assert.AreEqual(true, received, "Should have received a message by now!"); + } + + } +} Modified: incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/BadConsumeTest.cs URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/BadConsumeTest.cs?rev=383072&r1=383071&r2=383072&view=diff ============================================================================== --- incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/BadConsumeTest.cs (original) +++ incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/BadConsumeTest.cs Sat Mar 4 00:19:09 2006 @@ -1,33 +1,49 @@ -using NUnit.Framework; -using System; - -namespace OpenWire.Client -{ - [TestFixture] - public class BadConsumeTest : TestSupport - { - [Test] - public void TestBadConsumeOperationToTestExceptions() - { - IConnectionFactory factory = new ConnectionFactory("localhost", 61616); - using (IConnection connection = factory.CreateConnection()) - { - ISession session = connection.CreateSession(); - - try - { - IMessageConsumer consumer = session.CreateConsumer(null); - Console.WriteLine("Created consumer: " + consumer); - - Assert.Fail("Should have thrown an exception!"); - } - catch (BrokerException e) - { - Console.WriteLine("Caught expected exception: " + e); - Console.WriteLine("Stack: " + e.StackTrace); - Console.WriteLine("Java Stack: " + e.JavaStackTrace); - } - } - } - } -} +/* + * 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 NUnit.Framework; +using System; + +namespace ActiveMQ +{ + [TestFixture] + public class BadConsumeTest : TestSupport + { + [Test] + public void TestBadConsumeOperationToTestExceptions() + { + IConnectionFactory factory = new ConnectionFactory("localhost", 61616); + using (IConnection connection = factory.CreateConnection()) + { + ISession session = connection.CreateSession(); + + try + { + IMessageConsumer consumer = session.CreateConsumer(null); + Console.WriteLine("Created consumer: " + consumer); + + Assert.Fail("Should have thrown an exception!"); + } + catch (BrokerException e) + { + Console.WriteLine("Caught expected exception: " + e); + Console.WriteLine("Stack: " + e.StackTrace); + Console.WriteLine("Java Stack: " + e.JavaStackTrace); + } + } + } + } +} Modified: incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/BytesMessageTest.cs URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/BytesMessageTest.cs?rev=383072&r1=383071&r2=383072&view=diff ============================================================================== --- incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/BytesMessageTest.cs (original) +++ incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/BytesMessageTest.cs Sat Mar 4 00:19:09 2006 @@ -1,58 +1,55 @@ -/* - * 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 System; -using System.IO; - -using NUnit.Framework; - -using OpenWire.Client; -using OpenWire.Client.Core; - -namespace OpenWire.Client -{ - [ TestFixture ] - public class BytesMessageTest : TestSupport - { - byte[] expected = {1, 2, 3, 4, 5, 6, 7, 8}; - - [ Test ] - public override void SendAndSyncReceive() - { - base.SendAndSyncReceive(); - } - - protected override IMessage CreateMessage(ISession session) - { - IBytesMessage request = session.CreateBytesMessage(expected); - return request; - } - - protected override void AssertValidMessage(IMessage message) - { - Assert.IsTrue(message is IBytesMessage, "Did not receive a IBytesMessage: " + message); - - Console.WriteLine("Received IBytesMessage: " + message); - - IBytesMessage bytesMessage = (IBytesMessage) message; - byte[] actual = bytesMessage.Content; - Console.WriteLine("Received message with content: " + actual); - Assert.AreEqual(expected, actual, "the message content"); - } - - } -} - +/* + * 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 System; +using System.IO; + +using NUnit.Framework; + +namespace ActiveMQ +{ + [ TestFixture ] + public class BytesMessageTest : TestSupport + { + byte[] expected = {1, 2, 3, 4, 5, 6, 7, 8}; + + [ Test ] + public override void SendAndSyncReceive() + { + base.SendAndSyncReceive(); + } + + protected override IMessage CreateMessage(ISession session) + { + IBytesMessage request = session.CreateBytesMessage(expected); + return request; + } + + protected override void AssertValidMessage(IMessage message) + { + Assert.IsTrue(message is IBytesMessage, "Did not receive a IBytesMessage: " + message); + + Console.WriteLine("Received IBytesMessage: " + message); + + IBytesMessage bytesMessage = (IBytesMessage) message; + byte[] actual = bytesMessage.Content; + Console.WriteLine("Received message with content: " + actual); + Assert.AreEqual(expected, actual, "the message content"); + } + + } +} + Modified: incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/ClientTest.cs URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/ClientTest.cs?rev=383072&r1=383071&r2=383072&view=diff ============================================================================== --- incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/ClientTest.cs (original) +++ incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/ClientTest.cs Sat Mar 4 00:19:09 2006 @@ -19,10 +19,7 @@ using NUnit.Framework; -using OpenWire.Client; -using OpenWire.Client.Core; - -namespace OpenWire.Client +namespace ActiveMQ { [ TestFixture ] public class ClientTest : TestSupport Modified: incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/CommandTest.cs URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/CommandTest.cs?rev=383072&r1=383071&r2=383072&view=diff ============================================================================== --- incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/CommandTest.cs (original) +++ incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/CommandTest.cs Sat Mar 4 00:19:09 2006 @@ -1,61 +1,63 @@ -/* - * 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 NUnit.Framework; -using OpenWire.Client.Commands; -using System.Collections; - -namespace OpenWire.Client -{ - [TestFixture] - public class CommandTest - { - - [Test] - public void TestCommand() - { - ConsumerId value1 = new ConsumerId(); - value1.ConnectionId = "abc"; - value1.SessionId = 123; - value1.Value = 456; - - ConsumerId value2 = new ConsumerId(); - value2.ConnectionId = "abc"; - value2.SessionId = 123; - value2.Value = 456; - - ConsumerId value3 = new ConsumerId(); - value3.ConnectionId = "abc"; - value3.SessionId = 123; - value3.Value = 457; - - Assert.AreEqual(value1, value2, "value1 and value2 should be equal"); - Assert.AreEqual(value1.GetHashCode(), value2.GetHashCode(), "value1 and value2 hash codes should be equal"); - - Assert.IsTrue(!value1.Equals(value3), "value1 and value3 should not be equal"); - Assert.IsTrue(!value3.Equals(value2), "value3 and value2 should not be equal"); - - // now lets test an IDictionary - IDictionary dictionary = new Hashtable(); - dictionary[value1] = value3; - - // now lets lookup with a copy - object actual = dictionary[value2]; - - Assert.AreEqual(value3, actual, "Should have found item in Map using value2 as a key"); - } - } -} +/* + * 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 NUnit.Framework; +using System.Collections; + +using ActiveMQ.OpenWire; +using ActiveMQ.OpenWire.Commands; + +namespace ActiveMQ +{ + [TestFixture] + public class CommandTest + { + + [Test] + public void TestCommand() + { + ConsumerId value1 = new ConsumerId(); + value1.ConnectionId = "abc"; + value1.SessionId = 123; + value1.Value = 456; + + ConsumerId value2 = new ConsumerId(); + value2.ConnectionId = "abc"; + value2.SessionId = 123; + value2.Value = 456; + + ConsumerId value3 = new ConsumerId(); + value3.ConnectionId = "abc"; + value3.SessionId = 123; + value3.Value = 457; + + Assert.AreEqual(value1, value2, "value1 and value2 should be equal"); + Assert.AreEqual(value1.GetHashCode(), value2.GetHashCode(), "value1 and value2 hash codes should be equal"); + + Assert.IsTrue(!value1.Equals(value3), "value1 and value3 should not be equal"); + Assert.IsTrue(!value3.Equals(value2), "value3 and value2 should not be equal"); + + // now lets test an IDictionary + IDictionary dictionary = new Hashtable(); + dictionary[value1] = value3; + + // now lets lookup with a copy + object actual = dictionary[value2]; + + Assert.AreEqual(value3, actual, "Should have found item in Map using value2 as a key"); + } + } +} Modified: incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/ConsumerTest.cs URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/ConsumerTest.cs?rev=383072&r1=383071&r2=383072&view=diff ============================================================================== --- incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/ConsumerTest.cs (original) +++ incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/ConsumerTest.cs Sat Mar 4 00:19:09 2006 @@ -1,92 +1,89 @@ -/* - * 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 System; -using System.IO; - -using NUnit.Framework; - -using OpenWire.Client; -using OpenWire.Client.Core; - -namespace OpenWire.Client -{ - [TestFixture] - public class ConsumerTest : TestSupport - { - IConnectionFactory factory; - IConnection connection; - IDestination destination; - - [SetUp] - protected void SetUp() - { - factory = new ConnectionFactory("localhost", 61616); - connection = factory.CreateConnection(); - } - - [TearDown] - protected void TearDown() - { - connection.Dispose(); - } - - [Test] - [Ignore("Not fully implemented yet.")] - public void testDurableConsumerSelectorChange() - { - - // Receive a message with the JMS API - connection.ClientId="test"; - connection.Start(); - - ISession session = connection.CreateSession(AcknowledgementMode.AutoAcknowledge); - destination = session.GetTopic("foo"); - IMessageProducer producer = session.CreateProducer(destination); - producer.Persistent = true; - IMessageConsumer consumer = session.CreateDurableConsumer((ITopic)destination, "test", "color='red'", false); - - // Send the messages - ITextMessage message = session.CreateTextMessage("1st"); - //message.SetStringProperty("color", "red"); - producer.Send(message); - - IMessage m = consumer.Receive(1000); - Assert.IsNotNull(m); - Assert.AreEqual("1st", ((ITextMessage)m).Text ); - - // Change the subscription. - consumer.Dispose(); - consumer = session.CreateDurableConsumer((ITopic)destination, "test", "color='blue'", false); - - message = session.CreateTextMessage("2nd"); - // message.setStringProperty("color", "red"); - producer.Send(message); - message = session.CreateTextMessage("3rd"); - // message.setStringProperty("color", "blue"); - producer.Send(message); - - // Selector should skip the 2nd message. - m = consumer.Receive(1000); - Assert.IsNotNull(m); - Assert.AreEqual("3rd", ((ITextMessage)m).Text); - - Assert.IsNull(consumer.ReceiveNoWait()); - } - - } -} - +/* + * 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 System; +using System.IO; + +using NUnit.Framework; + +namespace ActiveMQ +{ + [TestFixture] + public class ConsumerTest : TestSupport + { + IConnectionFactory factory; + IConnection connection; + IDestination destination; + + [SetUp] + protected void SetUp() + { + factory = new ConnectionFactory("localhost", 61616); + connection = factory.CreateConnection(); + } + + [TearDown] + protected void TearDown() + { + connection.Dispose(); + } + + [Test] + [Ignore("Not fully implemented yet.")] + public void testDurableConsumerSelectorChange() + { + + // Receive a message with the JMS API + connection.ClientId="test"; + connection.Start(); + + ISession session = connection.CreateSession(AcknowledgementMode.AutoAcknowledge); + destination = session.GetTopic("foo"); + IMessageProducer producer = session.CreateProducer(destination); + producer.Persistent = true; + IMessageConsumer consumer = session.CreateDurableConsumer((ITopic)destination, "test", "color='red'", false); + + // Send the messages + ITextMessage message = session.CreateTextMessage("1st"); + //message.SetStringProperty("color", "red"); + producer.Send(message); + + IMessage m = consumer.Receive(1000); + Assert.IsNotNull(m); + Assert.AreEqual("1st", ((ITextMessage)m).Text ); + + // Change the subscription. + consumer.Dispose(); + consumer = session.CreateDurableConsumer((ITopic)destination, "test", "color='blue'", false); + + message = session.CreateTextMessage("2nd"); + // message.setStringProperty("color", "red"); + producer.Send(message); + message = session.CreateTextMessage("3rd"); + // message.setStringProperty("color", "blue"); + producer.Send(message); + + // Selector should skip the 2nd message. + m = consumer.Receive(1000); + Assert.IsNotNull(m); + Assert.AreEqual("3rd", ((ITextMessage)m).Text); + + Assert.IsNull(consumer.ReceiveNoWait()); + } + + } +} + Modified: incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/EndianTest.cs URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/EndianTest.cs?rev=383072&r1=383071&r2=383072&view=diff ============================================================================== --- incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/EndianTest.cs (original) +++ incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/EndianTest.cs Sat Mar 4 00:19:09 2006 @@ -1,76 +1,78 @@ -/* - * 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 NUnit.Framework; -using OpenWire.Client.Core; -using System; - -namespace openwire_dotnet -{ - [TestFixture] - public class EndianTest - { - - [Test] - public void TestLongEndian() - { - long value = 0x0102030405060708L; - - long newValue = BaseDataStreamMarshaller.SwitchEndian(value); - - Console.WriteLine("New value: " + newValue); - - Assert.AreEqual(0x0807060504030201L, newValue); - - long actual = BaseDataStreamMarshaller.SwitchEndian(newValue); - - Assert.AreEqual(value, actual); - } - - [Test] - public void TestIntEndian() - { - int value = 0x12345678; - - int newValue = BaseDataStreamMarshaller.SwitchEndian(value); - - Console.WriteLine("New value: " + newValue); - - Assert.AreEqual(0x78563412, newValue); - - int actual = BaseDataStreamMarshaller.SwitchEndian(newValue); - - Assert.AreEqual(value, actual); - } - [Test] - public void TestShortEndian() - { - short value = 0x1234; - - short newValue = BaseDataStreamMarshaller.SwitchEndian(value); - - Console.WriteLine("New value: " + newValue); - - Assert.AreEqual(0x3412, newValue); - - short actual = BaseDataStreamMarshaller.SwitchEndian(newValue); - - Assert.AreEqual(value, actual); - } - } -} - - +/* + * 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 NUnit.Framework; +using System; + +using ActiveMQ.OpenWire; +using ActiveMQ.OpenWire.Commands; + +namespace ActiveMQ +{ + [TestFixture] + public class EndianTest + { + + [Test] + public void TestLongEndian() + { + long value = 0x0102030405060708L; + + long newValue = BaseDataStreamMarshaller.SwitchEndian(value); + + Console.WriteLine("New value: " + newValue); + + Assert.AreEqual(0x0807060504030201L, newValue); + + long actual = BaseDataStreamMarshaller.SwitchEndian(newValue); + + Assert.AreEqual(value, actual); + } + + [Test] + public void TestIntEndian() + { + int value = 0x12345678; + + int newValue = BaseDataStreamMarshaller.SwitchEndian(value); + + Console.WriteLine("New value: " + newValue); + + Assert.AreEqual(0x78563412, newValue); + + int actual = BaseDataStreamMarshaller.SwitchEndian(newValue); + + Assert.AreEqual(value, actual); + } + [Test] + public void TestShortEndian() + { + short value = 0x1234; + + short newValue = BaseDataStreamMarshaller.SwitchEndian(value); + + Console.WriteLine("New value: " + newValue); + + Assert.AreEqual(0x3412, newValue); + + short actual = BaseDataStreamMarshaller.SwitchEndian(newValue); + + Assert.AreEqual(value, actual); + } + } +} + + Modified: incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/JMSPropertyTest.cs URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/JMSPropertyTest.cs?rev=383072&r1=383071&r2=383072&view=diff ============================================================================== --- incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/JMSPropertyTest.cs (original) +++ incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/JMSPropertyTest.cs Sat Mar 4 00:19:09 2006 @@ -1,127 +1,124 @@ -/* - * 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 System; -using System.IO; - -using NUnit.Framework; - -using OpenWire.Client; -using OpenWire.Client.Core; - -namespace OpenWire.Client -{ - [ TestFixture ] - public class JMSPropertyTest : TestSupport - { - // standard JMS properties - string expectedText = "Hey this works!"; - string correlationID = "abc"; - ITemporaryQueue replyTo; - bool persistent = true; - byte priority = 5; - String type = "FooType"; - String groupID = "MyGroup"; - int groupSeq = 1; - - // custom properties - string customText = "Cheese"; - bool custom1 = true; - byte custom2 = 12; - short custom3 = 0x1234; - int custom4 = 0x12345678; - long custom5 = 0x1234567812345678; - char custom6 = 'J'; - - [ Test ] - public override void SendAndSyncReceive() - { - base.SendAndSyncReceive(); - } - - protected override IMessage CreateMessage(ISession session) - { - ITextMessage message = session.CreateTextMessage(expectedText); - replyTo = session.CreateTemporaryQueue(); - - // lets set the headers - message.JMSCorrelationID = correlationID; - message.JMSReplyTo = replyTo; - message.JMSPersistent = persistent; - message.JMSPriority = priority; - message.JMSType = type; - message.JMSXGroupID = groupID; - message.JMSXGroupSeq = groupSeq; - - // lets set the custom headers - message.Properties["customText"] = customText; - message.Properties["custom1"] = custom1; - message.Properties["custom2"] = custom2; - message.Properties["custom3"] = custom3; - message.Properties["custom4"] = custom4; - message.Properties["custom5"] = custom5; - message.Properties["custom6"] = custom6; - - return message; - } - - protected override void AssertValidMessage(IMessage message) - { - Assert.IsTrue(message is ITextMessage, "Did not receive a ITextMessage!"); - - Console.WriteLine("Received Message: " + message); - - ITextMessage textMessage = (ITextMessage) message; - String text = textMessage.Text; - Assert.AreEqual(expectedText, text, "the message text"); - - // compare standard JMS headers - Assert.AreEqual(correlationID, message.JMSCorrelationID, "JMSCorrelationID"); - Assert.AreEqual(replyTo, message.JMSReplyTo, "JMSReplyTo"); - Assert.AreEqual(persistent, message.JMSPersistent, "JMSPersistent"); - Assert.AreEqual(priority, message.JMSPriority, "JMSPriority"); - Assert.AreEqual(type, message.JMSType, "JMSType"); - Assert.AreEqual(groupID, message.JMSXGroupID, "JMSXGroupID"); - Assert.AreEqual(groupSeq, message.JMSXGroupSeq, "JMSXGroupSeq"); - - // compare custom headers - Assert.AreEqual(customText, message.Properties["customText"], "customText"); - Assert.AreEqual(custom1, message.Properties["custom1"], "custom1"); - Assert.AreEqual(custom2, message.Properties["custom2"], "custom2"); - Assert.AreEqual(custom3, message.Properties["custom3"], "custom3"); - Assert.AreEqual(custom4, message.Properties["custom4"], "custom4"); - // TODO - Assert.AreEqual(custom5, message.Properties["custom5"], "custom5"); - Assert.AreEqual(custom6, message.Properties["custom6"], "custom6"); - - Assert.AreEqual(custom1, message.Properties.GetBool("custom1"), "custom1"); - Assert.AreEqual(custom2, message.Properties.GetByte("custom2"), "custom2"); - Assert.AreEqual(custom3, message.Properties.GetShort("custom3"), "custom3"); - Assert.AreEqual(custom4, message.Properties.GetInt("custom4"), "custom4"); - Assert.AreEqual(custom5, message.Properties.GetLong("custom5"), "custom5"); - Assert.AreEqual(custom6, message.Properties.GetChar("custom6"), "custom6"); - - // lets now look at some standard JMS headers - Console.WriteLine("JMSExpiration: " + message.JMSExpiration); - Console.WriteLine("JMSMessageId: " + message.JMSMessageId); - Console.WriteLine("JMSRedelivered: " + message.JMSRedelivered); - Console.WriteLine("JMSTimestamp: " + message.JMSTimestamp); - Console.WriteLine("JMSXDeliveryCount: " + message.JMSXDeliveryCount); - Console.WriteLine("JMSXProducerTXID: " + message.JMSXProducerTXID); - } - } -} - +/* + * 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 System; +using System.IO; + +using NUnit.Framework; + +namespace ActiveMQ +{ + [ TestFixture ] + public class JMSPropertyTest : TestSupport + { + // standard JMS properties + string expectedText = "Hey this works!"; + string correlationID = "abc"; + ITemporaryQueue replyTo; + bool persistent = true; + byte priority = 5; + String type = "FooType"; + String groupID = "MyGroup"; + int groupSeq = 1; + + // custom properties + string customText = "Cheese"; + bool custom1 = true; + byte custom2 = 12; + short custom3 = 0x1234; + int custom4 = 0x12345678; + long custom5 = 0x1234567812345678; + char custom6 = 'J'; + + [ Test ] + public override void SendAndSyncReceive() + { + base.SendAndSyncReceive(); + } + + protected override IMessage CreateMessage(ISession session) + { + ITextMessage message = session.CreateTextMessage(expectedText); + replyTo = session.CreateTemporaryQueue(); + + // lets set the headers + message.JMSCorrelationID = correlationID; + message.JMSReplyTo = replyTo; + message.JMSPersistent = persistent; + message.JMSPriority = priority; + message.JMSType = type; + message.JMSXGroupID = groupID; + message.JMSXGroupSeq = groupSeq; + + // lets set the custom headers + message.Properties["customText"] = customText; + message.Properties["custom1"] = custom1; + message.Properties["custom2"] = custom2; + message.Properties["custom3"] = custom3; + message.Properties["custom4"] = custom4; + message.Properties["custom5"] = custom5; + message.Properties["custom6"] = custom6; + + return message; + } + + protected override void AssertValidMessage(IMessage message) + { + Assert.IsTrue(message is ITextMessage, "Did not receive a ITextMessage!"); + + Console.WriteLine("Received Message: " + message); + + ITextMessage textMessage = (ITextMessage) message; + String text = textMessage.Text; + Assert.AreEqual(expectedText, text, "the message text"); + + // compare standard JMS headers + Assert.AreEqual(correlationID, message.JMSCorrelationID, "JMSCorrelationID"); + Assert.AreEqual(replyTo, message.JMSReplyTo, "JMSReplyTo"); + Assert.AreEqual(persistent, message.JMSPersistent, "JMSPersistent"); + Assert.AreEqual(priority, message.JMSPriority, "JMSPriority"); + Assert.AreEqual(type, message.JMSType, "JMSType"); + Assert.AreEqual(groupID, message.JMSXGroupID, "JMSXGroupID"); + Assert.AreEqual(groupSeq, message.JMSXGroupSeq, "JMSXGroupSeq"); + + // compare custom headers + Assert.AreEqual(customText, message.Properties["customText"], "customText"); + Assert.AreEqual(custom1, message.Properties["custom1"], "custom1"); + Assert.AreEqual(custom2, message.Properties["custom2"], "custom2"); + Assert.AreEqual(custom3, message.Properties["custom3"], "custom3"); + Assert.AreEqual(custom4, message.Properties["custom4"], "custom4"); + // TODO + Assert.AreEqual(custom5, message.Properties["custom5"], "custom5"); + Assert.AreEqual(custom6, message.Properties["custom6"], "custom6"); + + Assert.AreEqual(custom1, message.Properties.GetBool("custom1"), "custom1"); + Assert.AreEqual(custom2, message.Properties.GetByte("custom2"), "custom2"); + Assert.AreEqual(custom3, message.Properties.GetShort("custom3"), "custom3"); + Assert.AreEqual(custom4, message.Properties.GetInt("custom4"), "custom4"); + Assert.AreEqual(custom5, message.Properties.GetLong("custom5"), "custom5"); + Assert.AreEqual(custom6, message.Properties.GetChar("custom6"), "custom6"); + + // lets now look at some standard JMS headers + Console.WriteLine("JMSExpiration: " + message.JMSExpiration); + Console.WriteLine("JMSMessageId: " + message.JMSMessageId); + Console.WriteLine("JMSRedelivered: " + message.JMSRedelivered); + Console.WriteLine("JMSTimestamp: " + message.JMSTimestamp); + Console.WriteLine("JMSXDeliveryCount: " + message.JMSXDeliveryCount); + Console.WriteLine("JMSXProducerTXID: " + message.JMSXProducerTXID); + } + } +} + Modified: incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/MapMessageTest.cs URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/MapMessageTest.cs?rev=383072&r1=383071&r2=383072&view=diff ============================================================================== --- incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/MapMessageTest.cs (original) +++ incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/MapMessageTest.cs Sat Mar 4 00:19:09 2006 @@ -1,95 +1,92 @@ -/* - * 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 System; -using System.IO; - -using NUnit.Framework; - -using OpenWire.Client; -using OpenWire.Client.Core; - -namespace OpenWire.Client -{ - [ TestFixture ] - public class MapMessageTest : TestSupport - { - bool a = true; - byte b = 123; - char c = 'c'; - short d = 0x1234; - int e = 0x12345678; - long f = 0x1234567812345678; - string g = "Hello World!"; - - [ Test ] - public override void SendAndSyncReceive() - { - base.SendAndSyncReceive(); - } - - protected override IMessage CreateMessage(ISession session) - { - IMapMessage message = session.CreateMapMessage(); - - message.Body["a"] = a; - message.Body["b"] = b; - message.Body["c"] = c; - message.Body["d"] = d; - message.Body["e"] = e; - message.Body["f"] = f; - message.Body["g"] = g; - - return message; - } - - protected override void AssertValidMessage(IMessage message) - { - Assert.IsTrue(message is IMapMessage, "Did not receive a MapMessage!"); - IMapMessage mapMessage = (IMapMessage) message; - - Console.WriteLine("Received MapMessage: " + message); - Console.WriteLine("Received Count: " + mapMessage.Body.Count); - - Assert.AreEqual(ToHex(f), ToHex(mapMessage.Body.GetLong("f")), "map entry: f as hex"); - - // use generic API to access entries - Assert.AreEqual(a, mapMessage.Body["a"], "generic map entry: a"); - Assert.AreEqual(b, mapMessage.Body["b"], "generic map entry: b"); - Assert.AreEqual(c, mapMessage.Body["c"], "generic map entry: c"); - Assert.AreEqual(d, mapMessage.Body["d"], "generic map entry: d"); - 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"); - - // use type safe APIs - Assert.AreEqual(a, mapMessage.Body.GetBool("a"), "map entry: a"); - Assert.AreEqual(b, mapMessage.Body.GetByte("b"), "map entry: b"); - Assert.AreEqual(c, mapMessage.Body.GetChar("c"), "map entry: c"); - Assert.AreEqual(d, mapMessage.Body.GetShort("d"), "map entry: d"); - 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"); - - - } - - protected string ToHex(long value) - { - return String.Format("{0:x}", value); - } - } -} +/* + * 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 System; +using System.IO; + +using NUnit.Framework; + +namespace ActiveMQ +{ + [ TestFixture ] + public class MapMessageTest : TestSupport + { + bool a = true; + byte b = 123; + char c = 'c'; + short d = 0x1234; + int e = 0x12345678; + long f = 0x1234567812345678; + string g = "Hello World!"; + + [ Test ] + public override void SendAndSyncReceive() + { + base.SendAndSyncReceive(); + } + + protected override IMessage CreateMessage(ISession session) + { + IMapMessage message = session.CreateMapMessage(); + + message.Body["a"] = a; + message.Body["b"] = b; + message.Body["c"] = c; + message.Body["d"] = d; + message.Body["e"] = e; + message.Body["f"] = f; + message.Body["g"] = g; + + return message; + } + + protected override void AssertValidMessage(IMessage message) + { + Assert.IsTrue(message is IMapMessage, "Did not receive a MapMessage!"); + IMapMessage mapMessage = (IMapMessage) message; + + Console.WriteLine("Received MapMessage: " + message); + Console.WriteLine("Received Count: " + mapMessage.Body.Count); + + Assert.AreEqual(ToHex(f), ToHex(mapMessage.Body.GetLong("f")), "map entry: f as hex"); + + // use generic API to access entries + Assert.AreEqual(a, mapMessage.Body["a"], "generic map entry: a"); + Assert.AreEqual(b, mapMessage.Body["b"], "generic map entry: b"); + Assert.AreEqual(c, mapMessage.Body["c"], "generic map entry: c"); + Assert.AreEqual(d, mapMessage.Body["d"], "generic map entry: d"); + 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"); + + // use type safe APIs + Assert.AreEqual(a, mapMessage.Body.GetBool("a"), "map entry: a"); + Assert.AreEqual(b, mapMessage.Body.GetByte("b"), "map entry: b"); + Assert.AreEqual(c, mapMessage.Body.GetChar("c"), "map entry: c"); + Assert.AreEqual(d, mapMessage.Body.GetShort("d"), "map entry: d"); + 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"); + + + } + + protected string ToHex(long value) + { + return String.Format("{0:x}", value); + } + } +} Modified: incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/OpenWire/BooleanStreamTest.cs URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/OpenWire/BooleanStreamTest.cs?rev=383072&r1=383071&r2=383072&view=diff ============================================================================== --- incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/OpenWire/BooleanStreamTest.cs (original) +++ incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/OpenWire/BooleanStreamTest.cs Sat Mar 4 00:19:09 2006 @@ -19,10 +19,7 @@ using NUnit.Framework; -using OpenWire.Client; -using OpenWire.Client.Core; - -namespace OpenWire.Client.Core +namespace ActiveMQ.OpenWire { [TestFixture] public class BooleanStreamTest : TestSupport Modified: incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/TestMain.cs URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/TestMain.cs?rev=383072&r1=383071&r2=383072&view=diff ============================================================================== --- incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/TestMain.cs (original) +++ incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/TestMain.cs Sat Mar 4 00:19:09 2006 @@ -1,80 +1,79 @@ -/* - * 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 System; -using System.IO; - -using OpenWire.Client; -using OpenWire.Client.Core; -using OpenWire.Client.Commands; - -namespace openwire_dotnet -{ - public class TestMain - { - public static void Main(string[] args) - { - try - { - Console.WriteLine("About to connect to ActiveMQ"); - - // START SNIPPET: demo - IConnectionFactory factory = new ConnectionFactory("localhost", 61616); - using (IConnection connection = factory.CreateConnection()) - { - Console.WriteLine("Created a connection!"); - - ISession session = connection.CreateSession(); - - IDestination destination = session.GetQueue("FOO.BAR"); - Console.WriteLine("Using destination: " + destination); - - // lets create a consumer and producer - IMessageConsumer consumer = session.CreateConsumer(destination); - - IMessageProducer producer = session.CreateProducer(destination); - producer.Persistent = true; - - // lets send a message - ITextMessage request = session.CreateTextMessage("Hello World!"); - request.JMSCorrelationID = "abc"; - request.JMSXGroupID = "cheese"; - request.Properties["myHeader"] = "James"; - - producer.Send(request); - - // lets consume a message - ActiveMQTextMessage message = (ActiveMQTextMessage) consumer.Receive(); - if (message == null) - { - Console.WriteLine("No message received!"); - } - else - { - Console.WriteLine("Received message with ID: " + message.JMSMessageId); - Console.WriteLine("Received message with text: " + message.Text); - } - } - // END SNIPPET: demo - } - catch (Exception e) - { - Console.WriteLine("Caught: " + e); - Console.WriteLine("Stack: " + e.StackTrace); - } - } - } -} +/* + * 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 System; +using System.IO; + +using ActiveMQ.OpenWire; +using ActiveMQ.OpenWire.Commands; + +namespace ActiveMQ +{ + public class TestMain + { + public static void Main(string[] args) + { + try + { + Console.WriteLine("About to connect to ActiveMQ"); + + // START SNIPPET: demo + IConnectionFactory factory = new ConnectionFactory("localhost", 61616); + using (IConnection connection = factory.CreateConnection()) + { + Console.WriteLine("Created a connection!"); + + ISession session = connection.CreateSession(); + + IDestination destination = session.GetQueue("FOO.BAR"); + Console.WriteLine("Using destination: " + destination); + + // lets create a consumer and producer + IMessageConsumer consumer = session.CreateConsumer(destination); + + IMessageProducer producer = session.CreateProducer(destination); + producer.Persistent = true; + + // lets send a message + ITextMessage request = session.CreateTextMessage("Hello World!"); + request.JMSCorrelationID = "abc"; + request.JMSXGroupID = "cheese"; + request.Properties["myHeader"] = "James"; + + producer.Send(request); + + // lets consume a message + ActiveMQTextMessage message = (ActiveMQTextMessage) consumer.Receive(); + if (message == null) + { + Console.WriteLine("No message received!"); + } + else + { + Console.WriteLine("Received message with ID: " + message.JMSMessageId); + Console.WriteLine("Received message with text: " + message.Text); + } + } + // END SNIPPET: demo + } + catch (Exception e) + { + Console.WriteLine("Caught: " + e); + Console.WriteLine("Stack: " + e.StackTrace); + } + } + } +} Modified: incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/TestSupport.cs URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/TestSupport.cs?rev=383072&r1=383071&r2=383072&view=diff ============================================================================== --- incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/TestSupport.cs (original) +++ incubator/activemq/trunk/openwire-dotnet/tests/ActiveMQ/TestSupport.cs Sat Mar 4 00:19:09 2006 @@ -19,11 +19,7 @@ using NUnit.Framework; -using OpenWire.Client; -using OpenWire.Client.Core; - - -namespace OpenWire.Client +namespace ActiveMQ { ///