qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject [1/2] qpid-interop-test git commit: QPIDIT-89: Write single line to stderr on failure for better detection
Date Fri, 18 Aug 2017 19:06:19 GMT
Repository: qpid-interop-test
Updated Branches:
  refs/heads/master bddf69106 -> 70f1e527a


QPIDIT-89: Write single line to stderr on failure for better detection

Distinguish between 'not supported' and 'cannot decode' decimal types.
Throw only one error 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/03aa6068
Tree: http://git-wip-us.apache.org/repos/asf/qpid-interop-test/tree/03aa6068
Diff: http://git-wip-us.apache.org/repos/asf/qpid-interop-test/diff/03aa6068

Branch: refs/heads/master
Commit: 03aa6068fe554bb5359a115d60262edb6c166bd7
Parents: bddf691
Author: Chuck Rolke <crolke@redhat.com>
Authored: Fri Aug 18 14:50:26 2017 -0400
Committer: Chuck Rolke <crolke@redhat.com>
Committed: Fri Aug 18 14:50:26 2017 -0400

----------------------------------------------------------------------
 .../src/amqp_types_test/Receiver/Receiver.cs    | 21 ++++++++--------
 .../src/amqp_types_test/Sender/Sender.cs        | 26 ++++++++++++--------
 2 files changed, 27 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/03aa6068/shims/amqpnetlite/src/amqp_types_test/Receiver/Receiver.cs
----------------------------------------------------------------------
diff --git a/shims/amqpnetlite/src/amqp_types_test/Receiver/Receiver.cs b/shims/amqpnetlite/src/amqp_types_test/Receiver/Receiver.cs
index 70f71e1..818bfe3 100644
--- a/shims/amqpnetlite/src/amqp_types_test/Receiver/Receiver.cs
+++ b/shims/amqpnetlite/src/amqp_types_test/Receiver/Receiver.cs
@@ -21,6 +21,7 @@
 
 using System;
 using System.Collections.Generic;
+using System.IO;
 using System.Text;
 using System.Threading;
 using Amqp;
@@ -471,18 +472,17 @@ namespace Qpidit
              *       3: QPIDIT AMQP type name of expected message body values
              *       4: Expected number of test values to receive
              */
-            if (args.Length != 4)
-            {
-                throw new System.ArgumentException(
-                    "Required argument count must be 4: brokerAddr queueName amqpType nValues");
-            }
             int exitCode = 0;
-
-            //Trace.TraceLevel = TraceLevel.Frame | TraceLevel.Verbose;
-            //Trace.TraceListener = (f, a) => Console.WriteLine(DateTime.Now.ToString("[hh:mm:ss.fff]")
+ " " + string.Format(f, a));
-
             try
             {
+                if (args.Length != 4)
+                {
+                    throw new ApplicationException(
+                        "program requires four arguments: brokerAddr queueName amqpType nValues");
+                }
+                //Trace.TraceLevel = TraceLevel.Frame | TraceLevel.Verbose;
+                //Trace.TraceListener = (f, a) => Console.WriteLine(DateTime.Now.ToString("[hh:mm:ss.fff]")
+ " " + string.Format(f, a));
+
                 Receiver receiver = new Qpidit.Receiver(
                     args[0], args[1], args[2], Int32.Parse(args[3]));
                 receiver.run();
@@ -492,7 +492,8 @@ namespace Qpidit
             }
             catch (Exception e)
             {
-                Console.Error.WriteLine("AmqpReceiver error: {0}.", e);
+                string firstline = new StringReader(e.ToString()).ReadLine();
+                Console.Error.WriteLine("AmqpSender error: {0}.", firstline);
                 exitCode = 1;
             }
 

http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/03aa6068/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 597a16e..ff76732 100644
--- a/shims/amqpnetlite/src/amqp_types_test/Sender/Sender.cs
+++ b/shims/amqpnetlite/src/amqp_types_test/Sender/Sender.cs
@@ -22,6 +22,7 @@
 using System;
 using System.Collections;
 using System.Collections.Generic;
+using System.IO;
 using System.Text;
 using System.Threading;
 using System.Web.Script.Serialization;
@@ -387,6 +388,11 @@ namespace Qpidit
                     case "map":
                         throw new ApplicationException(String.Format(
                             "Sender asked to encode a map but received a string: {0}", baseValue));
+                    case "decimal32":
+                    case "decimal64":
+                    case "decimal128":
+                        throw new ApplicationException(String.Format(
+                            "AMQP.Net Lite does not support AMQP decimal type: {0}", baseType));
                     default:
                         throw new ApplicationException(String.Format(
                             "Sender can not encode base type: {0}", baseType));
@@ -479,24 +485,24 @@ namespace Qpidit
              *       3: AMQP type
              *       4: Test value(s) as JSON string
              */
-            if (args.Length != 4)
-            {
-                throw new System.ArgumentException(
-                    "Required argument count must be 4: brokerAddr queueName amqpType jsonValuesToSend");
-            }
             int exitCode = 0;
-
-            //Trace.TraceLevel = TraceLevel.Frame | TraceLevel.Verbose;
-            //Trace.TraceListener = (f, a) => Console.WriteLine(DateTime.Now.ToString("[hh:mm:ss.fff]")
+ " " + string.Format(f, a));
-
             try
             {
+                if (args.Length != 4)
+                {
+                    throw new ApplicationException(
+                        "program requires four arguments: brokerAddr queueName amqpType jsonValuesToSend");
+                }
+                //Trace.TraceLevel = TraceLevel.Frame | TraceLevel.Verbose;
+                //Trace.TraceListener = (f, a) => Console.WriteLine(DateTime.Now.ToString("[hh:mm:ss.fff]")
+ " " + string.Format(f, a));
+
                 Sender sender = new Qpidit.Sender(args[0], args[1], args[2], args[3]);
                 sender.run();
             }
             catch (Exception e)
             {
-                Console.Error.WriteLine("AmqpSender error: {0}.", e);
+                string firstline = new StringReader(e.ToString()).ReadLine();
+                Console.Error.WriteLine("AmqpSender error: {0}.", firstline);
                 exitCode = 1;
             }
 


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


Mime
View raw message