Return-Path: Delivered-To: apmail-geronimo-activemq-commits-archive@www.apache.org Received: (qmail 48932 invoked from network); 24 Feb 2006 08:42:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 24 Feb 2006 08:42:58 -0000 Received: (qmail 39019 invoked by uid 500); 24 Feb 2006 08:42:58 -0000 Delivered-To: apmail-geronimo-activemq-commits-archive@geronimo.apache.org Received: (qmail 38982 invoked by uid 500); 24 Feb 2006 08:42:57 -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 38946 invoked by uid 99); 24 Feb 2006 08:42:57 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Feb 2006 00:42:57 -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; Fri, 24 Feb 2006 00:42:55 -0800 Received: (qmail 48797 invoked by uid 65534); 24 Feb 2006 08:42:34 -0000 Message-ID: <20060224084234.48782.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r380620 - in /incubator/activemq/trunk/openwire-dotnet: ./ src/OpenWire.Client/ src/OpenWire.Client/Commands/ src/OpenWire.Client/Core/ tests/OpenWire.Client/ Date: Fri, 24 Feb 2006 08:41:53 -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: Fri Feb 24 00:41:42 2006 New Revision: 380620 URL: http://svn.apache.org/viewcvs?rev=380620&view=rev Log: Added visual studio project files and started porting over test cases from the java side, flesh out the durable sub stuff a little more Added: incubator/activemq/trunk/openwire-dotnet/activemq.csproj (with props) incubator/activemq/trunk/openwire-dotnet/activemq.sln (with props) incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/IStopable.cs (with props) incubator/activemq/trunk/openwire-dotnet/tests.csproj (with props) incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/ConsumerTest.cs (with props) Modified: incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/Message.cs incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Connection.cs incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Core/SocketTransport.cs incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/IConnection.cs incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/IMessage.cs incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/IMessageConsumer.cs incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/IMessageProducer.cs incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/ISession.cs incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/MessageProducer.cs incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Session.cs incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/EndianTest.cs Added: incubator/activemq/trunk/openwire-dotnet/activemq.csproj URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/activemq.csproj?rev=380620&view=auto ============================================================================== --- incubator/activemq/trunk/openwire-dotnet/activemq.csproj (added) +++ incubator/activemq/trunk/openwire-dotnet/activemq.csproj Fri Feb 24 00:41:42 2006 @@ -0,0 +1,800 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Propchange: incubator/activemq/trunk/openwire-dotnet/activemq.csproj ------------------------------------------------------------------------------ svn:executable = * Added: incubator/activemq/trunk/openwire-dotnet/activemq.sln URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/activemq.sln?rev=380620&view=auto ============================================================================== --- incubator/activemq/trunk/openwire-dotnet/activemq.sln (added) +++ incubator/activemq/trunk/openwire-dotnet/activemq.sln Fri Feb 24 00:41:42 2006 @@ -0,0 +1,30 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "activemq", "activemq.csproj", "{E8825D2E-4EC5-43D3-9FAC-F16055294F49}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tests", "tests.csproj", "{3E5FA6F9-08E6-4F0D-86D9-77562D14F8AD}" + ProjectSection(ProjectDependencies) = postProject + {E8825D2E-4EC5-43D3-9FAC-F16055294F49} = {E8825D2E-4EC5-43D3-9FAC-F16055294F49} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Release = Release + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {E8825D2E-4EC5-43D3-9FAC-F16055294F49}.Debug.ActiveCfg = Debug|.NET + {E8825D2E-4EC5-43D3-9FAC-F16055294F49}.Debug.Build.0 = Debug|.NET + {E8825D2E-4EC5-43D3-9FAC-F16055294F49}.Release.ActiveCfg = Release|.NET + {E8825D2E-4EC5-43D3-9FAC-F16055294F49}.Release.Build.0 = Release|.NET + {3E5FA6F9-08E6-4F0D-86D9-77562D14F8AD}.Debug.ActiveCfg = Debug|.NET + {3E5FA6F9-08E6-4F0D-86D9-77562D14F8AD}.Debug.Build.0 = Debug|.NET + {3E5FA6F9-08E6-4F0D-86D9-77562D14F8AD}.Release.ActiveCfg = Release|.NET + {3E5FA6F9-08E6-4F0D-86D9-77562D14F8AD}.Release.Build.0 = Release|.NET + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal Propchange: incubator/activemq/trunk/openwire-dotnet/activemq.sln ------------------------------------------------------------------------------ svn:executable = * Modified: incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/Message.cs URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/Message.cs?rev=380620&r1=380619&r2=380620&view=diff ============================================================================== --- incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/Message.cs (original) +++ incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Commands/Message.cs Fri Feb 24 00:41:42 2006 @@ -1,19 +1,19 @@ /* -* 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. -*/ + * 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.Collections; Modified: incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Connection.cs URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Connection.cs?rev=380620&r1=380619&r2=380620&view=diff ============================================================================== --- incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Connection.cs (original) +++ incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Connection.cs Fri Feb 24 00:41:42 2006 @@ -33,7 +33,20 @@ this.transport.Command += new CommandHandler(OnCommand); this.transport.Start(); } + + /// + /// Starts message delivery for this connection. + /// + public void Start() + { + } + /// + /// Stop message delivery for this connection. + /// + public void Stop() + { + } /// /// Creates a new session to work on this connection Modified: incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Core/SocketTransport.cs URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Core/SocketTransport.cs?rev=380620&r1=380619&r2=380620&view=diff ============================================================================== --- incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Core/SocketTransport.cs (original) +++ incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Core/SocketTransport.cs Fri Feb 24 00:41:42 2006 @@ -109,17 +109,17 @@ { command = (Command) wireformat.Unmarshal(socketReader); } - catch (EndOfStreamException e) + catch (EndOfStreamException) { // stream closed break; } - catch (ObjectDisposedException e) + catch (ObjectDisposedException) { // stream closed break; } - catch (IOException e) + catch (IOException) { // error, assume closing break; Modified: incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/IConnection.cs URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/IConnection.cs?rev=380620&r1=380619&r2=380620&view=diff ============================================================================== --- incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/IConnection.cs (original) +++ incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/IConnection.cs Fri Feb 24 00:41:42 2006 @@ -11,7 +11,7 @@ /// /// Represents a connection with a message broker /// - public interface IConnection : IDisposable { + public interface IConnection : IDisposable, IStartable, IStopable { /// /// Creates a new session to work on this connection @@ -34,6 +34,14 @@ AcknowledgementMode AcknowledgementMode { get; set; - } - } + } + + String ClientId + { + get; + set; + } + + + } } Modified: incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/IMessage.cs URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/IMessage.cs?rev=380620&r1=380619&r2=380620&view=diff ============================================================================== --- incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/IMessage.cs (original) +++ incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/IMessage.cs Fri Feb 24 00:41:42 2006 @@ -2,13 +2,15 @@ using OpenWire.Client.Commands; namespace OpenWire.Client { - /// - /// Represents a message either to be sent to a message broker or received from a message broker - /// - public interface IMessage { + /// + /// Represents a message either to be sent to a message broker or received from a message broker + /// + public interface IMessage { - IDestination FromDestination { - get; - } - } + IDestination FromDestination { + get; + } + + + } } Modified: incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/IMessageConsumer.cs URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/IMessageConsumer.cs?rev=380620&r1=380619&r2=380620&view=diff ============================================================================== --- incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/IMessageConsumer.cs (original) +++ incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/IMessageConsumer.cs Fri Feb 24 00:41:42 2006 @@ -11,10 +11,15 @@ public interface IMessageConsumer : IDisposable { - /// - /// Waits until a message is available and returns it + /// + /// Waits until a message is available and returns it + /// + IMessage Receive(); + + /// + /// If a message is available within the timeout duration it is returned otherwise this method returns null /// - IMessage Receive(); + IMessage Receive(long timeout); /// /// If a message is available immediately it is returned otherwise this method returns null Modified: incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/IMessageProducer.cs URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/IMessageProducer.cs?rev=380620&r1=380619&r2=380620&view=diff ============================================================================== --- incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/IMessageProducer.cs (original) +++ incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/IMessageProducer.cs Fri Feb 24 00:41:42 2006 @@ -2,19 +2,50 @@ using OpenWire.Client.Commands; namespace OpenWire.Client { + /// + /// An object capable of sending messages to some destination + /// + public interface IMessageProducer : IDisposable { + + /// + /// Sends the message to the default destination for this producer + /// + void Send(IMessage message); + /// - /// An object capable of sending messages to some destination + /// Sends the message to the given destination /// - public interface IMessageProducer : IDisposable { + void Send(IDestination destination, IMessage message); + + bool Persistent + { + get; + set; + } + + long TimeToLive + { + get; + set; + } + + int Priority + { + get; + set; + } + + bool DisableMessageID + { + get; + set; + } + + bool DisableMessageTimestamp + { + get; + set; + } - /// - /// Sends the message to the default destination for this producer - /// - void Send(IMessage message); - - /// - /// Sends the message to the given destination - /// - void Send(IDestination destination, IMessage message); - } + } } Modified: incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/ISession.cs URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/ISession.cs?rev=380620&r1=380619&r2=380620&view=diff ============================================================================== --- incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/ISession.cs (original) +++ incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/ISession.cs Fri Feb 24 00:41:42 2006 @@ -2,57 +2,60 @@ using OpenWire.Client.Commands; namespace OpenWire.Client { + /// + /// Represents a single unit of work on an IConnection. + /// So the ISession can be used to perform transactional receive and sends + /// + public interface ISession : IDisposable { + /// - /// Represents a single unit of work on an IConnection. - /// So the ISession can be used to perform transactional receive and sends + /// Creates a producer of messages /// - public interface ISession : IDisposable { + IMessageProducer CreateProducer(); + /// + /// Creates a producer of messages on a given destination + /// + IMessageProducer CreateProducer(IDestination destination); - /// - /// Creates a producer of messages - /// - IMessageProducer CreateProducer(); - - /// - /// Creates a producer of messages on a given destination - /// - IMessageProducer CreateProducer(IDestination destination); - - /// - /// Creates a cpmsi,er of messages on a given destination - /// - IMessageConsumer CreateConsumer(IDestination destination); - - /// - /// Creates a cpmsi,er of messages on a given destination with a selector - /// - IMessageConsumer CreateConsumer(IDestination destination, string selector); - - /// - /// Returns the queue for the given name - /// - IQueue GetQueue(string name); - - /// - /// Returns the topic for the given name - /// - ITopic GetTopic(string name); - - - /// - /// Creates a new message with an empty body - /// - IMessage CreateMessage(); - - /// - /// Creates a new text message with an empty body - /// - ITextMessage CreateTextMessage(); + /// + /// Creates a consumer of messages on a given destination + /// + IMessageConsumer CreateConsumer(IDestination destination); + + /// + /// Creates a consumer of messages on a given destination with a selector + /// + IMessageConsumer CreateConsumer(IDestination destination, string selector); + + /// + /// Creates a named durable consumer of messages on a given destination with a selector + /// + IMessageConsumer CreateDurableConsumer(ITopic destination, string name, string selector, bool noLocal); + + /// + /// Returns the queue for the given name + /// + IQueue GetQueue(string name); - /// - /// Creates a new text message with the given body - /// - ITextMessage CreateTextMessage(string text); - } + /// + /// Returns the topic for the given name + /// + ITopic GetTopic(string name); + + /// + /// Creates a new message with an empty body + /// + IMessage CreateMessage(); + + /// + /// Creates a new text message with an empty body + /// + ITextMessage CreateTextMessage(); + + /// + /// Creates a new text message with the given body + /// + ITextMessage CreateTextMessage(string text); + } } Added: incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/IStopable.cs URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/IStopable.cs?rev=380620&view=auto ============================================================================== --- incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/IStopable.cs (added) +++ incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/IStopable.cs Fri Feb 24 00:41:42 2006 @@ -0,0 +1,7 @@ +namespace OpenWire.Client +{ + public interface IStopable + { + void Stop(); + } +} Propchange: incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/IStopable.cs ------------------------------------------------------------------------------ svn:executable = * Modified: incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/MessageProducer.cs URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/MessageProducer.cs?rev=380620&r1=380619&r2=380620&view=diff ============================================================================== --- incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/MessageProducer.cs (original) +++ incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/MessageProducer.cs Fri Feb 24 00:41:42 2006 @@ -12,8 +12,13 @@ private Session session; private ProducerInfo info; private long messageCounter; - - + + bool persistent; + long timeToLive; + int priority; + bool disableMessageID; + bool disableMessageTimestamp; + public MessageProducer(Session session, ProducerInfo info) { this.session = session; @@ -45,5 +50,36 @@ { session.DisposeOf(info.ProducerId); } + + public bool Persistent + { + get { return persistent; } + set { this.persistent = value; } + } + + public long TimeToLive + { + get { return timeToLive; } + set { this.timeToLive = value; } + } + + public int Priority + { + get { return priority; } + set { this.priority = value; } + } + + public bool DisableMessageID + { + get { return disableMessageID; } + set { this.disableMessageID = value; } + } + + public bool DisableMessageTimestamp + { + get { return disableMessageTimestamp; } + set { this.disableMessageTimestamp = value; } + } + } } Modified: incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Session.cs URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Session.cs?rev=380620&r1=380619&r2=380620&view=diff ============================================================================== --- incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Session.cs (original) +++ incubator/activemq/trunk/openwire-dotnet/src/OpenWire.Client/Session.cs Fri Feb 24 00:41:42 2006 @@ -10,7 +10,7 @@ public class Session : ISession { private Connection connection; - private AcknowledgementMode acknowledgementMode; + private AcknowledgementMode acknowledgementMode = AcknowledgementMode.AutoAcknowledge; private SessionInfo info; private long consumerCounter; private long producerCounter; @@ -75,6 +75,29 @@ } } + public IMessageConsumer CreateDurableConsumer(ITopic destination, string name, string selector, bool noLocal) + { + ConsumerInfo command = CreateConsumerInfo(destination, selector); + ConsumerId consumerId = command.ConsumerId; + command.SubcriptionName = name; + command.NoLocal = noLocal; + + try + { + MessageConsumer consumer = new MessageConsumer(this, command); + // lets register the consumer first in case we start dispatching messages immediately + connection.AddConsumer(consumerId, consumer); + + connection.SyncRequest(command); + return consumer; + } + catch (Exception e) + { + connection.RemoveConsumer(consumerId); + throw e; + } + } + public IQueue GetQueue(string name) { return new ActiveMQQueue(name); Added: incubator/activemq/trunk/openwire-dotnet/tests.csproj URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/tests.csproj?rev=380620&view=auto ============================================================================== --- incubator/activemq/trunk/openwire-dotnet/tests.csproj (added) +++ incubator/activemq/trunk/openwire-dotnet/tests.csproj Fri Feb 24 00:41:42 2006 @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Propchange: incubator/activemq/trunk/openwire-dotnet/tests.csproj ------------------------------------------------------------------------------ svn:executable = * Added: incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/ConsumerTest.cs URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/ConsumerTest.cs?rev=380620&view=auto ============================================================================== --- incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/ConsumerTest.cs (added) +++ incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/ConsumerTest.cs Fri Feb 24 00:41:42 2006 @@ -0,0 +1,76 @@ +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(false, 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()); + } + + } +} + Propchange: incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/ConsumerTest.cs ------------------------------------------------------------------------------ svn:executable = * Modified: incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/EndianTest.cs URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/EndianTest.cs?rev=380620&r1=380619&r2=380620&view=diff ============================================================================== --- incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/EndianTest.cs (original) +++ incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/EndianTest.cs Fri Feb 24 00:41:42 2006 @@ -11,7 +11,7 @@ [Test] public void TestLongEndian() { - long value = 0x0102030405060708l; + long value = 0x0102030405060708L; long newValue = DataStreamMarshaller.SwitchEndian(value);