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/08/18 19:06:19 UTC
[1/2] qpid-interop-test git commit: QPIDIT-89: Write single line to
stderr on failure for better detection
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 <cr...@redhat.com>
Authored: Fri Aug 18 14:50:26 2017 -0400
Committer: Chuck Rolke <cr...@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
[2/2] qpid-interop-test git commit: QPIDIT-88: Add per-client test
skip to handle unsupported types
Posted by ch...@apache.org.
QPIDIT-88: Add per-client test skip to handle unsupported types
Skip tests instead of failing; show reason for test being skipped.
Avoid long receiver timeouts when sender has exited and will never send.
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/70f1e527
Tree: http://git-wip-us.apache.org/repos/asf/qpid-interop-test/tree/70f1e527
Diff: http://git-wip-us.apache.org/repos/asf/qpid-interop-test/diff/70f1e527
Branch: refs/heads/master
Commit: 70f1e527aa4412b50e5a277e0e016a7a5470ab68
Parents: 03aa606
Author: Chuck Rolke <cr...@redhat.com>
Authored: Fri Aug 18 14:57:09 2017 -0400
Committer: Chuck Rolke <cr...@redhat.com>
Committed: Fri Aug 18 14:57:09 2017 -0400
----------------------------------------------------------------------
src/python/qpid_interop_test/amqp_types_test.py | 10 ++++++
src/python/qpid_interop_test/test_type_map.py | 34 ++++++++++++++++++--
2 files changed, 42 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/70f1e527/src/python/qpid_interop_test/amqp_types_test.py
----------------------------------------------------------------------
diff --git a/src/python/qpid_interop_test/amqp_types_test.py b/src/python/qpid_interop_test/amqp_types_test.py
index c6c8287..c54c977 100755
--- a/src/python/qpid_interop_test/amqp_types_test.py
+++ b/src/python/qpid_interop_test/amqp_types_test.py
@@ -279,6 +279,12 @@ class AmqpPrimitiveTypes(TestTypeMap):
'double': {'apache-activemq-artemis': '-NaN is stripped of its sign: ENTMQ-1686',},
}
+ CLIENT_SKIP = {
+ 'decimal32': {'AmqpNetLite': 'Decimal types not supported: https://github.com/Azure/amqpnetlite/issues/223', },
+ 'decimal64': {'AmqpNetLite': 'Decimal types not supported: https://github.com/Azure/amqpnetlite/issues/223', },
+ 'decimal128': {'AmqpNetLite': 'Decimal types not supported: https://github.com/Azure/amqpnetlite/issues/223', },
+ }
+
def __init__(self):
super(AmqpPrimitiveTypes, self).__init__()
@@ -378,6 +384,10 @@ def create_testcase_class(amqp_type, shim_product):
@unittest.skipIf(TYPES.skip_test(amqp_type, BROKER),
TYPES.skip_test_message(amqp_type, BROKER))
+ @unittest.skipIf(TYPES.skip_client_test(amqp_type, send_shim.NAME),
+ TYPES.skip_client_test_message(amqp_type, send_shim.NAME, "SENDER"))
+ @unittest.skipIf(TYPES.skip_client_test(amqp_type, receive_shim.NAME),
+ TYPES.skip_client_test_message(amqp_type, receive_shim.NAME, "RECEIVER"))
def inner_test_method(self):
self.run_test(self.sender_addr,
self.receiver_addr,
http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/70f1e527/src/python/qpid_interop_test/test_type_map.py
----------------------------------------------------------------------
diff --git a/src/python/qpid_interop_test/test_type_map.py b/src/python/qpid_interop_test/test_type_map.py
index 3e5367d..378f0e2 100644
--- a/src/python/qpid_interop_test/test_type_map.py
+++ b/src/python/qpid_interop_test/test_type_map.py
@@ -36,7 +36,7 @@ class TestTypeMap(object):
# }
TYPE_MAP = {}
- # BROKER_SKIP: For know broker issues where a type would cause a test to fail or hang,
+ # BROKER_SKIP: For known broker issues where a type would cause a test to fail or hang,
# entries in BROKER_SKIP will cause the test to be skipped with a message.
# This is a map containing AMQP types as a key, and a list of brokers for which this
# type should be skipped.
@@ -54,6 +54,24 @@ class TestTypeMap(object):
# connection property string it returns.
BROKER_SKIP = {}
+ # CLIENT_SKIP: For known client issues where a type would cause a test to fail or hang,
+ # entries in CLIENT_SKIP will cause the test to be skipped with a message.
+ # This is a map containing AMQP types as a key, and a list of clients for which this
+ # type should be skipped.
+ # Format: {'jms_msg_type_1' : {'client_1' : 'skip msg for client_1',
+ # 'client_2' : 'skip msg for client_2',
+ # ...
+ # },
+ # 'jms_msg_type_2' : {'client_1' : 'skip msg for client_1',
+ # 'client_2' : 'skip msg for client_2',
+ # ...
+ # },
+ # ...
+ # }
+ # where client_1, client_2, ... are client product names as defined by the
+ # test shim NAME.
+ CLIENT_SKIP = {}
+
def __init__(self):
pass
@@ -90,7 +108,7 @@ class TestTypeMap(object):
"""Return the message to use if a test is skipped"""
if test_type in self.BROKER_SKIP.keys():
if broker_name in self.BROKER_SKIP[test_type]:
- return str(self.BROKER_SKIP[test_type][broker_name])
+ return str("BROKER: " + self.BROKER_SKIP[test_type][broker_name])
return None
def skip_test(self, test_type, broker_name):
@@ -98,6 +116,18 @@ class TestTypeMap(object):
return test_type in self.BROKER_SKIP.keys() and \
broker_name in self.BROKER_SKIP[test_type]
+ def skip_client_test_message(self, test_type, client_name, role):
+ """Return the message to use if a test is skipped"""
+ if test_type in self.CLIENT_SKIP.keys():
+ if client_name in self.CLIENT_SKIP[test_type]:
+ return str(role + ": " + self.CLIENT_SKIP[test_type][client_name])
+ return None
+
+ def skip_client_test(self, test_type, client_name):
+ """Return boolean True if test should be skipped"""
+ return test_type in self.CLIENT_SKIP.keys() and \
+ client_name in self.CLIENT_SKIP[test_type]
+
@staticmethod
def merge_dicts(*dict_args):
"""Static method to merge two or more dictionaries"""
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org