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 2016/12/22 17:09:22 UTC

qpid-interop-test git commit: QPIDIT-62: Fix sender to support null message type

Repository: qpid-interop-test
Updated Branches:
  refs/heads/master 0569f2bae -> a1789577a


QPIDIT-62: Fix sender to support null message type


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/a1789577
Tree: http://git-wip-us.apache.org/repos/asf/qpid-interop-test/tree/a1789577
Diff: http://git-wip-us.apache.org/repos/asf/qpid-interop-test/diff/a1789577

Branch: refs/heads/master
Commit: a1789577aad8a620516b985de0f4cba78594b9dc
Parents: 0569f2b
Author: Chuck Rolke <cr...@redhat.com>
Authored: Thu Dec 22 12:13:27 2016 -0500
Committer: Chuck Rolke <cr...@redhat.com>
Committed: Thu Dec 22 12:13:27 2016 -0500

----------------------------------------------------------------------
 .../src/amqp_types_test/Sender/Sender.cs        | 132 ++++++++++---------
 1 file changed, 69 insertions(+), 63 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/a1789577/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 785016e..7108807 100644
--- a/shims/amqpnetlite/src/amqp_types_test/Sender/Sender.cs
+++ b/shims/amqpnetlite/src/amqp_types_test/Sender/Sender.cs
@@ -90,11 +90,7 @@ namespace Qpidit
             if (!encoded)
                 Encode();
 
-            if (valueDirect != null)
-            {
-                return valueDirect;
-            }
-            throw new ApplicationException("Sender.MessageValue.ToObject: Message not encoded properly");
+            return valueDirect;
         }
 
 
@@ -117,65 +113,72 @@ namespace Qpidit
         {
             string typename = obj.GetType().Name;
             string qpiditType = null;
-            switch (typename)
+            if (obj == null)
             {
-                case "Boolean":
-                    qpiditType = "boolean";
-                    break;
-                case "Byte":
-                    qpiditType = "ubyte";
-                    break;
-                case "UInt16":
-                    qpiditType = "ushort";
-                    break;
-                case "UInt32":
-                    qpiditType = "uint";
-                    break;
-                case "UInt64":
-                    qpiditType = "ulong";
-                    break;
-                case "SByte":
-                    qpiditType = "byte";
-                    break;
-                case "Int16":
-                    qpiditType = "short";
-                    break;
-                case "Int32":
-                    qpiditType = "int";
-                    break;
-                case "Int64":
-                    qpiditType = "long";
-                    break;
-                case "Single":
-                    qpiditType = "float";
-                    break;
-                case "Double":
-                    qpiditType = "double";
-                    break;
-                case "DateTime":
-                    qpiditType = "timestamp";
-                    break;
-                case "Guid":
-                    qpiditType = "uuid";
-                    break;
-                case "Byte[]":
-                    qpiditType = "binary";
-                    break;
-                case "String":
-                    qpiditType = "string";
-                    break;
-                case "Symbol":
-                    qpiditType = "symbol";
-                    break;
-                case "Array":
-                    qpiditType = "list";
-                    break;
-                case "Dictionary":
-                    qpiditType = "map";
-                    break;
-                default:
-                    throw new ApplicationException(String.Format(
-                        "Can not translate system type {0} to a QpidIT type", typename));
+                qpiditType = "null";
+            }
+            else
+            {
+                switch (typename)
+                {
+                    case "Boolean":
+                        qpiditType = "boolean";
+                        break;
+                    case "Byte":
+                        qpiditType = "ubyte";
+                        break;
+                    case "UInt16":
+                        qpiditType = "ushort";
+                        break;
+                    case "UInt32":
+                        qpiditType = "uint";
+                        break;
+                    case "UInt64":
+                        qpiditType = "ulong";
+                        break;
+                    case "SByte":
+                        qpiditType = "byte";
+                        break;
+                    case "Int16":
+                        qpiditType = "short";
+                        break;
+                    case "Int32":
+                        qpiditType = "int";
+                        break;
+                    case "Int64":
+                        qpiditType = "long";
+                        break;
+                    case "Single":
+                        qpiditType = "float";
+                        break;
+                    case "Double":
+                        qpiditType = "double";
+                        break;
+                    case "DateTime":
+                        qpiditType = "timestamp";
+                        break;
+                    case "Guid":
+                        qpiditType = "uuid";
+                        break;
+                    case "Byte[]":
+                        qpiditType = "binary";
+                        break;
+                    case "String":
+                        qpiditType = "string";
+                        break;
+                    case "Symbol":
+                        qpiditType = "symbol";
+                        break;
+                    case "Array":
+                        qpiditType = "list";
+                        break;
+                    case "Dictionary":
+                        qpiditType = "map";
+                        break;
+                    default:
+                        throw new ApplicationException(String.Format(
+                            "Can not translate system type {0} to a QpidIT type", typename));
+                }
             }
             return qpiditType;
         }
@@ -258,6 +261,9 @@ namespace Qpidit
 
                 switch (baseType)
                 {
+                    case "null":
+                        valueDirect = null;
+                        break;
                     case "boolean":
                         value = (string)baseValue;
                         bool mybool = String.Equals(value, "true", StringComparison.OrdinalIgnoreCase);


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