You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ch...@apache.org on 2017/01/06 20:37:34 UTC

qpid-interop-test git commit: QPIDIT-62: AMQP.Net Lite shim feature complete

Repository: qpid-interop-test
Updated Branches:
  refs/heads/master 98bbff870 -> 79fcae609


QPIDIT-62: AMQP.Net Lite shim feature complete

Running the amqp_types_tests under mono shows some differences in
.NET types in play.

* For lists VS2015 uses Array while mono uses ArrayList.
* For maps VS2015 uses Dictionary while mono uses Dictionary`2.


Project: http://git-wip-us.apache.org/repos/asf/qpid-interop-test/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-interop-test/commit/79fcae60
Tree: http://git-wip-us.apache.org/repos/asf/qpid-interop-test/tree/79fcae60
Diff: http://git-wip-us.apache.org/repos/asf/qpid-interop-test/diff/79fcae60

Branch: refs/heads/master
Commit: 79fcae609c041890cd910dd5a579f6d691c256e5
Parents: 98bbff8
Author: Chuck Rolke <cr...@redhat.com>
Authored: Fri Jan 6 15:31:54 2017 -0500
Committer: Chuck Rolke <cr...@redhat.com>
Committed: Fri Jan 6 15:31:54 2017 -0500

----------------------------------------------------------------------
 .../src/amqp_types_test/Sender/Sender.cs        | 23 ++++++++++++++++++++
 1 file changed, 23 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/79fcae60/shims/amqpnetlite/src/amqp_types_test/Sender/Sender.cs
----------------------------------------------------------------------
diff --git a/shims/amqpnetlite/src/amqp_types_test/Sender/Sender.cs b/shims/amqpnetlite/src/amqp_types_test/Sender/Sender.cs
index 16399d9..597a16e 100644
--- a/shims/amqpnetlite/src/amqp_types_test/Sender/Sender.cs
+++ b/shims/amqpnetlite/src/amqp_types_test/Sender/Sender.cs
@@ -20,6 +20,7 @@
  */
 
 using System;
+using System.Collections;
 using System.Collections.Generic;
 using System.Text;
 using System.Threading;
@@ -172,9 +173,15 @@ namespace Qpidit
                     case "Array":
                         qpiditType = "list";
                         break;
+                    case "ArrayList":
+                        qpiditType = "list";
+                        break;
                     case "Dictionary":
                         qpiditType = "map";
                         break;
+                    case "Dictionary`2":
+                        qpiditType = "map";
+                        break;
                     default:
                         throw new ApplicationException(String.Format(
                             "Can not translate system type {0} to a QpidIT type", typename));
@@ -236,6 +243,22 @@ namespace Qpidit
                     ((Amqp.Types.List)valueDirect).Add(itemValue.ToObject());
                 }
             }
+            if (baseValue is ArrayList)
+            {
+                // List
+                if (! String.Equals(baseType, "list", StringComparison.OrdinalIgnoreCase))
+                {
+                    throw new ApplicationException(String.Format(
+                        "Sender asked to encode a {0} but received a list: {1}", baseType, baseValue.ToString()));
+                }
+                valueDirect = new Amqp.Types.List();
+                foreach (object item in (ArrayList)baseValue)
+                {
+                    MessageValue itemValue = MessageValue.CreateAutoType(item);
+                    itemValue.Encode();
+                    ((Amqp.Types.List)valueDirect).Add(itemValue.ToObject());
+                }
+            }
             else if (baseValue is Dictionary<string, object>)
             {
                 // Map


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org