public void TestCopy() { this.nmsMessageID = "ID:1141:45278:429"; this.nmsCorrelationID = "testcorrelationid"; this.nmsDestination = new Topic("test.topic"); this.nmsReplyTo = new TempTopic("test.replyto.topic:001"); this.nmsDeliveryMode = MsgDeliveryMode.NonPersistent; this.nmsType = "test type"; this.nmsPriority = MsgPriority.High; this.nmsTimestamp = DateTime.Now; Message msg1 = new Message(); msg1.NMSMessageId = this.nmsMessageID; msg1.NMSCorrelationID = this.nmsCorrelationID; msg1.FromDestination = this.nmsDestination; msg1.NMSReplyTo = this.nmsReplyTo; msg1.NMSDeliveryMode = this.nmsDeliveryMode; msg1.NMSType = this.nmsType; msg1.NMSPriority = this.nmsPriority; msg1.NMSTimestamp = this.nmsTimestamp; msg1.ReadOnlyProperties = true; Message msg2 = msg1.Clone() as Message; Assert.IsTrue(msg1.NMSMessageId.Equals(msg2.NMSMessageId)); Assert.IsTrue(msg1.NMSCorrelationID.Equals(msg2.NMSCorrelationID)); Assert.IsTrue(msg1.NMSDestination.Equals(msg2.NMSDestination)); Assert.IsTrue(msg1.NMSReplyTo.Equals(msg2.NMSReplyTo)); Assert.IsTrue(msg1.NMSDeliveryMode == msg2.NMSDeliveryMode); Assert.IsTrue(msg1.NMSRedelivered == msg2.NMSRedelivered); Assert.IsTrue(msg1.NMSType.Equals(msg2.NMSType)); Assert.IsTrue(msg1.NMSPriority == msg2.NMSPriority); Assert.IsTrue(msg1.NMSTimestamp == msg2.NMSTimestamp); }
public virtual void SetUp() { this.nmsMessageID = "testid"; this.nmsCorrelationID = "testcorrelationid"; this.nmsDestination = new Topic("TEST.Message"); this.nmsReplyTo = new TempTopic("TEST.Message.replyto.topic:001"); this.nmsDeliveryMode = MsgDeliveryMode.NonPersistent; this.nmsRedelivered = true; this.nmsType = "test type"; this.nmsPriority = MsgPriority.High; this.nmsTimestamp = DateTime.Now; this.consumerIDs = new long[3]; for (int i = 0; i < this.consumerIDs.Length; i++) { this.consumerIDs[i] = i; } }
public ITemporaryTopic CreateTemporaryTopic() { TempTopic answer = new TempTopic(Connection.CreateTemporaryDestinationName()); return(answer); }