diff options
author | Ted Ross <tross@apache.org> | 2010-07-19 19:51:47 +0000 |
---|---|---|
committer | Ted Ross <tross@apache.org> | 2010-07-19 19:51:47 +0000 |
commit | 56cf23dc21b5787a4b567afe5b83c3e5504071e6 (patch) | |
tree | b8ca7dd0ea5149e5d689d61387d4c72d61a5e937 /cpp/bindings/qpid/dotnet/test/messaging.test/messaging.test.cs | |
parent | 9c5727d8246a1c3c08c77842832e330b5275c53e (diff) | |
download | qpid-python-56cf23dc21b5787a4b567afe5b83c3e5504071e6.tar.gz |
QPID-2589 - Patch from Chuck Rolke
This patch cleans up or adds the copy constructors and the copy assignment operators for the binding classes.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@965603 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/bindings/qpid/dotnet/test/messaging.test/messaging.test.cs')
-rw-r--r-- | cpp/bindings/qpid/dotnet/test/messaging.test/messaging.test.cs | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/cpp/bindings/qpid/dotnet/test/messaging.test/messaging.test.cs b/cpp/bindings/qpid/dotnet/test/messaging.test/messaging.test.cs index c1b3035470..9280dfa8f2 100644 --- a/cpp/bindings/qpid/dotnet/test/messaging.test/messaging.test.cs +++ b/cpp/bindings/qpid/dotnet/test/messaging.test/messaging.test.cs @@ -139,6 +139,68 @@ namespace Org.Apache.Qpid.Messaging guidReadback = myGuid.ToByteArray();
Console.WriteLine("GuidReadback len = {0}", guidReadback.Length);
+
+ //
+ // Set/Get some properties of a message
+ //
+ Message msgGetSet = new Message("12345");
+
+ msgGetSet.Subject = "Subject";
+ msgGetSet.MessageId = "MessageId";
+ msgGetSet.UserId = "UserId";
+ msgGetSet.CorrelationId = "CorrelationId";
+ msgGetSet.Ttl = DurationConstants.SECOND;
+ msgGetSet.Priority = (byte)'z';
+ msgGetSet.Durable = false;
+ msgGetSet.Redelivered = true;
+
+ Dictionary<string, object> props = new Dictionary<string,object>();
+ props.Add("firstProperty", 1);
+ props.Add("secondProperty", 2);
+ msgGetSet.Properties = props;
+
+
+
+ Console.WriteLine("Message Subject = {0}", msgGetSet.Subject);
+ Console.WriteLine("Message ContentType = {0}", msgGetSet.ContentType);
+ Console.WriteLine("Message MessageId = {0}", msgGetSet.MessageId);
+ Console.WriteLine("Message UserId = {0}", msgGetSet.UserId);
+ Console.WriteLine("Message CorrelationId = {0}", msgGetSet.CorrelationId);
+ Console.WriteLine("Message Ttl mS = {0}", msgGetSet.Ttl.Milliseconds);
+ Console.WriteLine("Message Priority = {0}", msgGetSet.Priority);
+ Console.WriteLine("Message Durable = {0}", msgGetSet.Durable);
+ Console.WriteLine("Message Redelivered = {0}", msgGetSet.Redelivered);
+
+ Dictionary<string, object> gotProps = msgGetSet.Properties;
+ foreach (KeyValuePair<string, object> kvp in gotProps)
+ {
+ Console.WriteLine("Message Property {0} = {1}", kvp.Key, kvp.Value.ToString());
+ }
+
+ Console.WriteLine("Cycle through a million address copy constructions...");
+ Address a1 = new Address("abc");
+ Address a2 = new Address("def");
+ Address a3 = new Address(a2);
+ for (int i = 0; i < 1000000; i++)
+ {
+ a1 = a2;
+ a2 = a3;
+ a3 = new Address(a1);
+ }
+ Console.WriteLine(" ...done.");
+
+ Console.WriteLine("Use each object's copy constructor");
+
+ Address Address1 = new Address("abc");
+ Address Address2 = new Address(Address1);
+
+ Connection Connection1 = new Connection("abc");
+ Connection Connection2 = new Connection(Connection1);
+
+ Message Message1 = new Message("abc");
+ Message Message2 = new Message(Message1);
+
+
}
}
}
|