You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by jg...@apache.org on 2009/05/23 00:02:37 UTC
svn commit: r777725 [2/2] - in /activemq/activemq-dotnet:
Apache.NMS.ActiveMQ/trunk/src/main/csharp/
Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/
Apache.NMS.EMS/trunk/src/main/csharp/
Apache.NMS.MSMQ/trunk/src/main/csharp/ Apache.NMS.MSMQ/trunk/...
Modified: activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/test/csharp/MSMQTest.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/test/csharp/MSMQTest.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/test/csharp/MSMQTest.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/test/csharp/MSMQTest.cs Fri May 22 22:02:35 2009
@@ -14,112 +14,106 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-using NUnit.Framework;
+
using System;
using System.Messaging;
+using NUnit.Framework;
namespace Apache.NMS.MSMQ
-{
- /// <summary>
- /// Use to test and verify MSMQ behaviour.
- /// </summary>
+{
+ /// <summary>
+ /// Use to test and verify MSMQ behaviour.
+ /// </summary>
[TestFixture]
- public class MSMQTest
- {
- String queueName = ".\\Private$\\FOO";
-
+ public class MSMQTest
+ {
+ String queueName = ".\\Private$\\FOO";
+
[SetUp]
- public void SetUp()
- {
- }
-
- [TearDown]
- public void TearDown()
- {
- }
-
- [Test]
- public void TestSendAndReceive()
- {
- // check to make sure the message queue does not exist already
- if (!MessageQueue.Exists(queueName))
- {
- // create the new message queue and make it transactional
- MessageQueue MQ = MessageQueue.Create(queueName, true);
-
- // set the label name and close the message queue
- MQ.Label = "FOO";
- MQ.Close();
-
- Console.WriteLine("Created Queue: " + queueName);
- //Assert.Fail("Should have thrown an exception!");
- }
- else
- {
- Console.WriteLine("Queue Existed: " + queueName);
-
- }
-
-
- if (!MessageQueue.Exists(".\\Private$\\BAR"))
- {
- // create the new message queue and make it transactional
- MessageQueue MQ = MessageQueue.Create(".\\Private$\\BAR", true);
-
- // set the label name and close the message queue
- MQ.Label = "BAR Label";
- MQ.Close();
-
- }
- else
- {
- Console.WriteLine("Queue Existed: " + queueName);
-
- }
-
- // create a message queue transaction and start it
- MessageQueueTransaction Transaction = new MessageQueueTransaction();
- Transaction.Begin();
-
- MessageQueue MQueue = new MessageQueue(queueName);
-
- Message Msg = new Message("Hello World");
- Msg.ResponseQueue = new MessageQueue(".\\Private$\\BAR");
- Msg.Priority = MessagePriority.Normal;
- Msg.UseJournalQueue = true;
- Msg.Label = "Test Label";
-
- Msg.AcknowledgeType = AcknowledgeTypes.FullReceive;
- Msg.AdministrationQueue = Msg.ResponseQueue;
-
- // send the message
- MQueue.Send(Msg, Transaction);
- MQueue.Send(Msg, Transaction);
- MQueue.Send(Msg, Transaction);
-
- // commit the transaction
- Transaction.Commit();
-
-
- // Read the message.
- MQueue.MessageReadPropertyFilter.SetAll();
-
- // the target type we have stored in the message body
-
- ((XmlMessageFormatter)MQueue.Formatter).TargetTypes = new Type[] { typeof(String) };
-
- // read the message from the queue, but only wait for 5 sec
- Msg = MQueue.Receive(new TimeSpan(0, 0, 5));
-
- // read the order from the message body
- Console.WriteLine("Received: "+Msg.Body);
-
+ public void SetUp()
+ {
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ }
+
+ [Test]
+ public void TestSendAndReceive()
+ {
+ // check to make sure the message queue does not exist already
+ if(!MessageQueue.Exists(queueName))
+ {
+ // create the new message queue and make it transactional
+ MessageQueue MQ = MessageQueue.Create(queueName, true);
+
+ // set the label name and close the message queue
+ MQ.Label = "FOO";
+ MQ.Close();
+
+ Console.WriteLine("Created Queue: " + queueName);
+ //Assert.Fail("Should have thrown an exception!");
+ }
+ else
+ {
+ Console.WriteLine("Queue Existed: " + queueName);
+ }
+
+ if(!MessageQueue.Exists(".\\Private$\\BAR"))
+ {
+ // create the new message queue and make it transactional
+ MessageQueue MQ = MessageQueue.Create(".\\Private$\\BAR", true);
+
+ // set the label name and close the message queue
+ MQ.Label = "BAR Label";
+ MQ.Close();
+ }
+ else
+ {
+ Console.WriteLine("Queue Existed: " + queueName);
+ }
+
+ // create a message queue transaction and start it
+ MessageQueueTransaction Transaction = new MessageQueueTransaction();
+ Transaction.Begin();
+
+ MessageQueue MQueue = new MessageQueue(queueName);
+
+ Message Msg = new Message("Hello World");
+ Msg.ResponseQueue = new MessageQueue(".\\Private$\\BAR");
+ Msg.Priority = MessagePriority.Normal;
+ Msg.UseJournalQueue = true;
+ Msg.Label = "Test Label";
+
+ Msg.AcknowledgeType = AcknowledgeTypes.FullReceive;
+ Msg.AdministrationQueue = Msg.ResponseQueue;
+
+ // send the message
+ MQueue.Send(Msg, Transaction);
+ MQueue.Send(Msg, Transaction);
+ MQueue.Send(Msg, Transaction);
+
+ // commit the transaction
+ Transaction.Commit();
+
+ // Read the message.
+ MQueue.MessageReadPropertyFilter.SetAll();
+
+ // the target type we have stored in the message body
+
+ ((XmlMessageFormatter) MQueue.Formatter).TargetTypes = new Type[] { typeof(String) };
+
+ // read the message from the queue, but only wait for 5 sec
+ Msg = MQueue.Receive(new TimeSpan(0, 0, 5));
+
+ // read the order from the message body
+ Console.WriteLine("Received: " + Msg.Body);
- // close the mesage queue
- MQueue.Close();
+ // close the mesage queue
+ MQueue.Close();
}
-
- }
+ }
}
Modified: activemq/activemq-dotnet/Apache.NMS.WCF/trunk/src/main/csharp/NmsOutputChannel.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.WCF/trunk/src/main/csharp/NmsOutputChannel.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.WCF/trunk/src/main/csharp/NmsOutputChannel.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.WCF/trunk/src/main/csharp/NmsOutputChannel.cs Fri May 22 22:02:35 2009
@@ -76,7 +76,7 @@
IDestination destination = SessionUtil.GetDestination(session, Destination, DestinationType);
using(IMessageProducer producer = session.CreateProducer(destination))
{
- producer.Persistent = true;
+ producer.DeliveryMode = MsgDeliveryMode.Persistent;
ITextMessage request = session.CreateTextMessage(TranslateMessage(message));
producer.Send(request);
Modified: activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/IMessage.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/IMessage.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/IMessage.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/IMessage.cs Fri May 22 22:02:35 2009
@@ -57,12 +57,12 @@
/// <summary>
/// Whether or not this message is persistent.
/// </summary>
- bool NMSPersistent { get; set; }
-
+ MsgDeliveryMode NMSDeliveryMode { get; set; }
+
/// <summary>
/// The Priority of this message.
/// </summary>
- byte NMSPriority { get; set; }
+ MsgPriority NMSPriority { get; set; }
/// <summary>
/// Returns true if this message has been redelivered to this or another consumer before being acknowledged successfully.
Modified: activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/IMessageProducer.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/IMessageProducer.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/IMessageProducer.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/IMessageProducer.cs Fri May 22 22:02:35 2009
@@ -31,7 +31,7 @@
/// <summary>
/// Sends the message to the default destination with the explicit QoS configuration
/// </summary>
- void Send(IMessage message, bool persistent, byte priority, TimeSpan timeToLive);
+ void Send(IMessage message, MsgDeliveryMode deliveryMode, MsgPriority priority, TimeSpan timeToLive);
/// <summary>
/// Sends the message to the given destination
@@ -41,20 +41,20 @@
/// <summary>
/// Sends the message to the given destination with the explicit QoS configuration
/// </summary>
- void Send(IDestination destination, IMessage message, bool persistent, byte priority, TimeSpan timeToLive);
+ void Send(IDestination destination, IMessage message, MsgDeliveryMode deliveryMode, MsgPriority priority, TimeSpan timeToLive);
/// <summary>
/// Close the producer.
/// </summary>
void Close();
- bool Persistent { get; set; }
+ MsgDeliveryMode DeliveryMode { get; set; }
TimeSpan TimeToLive { get; set; }
TimeSpan RequestTimeout { get; set; }
- byte Priority { get; set; }
+ MsgPriority Priority { get; set; }
bool DisableMessageID { get; set; }
Modified: activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/NMSConstants.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/NMSConstants.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/NMSConstants.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/NMSConstants.cs Fri May 22 22:02:35 2009
@@ -14,20 +14,49 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
using System;
-using System.Threading;
namespace Apache.NMS
{
/// <summary>
+ /// Define an enumerated array of message priorities.
+ /// </summary>
+ public enum MsgPriority
+ {
+ Lowest = 0,
+ VeryLow = 1,
+ Low = 2,
+ AboveLow = 3,
+ BelowNormal = 4,
+ Normal = 5,
+ AboveNormal = 6,
+ High = 7,
+ VeryHigh = 8,
+ Highest = 9
+ }
+
+ /// <summary>
+ /// Define an enumerated array of message delivery modes. Provider-specific
+ /// values can be used to extend this enumerated mode. TIBCO is known to
+ /// provide a third value of ReliableDelivery. At minimum, a provider must
+ /// support Persistent and NonPersistent.
+ /// </summary>
+ public enum MsgDeliveryMode
+ {
+ Persistent,
+ NonPersistent
+ }
+
+ /// <summary>
/// Defines a number of constants
/// </summary>
public class NMSConstants
{
- public const byte defaultPriority = 5;
- public const bool defaultPersistence = true;
+ public const MsgPriority defaultPriority = MsgPriority.Normal;
+ public const MsgDeliveryMode defaultDeliveryMode = MsgDeliveryMode.Persistent;
public static readonly TimeSpan defaultTimeToLive = TimeSpan.Zero;
- public static readonly TimeSpan defaultRequestTimeout = TimeSpan.FromMilliseconds(Timeout.Infinite);
+ public static readonly TimeSpan defaultRequestTimeout = TimeSpan.FromMilliseconds(System.Threading.Timeout.Infinite);
}
}
Modified: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/AsyncConsumeTest.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/AsyncConsumeTest.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/AsyncConsumeTest.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/AsyncConsumeTest.cs Fri May 22 22:02:35 2009
@@ -50,10 +50,10 @@
#if !NET_1_1
[RowTest]
- [Row(true)]
- [Row(false)]
+ [Row(MsgDeliveryMode.Persistent)]
+ [Row(MsgDeliveryMode.NonPersistent)]
#endif
- public void TestAsynchronousConsume(bool persistent)
+ public void TestAsynchronousConsume(MsgDeliveryMode deliveryMode)
{
using(IConnection connection = CreateConnection(TEST_CLIENT_ID))
{
@@ -64,7 +64,7 @@
using(IMessageConsumer consumer = session.CreateConsumer(destination))
using(IMessageProducer producer = session.CreateProducer(destination))
{
- producer.Persistent = persistent;
+ producer.DeliveryMode = deliveryMode;
producer.RequestTimeout = receiveTimeout;
consumer.Listener += new MessageListener(OnMessage);
@@ -82,10 +82,10 @@
#if !NET_1_1
[RowTest]
- [Row(true)]
- [Row(false)]
+ [Row(MsgDeliveryMode.Persistent)]
+ [Row(MsgDeliveryMode.NonPersistent)]
#endif
- public void TestCreateConsumerAfterSend(bool persistent)
+ public void TestCreateConsumerAfterSend(MsgDeliveryMode deliveryMode)
{
using(IConnection connection = CreateConnection(TEST_CLIENT_ID))
{
@@ -95,7 +95,7 @@
IDestination destination = SessionUtil.GetDestination(session, DESTINATION_NAME);
using(IMessageProducer producer = session.CreateProducer(destination))
{
- producer.Persistent = false;
+ producer.DeliveryMode = deliveryMode;
producer.RequestTimeout = receiveTimeout;
IMessage request = session.CreateMessage();
@@ -116,10 +116,10 @@
#if !NET_1_1
[RowTest]
- [Row(true)]
- [Row(false)]
+ [Row(MsgDeliveryMode.Persistent)]
+ [Row(MsgDeliveryMode.NonPersistent)]
#endif
- public void TestCreateConsumerBeforeSendAddListenerAfterSend(bool persistent)
+ public void TestCreateConsumerBeforeSendAddListenerAfterSend(MsgDeliveryMode deliveryMode)
{
using(IConnection connection = CreateConnection(TEST_CLIENT_ID))
{
@@ -130,7 +130,7 @@
using(IMessageConsumer consumer = session.CreateConsumer(destination))
using(IMessageProducer producer = session.CreateProducer(destination))
{
- producer.Persistent = persistent;
+ producer.DeliveryMode = deliveryMode;
producer.RequestTimeout = receiveTimeout;
IMessage request = session.CreateMessage();
@@ -149,10 +149,10 @@
#if !NET_1_1
[RowTest]
- [Row(true)]
- [Row(false)]
+ [Row(MsgDeliveryMode.Persistent)]
+ [Row(MsgDeliveryMode.NonPersistent)]
#endif
- public void TestAsynchronousTextMessageConsume(bool persistent)
+ public void TestAsynchronousTextMessageConsume(MsgDeliveryMode deliveryMode)
{
using(IConnection connection = CreateConnection(TEST_CLIENT_ID))
{
@@ -165,7 +165,7 @@
consumer.Listener += new MessageListener(OnMessage);
using(IMessageProducer producer = session.CreateProducer(destination))
{
- producer.Persistent = persistent;
+ producer.DeliveryMode = deliveryMode;
producer.RequestTimeout = receiveTimeout;
ITextMessage request = session.CreateTextMessage("Hello, World!");
@@ -188,10 +188,10 @@
#if !NET_1_1
[RowTest]
- [Row(true)]
- [Row(false)]
+ [Row(MsgDeliveryMode.Persistent)]
+ [Row(MsgDeliveryMode.NonPersistent)]
#endif
- public void TestTemporaryQueueAsynchronousConsume(bool persistent)
+ public void TestTemporaryQueueAsynchronousConsume(MsgDeliveryMode deliveryMode)
{
using(IConnection connection = CreateConnection(TEST_CLIENT_ID))
{
@@ -205,7 +205,7 @@
using(IMessageConsumer tempConsumer = session.CreateConsumer(tempReplyDestination))
using(IMessageProducer producer = session.CreateProducer(destination))
{
- producer.Persistent = persistent;
+ producer.DeliveryMode = deliveryMode;
producer.RequestTimeout = receiveTimeout;
tempConsumer.Listener += new MessageListener(OnMessage);
consumer.Listener += new MessageListener(OnQueueMessage);
@@ -233,7 +233,7 @@
{
using(IMessageProducer producer = session.CreateProducer(message.NMSReplyTo))
{
- producer.Persistent = message.NMSPersistent;
+ producer.DeliveryMode = message.NMSDeliveryMode;
producer.RequestTimeout = receiveTimeout;
ITextMessage response = session.CreateTextMessage("Asynchronous Response Message Text");
Modified: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/BytesMessageTest.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/BytesMessageTest.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/BytesMessageTest.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/BytesMessageTest.cs Fri May 22 22:02:35 2009
@@ -30,10 +30,10 @@
#if !NET_1_1
[RowTest]
- [Row(true)]
- [Row(false)]
+ [Row(MsgDeliveryMode.Persistent)]
+ [Row(MsgDeliveryMode.NonPersistent)]
#endif
- public void SendReceiveBytesMessage(bool persistent)
+ public void SendReceiveBytesMessage(MsgDeliveryMode deliveryMode)
{
using(IConnection connection = CreateConnection(TEST_CLIENT_ID))
{
@@ -44,14 +44,14 @@
using(IMessageConsumer consumer = session.CreateConsumer(destination))
using(IMessageProducer producer = session.CreateProducer(destination))
{
- producer.Persistent = persistent;
+ producer.DeliveryMode = deliveryMode;
producer.RequestTimeout = receiveTimeout;
IMessage request = session.CreateBytesMessage(msgContent);
producer.Send(request);
IMessage message = consumer.Receive(receiveTimeout);
AssertBytesMessageEqual(request, message);
- Assert.AreEqual(persistent, message.NMSPersistent, "NMSPersistent does not match");
+ Assert.AreEqual(deliveryMode, message.NMSDeliveryMode, "NMSDeliveryMode does not match");
}
}
}
Modified: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/ConsumerTest.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/ConsumerTest.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/ConsumerTest.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/ConsumerTest.cs Fri May 22 22:02:35 2009
@@ -32,10 +32,10 @@
#if !NET_1_1
[RowTest]
- [Row(true)]
- [Row(false)]
+ [Row(MsgDeliveryMode.Persistent)]
+ [Row(MsgDeliveryMode.NonPersistent)]
#endif
- public void TestDurableConsumerSelectorChange(bool persistent)
+ public void TestDurableConsumerSelectorChange(MsgDeliveryMode deliveryMode)
{
try
{
@@ -48,7 +48,7 @@
IMessageProducer producer = session.CreateProducer(topic);
IMessageConsumer consumer = session.CreateDurableConsumer(topic, CONSUMER_ID, "color='red'", false);
- producer.Persistent = persistent;
+ producer.DeliveryMode = deliveryMode;
// Send the messages
ITextMessage sendMessage = session.CreateTextMessage("1st");
@@ -58,7 +58,7 @@
ITextMessage receiveMsg = consumer.Receive(receiveTimeout) as ITextMessage;
Assert.IsNotNull(receiveMsg, "Failed to retrieve 1st durable message.");
Assert.AreEqual("1st", receiveMsg.Text);
- Assert.AreEqual(persistent, receiveMsg.NMSPersistent, "NMSPersistent does not match");
+ Assert.AreEqual(deliveryMode, receiveMsg.NMSDeliveryMode, "NMSDeliveryMode does not match");
// Change the subscription.
consumer.Dispose();
@@ -75,7 +75,7 @@
receiveMsg = consumer.Receive(receiveTimeout) as ITextMessage;
Assert.IsNotNull(receiveMsg, "Failed to retrieve durable message.");
Assert.AreEqual("3rd", receiveMsg.Text, "Retrieved the wrong durable message.");
- Assert.AreEqual(persistent, receiveMsg.NMSPersistent, "NMSPersistent does not match");
+ Assert.AreEqual(deliveryMode, receiveMsg.NMSDeliveryMode, "NMSDeliveryMode does not match");
// Make sure there are no pending messages.
Assert.IsNull(consumer.ReceiveNoWait(), "Wrong number of messages in durable subscription.");
Modified: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/DurableTest.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/DurableTest.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/DurableTest.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/DurableTest.cs Fri May 22 22:02:35 2009
@@ -41,7 +41,7 @@
{
ITextMessage message = session.CreateTextMessage("Persistent Hello");
- producer.Persistent = true;
+ producer.DeliveryMode = MsgDeliveryMode.Persistent;
producer.RequestTimeout = receiveTimeout;
producer.Send(message);
}
Modified: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/MapMessageTest.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/MapMessageTest.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/MapMessageTest.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/MapMessageTest.cs Fri May 22 22:02:35 2009
@@ -46,10 +46,10 @@
#if !NET_1_1
[RowTest]
- [Row(true)]
- [Row(false)]
+ [Row(MsgDeliveryMode.Persistent)]
+ [Row(MsgDeliveryMode.NonPersistent)]
#endif
- public void SendReceiveMapMessage(bool persistent)
+ public void SendReceiveMapMessage(MsgDeliveryMode deliveryMode)
{
using(IConnection connection = CreateConnection(TEST_CLIENT_ID))
{
@@ -60,7 +60,7 @@
using(IMessageConsumer consumer = session.CreateConsumer(destination))
using(IMessageProducer producer = session.CreateProducer(destination))
{
- producer.Persistent = persistent;
+ producer.DeliveryMode = deliveryMode;
producer.RequestTimeout = receiveTimeout;
IMapMessage request = session.CreateMapMessage();
request.Body["a"] = a;
@@ -82,7 +82,7 @@
IMapMessage message = consumer.Receive(receiveTimeout) as IMapMessage;
Assert.IsNotNull(message, "No message returned!");
Assert.AreEqual(request.Body.Count, message.Body.Count, "Invalid number of message maps.");
- Assert.AreEqual(persistent, message.NMSPersistent, "NMSPersistent does not match");
+ Assert.AreEqual(deliveryMode, message.NMSDeliveryMode, "NMSDeliveryMode does not match");
Assert.AreEqual(ToHex(f), ToHex(message.Body.GetLong("f")), "map entry: f as hex");
// use generic API to access entries
@@ -123,10 +123,10 @@
#if !NET_1_1
[RowTest]
- [Row(true)]
- [Row(false)]
+ [Row(MsgDeliveryMode.Persistent)]
+ [Row(MsgDeliveryMode.NonPersistent)]
#endif
- public void SendReceiveNestedMapMessage(bool persistent)
+ public void SendReceiveNestedMapMessage(MsgDeliveryMode deliveryMode)
{
using(IConnection connection = CreateConnection(TEST_CLIENT_ID))
{
@@ -137,7 +137,7 @@
using(IMessageConsumer consumer = session.CreateConsumer(destination))
using(IMessageProducer producer = session.CreateProducer(destination))
{
- producer.Persistent = persistent;
+ producer.DeliveryMode = deliveryMode;
producer.RequestTimeout = receiveTimeout;
IMapMessage request = session.CreateMapMessage();
const string textFieldValue = "Nested Map Messages Rule!";
@@ -162,7 +162,7 @@
IMapMessage message = consumer.Receive(receiveTimeout) as IMapMessage;
Assert.IsNotNull(message, "No message returned!");
Assert.AreEqual(request.Body.Count, message.Body.Count, "Invalid number of message maps.");
- Assert.AreEqual(persistent, message.NMSPersistent, "NMSPersistent does not match");
+ Assert.AreEqual(deliveryMode, message.NMSDeliveryMode, "NMSDeliveryMode does not match");
string textFieldResponse = message.Body.GetString("textField");
Assert.AreEqual(textFieldValue, textFieldResponse, "textField does not match.");
Modified: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/MessageSelectorTest.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/MessageSelectorTest.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/MessageSelectorTest.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/MessageSelectorTest.cs Fri May 22 22:02:35 2009
@@ -38,12 +38,12 @@
#if !NET_1_1
[RowTest]
- [Row(true, QUEUE_DESTINATION_NAME)]
- [Row(false, QUEUE_DESTINATION_NAME)]
- [Row(true, TOPIC_DESTINATION_NAME)]
- [Row(false, TOPIC_DESTINATION_NAME)]
+ [Row(MsgDeliveryMode.Persistent, QUEUE_DESTINATION_NAME)]
+ [Row(MsgDeliveryMode.NonPersistent, QUEUE_DESTINATION_NAME)]
+ [Row(MsgDeliveryMode.Persistent, TOPIC_DESTINATION_NAME)]
+ [Row(MsgDeliveryMode.NonPersistent, TOPIC_DESTINATION_NAME)]
#endif
- public void FilterIgnoredMessagesTest(bool persistent, string destinationName)
+ public void FilterIgnoredMessagesTest(MsgDeliveryMode deliveryMode, string destinationName)
{
using(IConnection connection1 = CreateConnection(TEST_CLIENT_ID))
using(IConnection connection2 = CreateConnection(TEST_CLIENT_ID2))
@@ -66,7 +66,7 @@
int numNonIgnoredMsgsSent = 0;
int numIgnoredMsgsSent = 0;
- producer.Persistent = persistent;
+ producer.DeliveryMode = deliveryMode;
// producer.RequestTimeout = receiveTimeout;
receivedNonIgnoredMsgCount = 0;
Modified: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/MessageTest.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/MessageTest.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/MessageTest.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/MessageTest.cs Fri May 22 22:02:35 2009
@@ -45,10 +45,10 @@
#if !NET_1_1
[RowTest]
- [Row(true)]
- [Row(false)]
+ [Row(MsgDeliveryMode.Persistent)]
+ [Row(MsgDeliveryMode.NonPersistent)]
#endif
- public void SendReceiveMessageProperties(bool persistent)
+ public void SendReceiveMessageProperties(MsgDeliveryMode deliveryMode)
{
using(IConnection connection = CreateConnection(TEST_CLIENT_ID))
{
@@ -59,7 +59,7 @@
using(IMessageConsumer consumer = session.CreateConsumer(destination))
using(IMessageProducer producer = session.CreateProducer(destination))
{
- producer.Persistent = persistent;
+ producer.DeliveryMode = deliveryMode;
producer.RequestTimeout = receiveTimeout;
IMessage request = session.CreateMessage();
request.Properties["a"] = a;
@@ -81,7 +81,7 @@
IMessage message = consumer.Receive(receiveTimeout);
Assert.IsNotNull(message, "No message returned!");
Assert.AreEqual(request.Properties.Count, message.Properties.Count, "Invalid number of properties.");
- Assert.AreEqual(persistent, message.NMSPersistent, "NMSPersistent does not match");
+ Assert.AreEqual(deliveryMode, message.NMSDeliveryMode, "NMSDeliveryMode does not match");
Assert.AreEqual(ToHex(f), ToHex(message.Properties.GetLong("f")), "map entry: f as hex");
// use generic API to access entries
Modified: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/NMSPropertyTest.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/NMSPropertyTest.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/NMSPropertyTest.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/NMSPropertyTest.cs Fri May 22 22:02:35 2009
@@ -31,17 +31,17 @@
// standard NMS properties
protected string expectedText = "Hey this works!";
protected string correlationID = "FooBar";
- protected byte priority = 4;
+ protected MsgPriority priority = MsgPriority.Normal;
protected String type = "FooType";
protected String groupID = "BarGroup";
protected int groupSeq = 1;
#if !NET_1_1
[RowTest]
- [Row(true)]
- [Row(false)]
+ [Row(MsgDeliveryMode.Persistent)]
+ [Row(MsgDeliveryMode.NonPersistent)]
#endif
- public void SendReceiveNMSProperties(bool persistent)
+ public void SendReceiveNMSProperties(MsgDeliveryMode deliveryMode)
{
using(IConnection connection = CreateConnection(TEST_CLIENT_ID))
{
@@ -53,7 +53,7 @@
using(IMessageProducer producer = session.CreateProducer(destination))
{
producer.Priority = priority;
- producer.Persistent = persistent;
+ producer.DeliveryMode = deliveryMode;
producer.RequestTimeout = receiveTimeout;
ITextMessage request = session.CreateTextMessage(expectedText);
ITemporaryQueue replyTo = session.CreateTemporaryQueue();
@@ -74,7 +74,7 @@
// compare standard NMS headers
Assert.AreEqual(correlationID, message.NMSCorrelationID, "NMSCorrelationID does not match");
- Assert.AreEqual(persistent, message.NMSPersistent, "NMSPersistent does not match");
+ Assert.AreEqual(deliveryMode, message.NMSDeliveryMode, "NMSDeliveryMode does not match");
Assert.AreEqual(priority, message.NMSPriority, "NMSPriority does not match");
Assert.AreEqual(type, message.NMSType, "NMSType does not match");
Assert.AreEqual(groupID, message.Properties["NMSXGroupID"], "NMSXGroupID does not match");
Modified: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/TempDestinationDeletionTest.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/TempDestinationDeletionTest.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/TempDestinationDeletionTest.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/TempDestinationDeletionTest.cs Fri May 22 22:02:35 2009
@@ -34,17 +34,17 @@
#if !NET_1_1
[RowTest]
- [Row(true, QUEUE_DESTINATION_NAME)]
- [Row(false, QUEUE_DESTINATION_NAME)]
- [Row(true, TOPIC_DESTINATION_NAME)]
- [Row(false, TOPIC_DESTINATION_NAME)]
-
- [Row(true, TEMP_QUEUE_DESTINATION_NAME)]
- [Row(false, TEMP_QUEUE_DESTINATION_NAME)]
- [Row(true, TEMP_TOPIC_DESTINATION_NAME)]
- [Row(false, TEMP_TOPIC_DESTINATION_NAME)]
+ [Row(MsgDeliveryMode.Persistent, QUEUE_DESTINATION_NAME)]
+ [Row(MsgDeliveryMode.NonPersistent, QUEUE_DESTINATION_NAME)]
+ [Row(MsgDeliveryMode.Persistent, TOPIC_DESTINATION_NAME)]
+ [Row(MsgDeliveryMode.NonPersistent, TOPIC_DESTINATION_NAME)]
+
+ [Row(MsgDeliveryMode.Persistent, TEMP_QUEUE_DESTINATION_NAME)]
+ [Row(MsgDeliveryMode.NonPersistent, TEMP_QUEUE_DESTINATION_NAME)]
+ [Row(MsgDeliveryMode.Persistent, TEMP_TOPIC_DESTINATION_NAME)]
+ [Row(MsgDeliveryMode.NonPersistent, TEMP_TOPIC_DESTINATION_NAME)]
#endif
- public void TempDestinationDeletionTest(bool persistent, string destinationName)
+ public void TempDestinationDeletionTest(MsgDeliveryMode deliveryMode, string destinationName)
{
using(IConnection connection1 = CreateConnection(TEST_CLIENT_ID))
{
@@ -60,7 +60,7 @@
using(IMessageProducer producer = session.CreateProducer(destination))
using(IMessageConsumer consumer = session.CreateConsumer(destination))
{
- producer.Persistent = persistent;
+ producer.DeliveryMode = deliveryMode;
IMessage request = session.CreateTextMessage("Hello World, Just Passing Through!");
Modified: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/TextMessage.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/TextMessage.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/TextMessage.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/TextMessage.cs Fri May 22 22:02:35 2009
@@ -29,10 +29,10 @@
#if !NET_1_1
[RowTest]
- [Row(true)]
- [Row(false)]
+ [Row(MsgDeliveryMode.Persistent)]
+ [Row(MsgDeliveryMode.NonPersistent)]
#endif
- public void SendReceiveTextMessage(bool persistent)
+ public void SendReceiveTextMessage(MsgDeliveryMode deliveryMode)
{
using(IConnection connection = CreateConnection(TEST_CLIENT_ID))
{
@@ -43,14 +43,14 @@
using(IMessageConsumer consumer = session.CreateConsumer(destination))
using(IMessageProducer producer = session.CreateProducer(destination))
{
- producer.Persistent = persistent;
+ producer.DeliveryMode = deliveryMode;
producer.RequestTimeout = receiveTimeout;
IMessage request = session.CreateTextMessage("Hello World!");
producer.Send(request);
IMessage message = consumer.Receive(receiveTimeout);
AssertTextMessageEqual(request, message);
- Assert.AreEqual(persistent, message.NMSPersistent, "NMSPersistent does not match");
+ Assert.AreEqual(deliveryMode, message.NMSDeliveryMode, "NMSDeliveryMode does not match");
}
}
}
Modified: activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/TransactionTest.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/TransactionTest.cs?rev=777725&r1=777724&r2=777725&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/TransactionTest.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/test/csharp/TransactionTest.cs Fri May 22 22:02:35 2009
@@ -32,10 +32,10 @@
#if !NET_1_1
[RowTest]
- [Row(true)]
- [Row(false)]
+ [Row(MsgDeliveryMode.Persistent)]
+ [Row(MsgDeliveryMode.NonPersistent)]
#endif
- public void TestSendRollback(bool persistent)
+ public void TestSendRollback(MsgDeliveryMode deliveryMode)
{
using(IConnection connection = CreateConnection(TEST_CLIENT_ID))
{
@@ -46,7 +46,7 @@
using(IMessageConsumer consumer = session.CreateConsumer(destination))
using(IMessageProducer producer = session.CreateProducer(destination))
{
- producer.Persistent = persistent;
+ producer.DeliveryMode = deliveryMode;
producer.RequestTimeout = receiveTimeout;
ITextMessage firstMsgSend = session.CreateTextMessage("First Message");
producer.Send(firstMsgSend);
@@ -77,10 +77,10 @@
#if !NET_1_1
[RowTest]
- [Row(true)]
- [Row(false)]
+ [Row(MsgDeliveryMode.Persistent)]
+ [Row(MsgDeliveryMode.NonPersistent)]
#endif
- public void TestSendSessionClose(bool persistent)
+ public void TestSendSessionClose(MsgDeliveryMode deliveryMode)
{
ITextMessage firstMsgSend;
ITextMessage secondMsgSend;
@@ -104,7 +104,7 @@
IDestination destination2 = SessionUtil.GetDestination(session2, DESTINATION_NAME);
using(IMessageProducer producer = session2.CreateProducer(destination2))
{
- producer.Persistent = persistent;
+ producer.DeliveryMode = deliveryMode;
producer.RequestTimeout = receiveTimeout;
firstMsgSend = session2.CreateTextMessage("First Message");
producer.Send(firstMsgSend);
@@ -125,7 +125,7 @@
IDestination destination2 = SessionUtil.GetDestination(session2, DESTINATION_NAME);
using(IMessageProducer producer = session2.CreateProducer(destination2))
{
- producer.Persistent = persistent;
+ producer.DeliveryMode = deliveryMode;
producer.RequestTimeout = receiveTimeout;
secondMsgSend = session2.CreateTextMessage("Second Message");
producer.Send(secondMsgSend);
@@ -150,10 +150,10 @@
#if !NET_1_1
[RowTest]
- [Row(true)]
- [Row(false)]
+ [Row(MsgDeliveryMode.Persistent)]
+ [Row(MsgDeliveryMode.NonPersistent)]
#endif
- public void TestReceiveRollback(bool persistent)
+ public void TestReceiveRollback(MsgDeliveryMode deliveryMode)
{
using(IConnection connection = CreateConnection(TEST_CLIENT_ID))
{
@@ -164,7 +164,7 @@
using(IMessageConsumer consumer = session.CreateConsumer(destination))
using(IMessageProducer producer = session.CreateProducer(destination))
{
- producer.Persistent = persistent;
+ producer.DeliveryMode = deliveryMode;
producer.RequestTimeout = receiveTimeout;
// Send both messages
ITextMessage firstMsgSend = session.CreateTextMessage("First Message");
@@ -195,10 +195,10 @@
#if !NET_1_1
[RowTest]
- [Row(true)]
- [Row(false)]
+ [Row(MsgDeliveryMode.Persistent)]
+ [Row(MsgDeliveryMode.NonPersistent)]
#endif
- public void TestReceiveTwoThenRollback(bool persistent)
+ public void TestReceiveTwoThenRollback(MsgDeliveryMode deliveryMode)
{
using(IConnection connection = CreateConnection(TEST_CLIENT_ID))
{
@@ -209,7 +209,7 @@
using(IMessageConsumer consumer = session.CreateConsumer(destination))
using(IMessageProducer producer = session.CreateProducer(destination))
{
- producer.Persistent = persistent;
+ producer.DeliveryMode = deliveryMode;
producer.RequestTimeout = receiveTimeout;
// Send both messages
ITextMessage firstMsgSend = session.CreateTextMessage("First Message");
@@ -241,12 +241,12 @@
#if !NET_1_1
[RowTest]
- [Row(AcknowledgementMode.AutoAcknowledge, true)]
- [Row(AcknowledgementMode.AutoAcknowledge, false)]
- [Row(AcknowledgementMode.ClientAcknowledge, true)]
- [Row(AcknowledgementMode.ClientAcknowledge, false)]
+ [Row(AcknowledgementMode.AutoAcknowledge, MsgDeliveryMode.Persistent)]
+ [Row(AcknowledgementMode.AutoAcknowledge, MsgDeliveryMode.NonPersistent)]
+ [Row(AcknowledgementMode.ClientAcknowledge, MsgDeliveryMode.Persistent)]
+ [Row(AcknowledgementMode.ClientAcknowledge, MsgDeliveryMode.NonPersistent)]
#endif
- public void TestSendCommitNonTransaction(AcknowledgementMode ackMode, bool persistent)
+ public void TestSendCommitNonTransaction(AcknowledgementMode ackMode, MsgDeliveryMode deliveryMode)
{
using(IConnection connection = CreateConnection(TEST_CLIENT_ID))
{
@@ -257,7 +257,7 @@
using(IMessageConsumer consumer = session.CreateConsumer(destination))
using(IMessageProducer producer = session.CreateProducer(destination))
{
- producer.Persistent = persistent;
+ producer.DeliveryMode = deliveryMode;
producer.RequestTimeout = receiveTimeout;
ITextMessage firstMsgSend = session.CreateTextMessage("SendCommitNonTransaction Message");
producer.Send(firstMsgSend);
@@ -276,12 +276,12 @@
#if !NET_1_1
[RowTest]
- [Row(AcknowledgementMode.AutoAcknowledge, true)]
- [Row(AcknowledgementMode.AutoAcknowledge, false)]
- [Row(AcknowledgementMode.ClientAcknowledge, true)]
- [Row(AcknowledgementMode.ClientAcknowledge, false)]
+ [Row(AcknowledgementMode.AutoAcknowledge, MsgDeliveryMode.Persistent)]
+ [Row(AcknowledgementMode.AutoAcknowledge, MsgDeliveryMode.NonPersistent)]
+ [Row(AcknowledgementMode.ClientAcknowledge, MsgDeliveryMode.Persistent)]
+ [Row(AcknowledgementMode.ClientAcknowledge, MsgDeliveryMode.NonPersistent)]
#endif
- public void TestReceiveCommitNonTransaction(AcknowledgementMode ackMode, bool persistent)
+ public void TestReceiveCommitNonTransaction(AcknowledgementMode ackMode, MsgDeliveryMode deliveryMode)
{
using(IConnection connection = CreateConnection(TEST_CLIENT_ID))
{
@@ -292,7 +292,7 @@
using(IMessageConsumer consumer = session.CreateConsumer(destination))
using(IMessageProducer producer = session.CreateProducer(destination))
{
- producer.Persistent = persistent;
+ producer.DeliveryMode = deliveryMode;
producer.RequestTimeout = receiveTimeout;
ITextMessage firstMsgSend = session.CreateTextMessage("ReceiveCommitNonTransaction Message");
producer.Send(firstMsgSend);
@@ -321,12 +321,12 @@
#if !NET_1_1
[RowTest]
- [Row(AcknowledgementMode.AutoAcknowledge, true)]
- [Row(AcknowledgementMode.AutoAcknowledge, false)]
- [Row(AcknowledgementMode.ClientAcknowledge, true)]
- [Row(AcknowledgementMode.ClientAcknowledge, false)]
+ [Row(AcknowledgementMode.AutoAcknowledge, MsgDeliveryMode.Persistent)]
+ [Row(AcknowledgementMode.AutoAcknowledge, MsgDeliveryMode.NonPersistent)]
+ [Row(AcknowledgementMode.ClientAcknowledge, MsgDeliveryMode.Persistent)]
+ [Row(AcknowledgementMode.ClientAcknowledge, MsgDeliveryMode.NonPersistent)]
#endif
- public void TestReceiveRollbackNonTransaction(AcknowledgementMode ackMode, bool persistent)
+ public void TestReceiveRollbackNonTransaction(AcknowledgementMode ackMode, MsgDeliveryMode deliveryMode)
{
using(IConnection connection = CreateConnection(TEST_CLIENT_ID))
{
@@ -337,7 +337,7 @@
using(IMessageConsumer consumer = session.CreateConsumer(destination))
using(IMessageProducer producer = session.CreateProducer(destination))
{
- producer.Persistent = persistent;
+ producer.DeliveryMode = deliveryMode;
producer.RequestTimeout = receiveTimeout;
ITextMessage firstMsgSend = session.CreateTextMessage("ReceiveCommitNonTransaction Message");
producer.Send(firstMsgSend);