qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kp...@apache.org
Subject qpid-interop-test git commit: QPIDIT-2: Added mutually exclusive options --exclude-shim and --include-shim to tests
Date Wed, 23 Nov 2016 22:46:07 GMT
Repository: qpid-interop-test
Updated Branches:
  refs/heads/master 236d70795 -> 547f1dd8b


QPIDIT-2: Added mutually exclusive options --exclude-shim and --include-shim to tests


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

Branch: refs/heads/master
Commit: 547f1dd8be923f1d6404895a2201f1ed01966e2c
Parents: 236d707
Author: Kim van der Riet <kpvdr@apache.org>
Authored: Wed Nov 23 17:45:50 2016 -0500
Committer: Kim van der Riet <kpvdr@apache.org>
Committed: Wed Nov 23 17:45:50 2016 -0500

----------------------------------------------------------------------
 src/python/not_yet_impl/jms_types.py            | 39 ++++++++++++++++
 .../amqp_large_content_test.py                  | 36 ++++++++++++---
 src/python/qpid_interop_test/amqp_types_test.py | 48 +++++++++++++++-----
 .../qpid_interop_test/jms_hdrs_props_test.py    | 39 ++++++++++++----
 .../qpid_interop_test/jms_messages_test.py      | 39 ++++++++++++----
 src/python/qpid_interop_test/jms_types.py       | 39 ----------------
 6 files changed, 162 insertions(+), 78 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/547f1dd8/src/python/not_yet_impl/jms_types.py
----------------------------------------------------------------------
diff --git a/src/python/not_yet_impl/jms_types.py b/src/python/not_yet_impl/jms_types.py
new file mode 100644
index 0000000..32745da
--- /dev/null
+++ b/src/python/not_yet_impl/jms_types.py
@@ -0,0 +1,39 @@
+"""
+Common JMS types and definitions as implemented by QpidJMS
+"""
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+from proton import byte, symbol
+
+QPID_JMS_TYPE_ANNOTATION_NAME = symbol(u'x-opt-jms-msg-type')
+
+QPID_JMS_TYPE_ANNOTATIONS = {
+    'JMS_MESSAGE_TYPE': byte(0),
+    'JMS_BYTESMESSAGE_TYPE': byte(3),
+    'JMS_MAPMESSAGE_TYPE': byte(2),
+    'JMS_OBJECTMESSAGE_TYPE': byte(1),
+    'JMS_STREAMMESSAGE_TYPE': byte(4),
+    'JMS_TEXTMESSAGE_TYPE': byte(5)
+    }
+
+def create_annotation(jms_msg_type):
+    """Function which creates a message annotation for JMS message type as used by the Qpid
JMS client"""
+    return {QPID_JMS_TYPE_ANNOTATION_NAME: QPID_JMS_TYPE_ANNOTATIONS[jms_msg_type]}

http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/547f1dd8/src/python/qpid_interop_test/amqp_large_content_test.py
----------------------------------------------------------------------
diff --git a/src/python/qpid_interop_test/amqp_large_content_test.py b/src/python/qpid_interop_test/amqp_large_content_test.py
index 67a3990..2be6eb3 100755
--- a/src/python/qpid_interop_test/amqp_large_content_test.py
+++ b/src/python/qpid_interop_test/amqp_large_content_test.py
@@ -177,10 +177,14 @@ def create_testcase_class(amqp_type, shim_product):
 # other shim in the list.
 #
 # As new shims are added, add them into this map to have them included in the test cases.
-PROTON_CPP_RECEIVER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-cpp',
'amqp_large_content_test', 'Receiver')
-PROTON_CPP_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-cpp', 'amqp_large_content_test',
'Sender')
-PROTON_PYTHON_RECEIVER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python',
'amqp_large_content_test', 'Receiver.py')
-PROTON_PYTHON_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python',
'amqp_large_content_test', 'Sender.py')
+PROTON_CPP_RECEIVER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-cpp',
'amqp_large_content_test',
+                                     'Receiver')
+PROTON_CPP_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-cpp', 'amqp_large_content_test',
+                                   'Sender')
+PROTON_PYTHON_RECEIVER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python',
+                                        'amqp_large_content_test', 'Receiver.py')
+PROTON_PYTHON_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python',
'amqp_large_content_test',
+                                      'Sender.py')
 
 SHIM_MAP = {qpid_interop_test.shims.ProtonCppShim.NAME: \
                 qpid_interop_test.shims.ProtonCppShim(PROTON_CPP_SENDER_SHIM, PROTON_CPP_RECEIVER_SHIM),
@@ -200,7 +204,10 @@ class TestOptions(object):
                             help='Node to which test suite will send messages.')
         parser.add_argument('--receiver', action='store', default='localhost:5672', metavar='IP-ADDR:PORT',
                             help='Node from which test suite will receive messages.')
-        parser.add_argument('--exclude-shim', action='append', metavar='SHIM-NAME',
+        shim_group = parser.add_mutually_exclusive_group()
+        shim_group.add_argument('--include-shim', action='append', metavar='SHIM-NAME',
+                                help='Name of shim to include. Supported shims:\n%s' % sorted(SHIM_MAP.keys()))
+        shim_group.add_argument('--exclude-shim', action='append', metavar='SHIM-NAME',
                             help='Name of shim to exclude. Supported shims:\n%s' % sorted(SHIM_MAP.keys()))
         self.args = parser.parse_args()
 
@@ -234,10 +241,25 @@ if __name__ == '__main__':
     # type classes, each of which contains a test for the combinations of client shims
     TEST_SUITE = unittest.TestSuite()
 
+        # Add shims included from the command-line
+    if ARGS.include_shim is not None:
+        new_shim_map = {}
+        for shim in ARGS.include_shim:
+            try:
+                new_shim_map[shim] = SHIM_MAP[shim]
+            except KeyError:
+                print 'No such shim: "%s". Use --help for valid shims' % shim
+                sys.exit(1) # Errors or failures present
+        SHIM_MAP = new_shim_map
     # Remove shims excluded from the command-line
-    if ARGS.exclude_shim is not None:
+    elif ARGS.exclude_shim is not None:
         for shim in ARGS.exclude_shim:
-            SHIM_MAP.pop(shim)
+            try:
+                SHIM_MAP.pop(shim)
+            except KeyError:
+                print 'No such shim: "%s". Use --help for valid shims' % shim
+                sys.exit(1) # Errors or failures present
+
     # Create test classes dynamically
     for at in sorted(TYPES.get_type_list()):
         test_case_class = create_testcase_class(at, product(SHIM_MAP.values(), repeat=2))

http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/547f1dd8/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 0f339e4..d53dd38 100755
--- a/src/python/qpid_interop_test/amqp_types_test.py
+++ b/src/python/qpid_interop_test/amqp_types_test.py
@@ -403,12 +403,18 @@ def create_testcase_class(amqp_type, shim_product):
 # other shim in the list.
 #
 # As new shims are added, add them into this map to have them included in the test cases.
-PROTON_CPP_RECEIVER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-cpp',
'amqp_types_test', 'Receiver')
-PROTON_CPP_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-cpp', 'amqp_types_test',
'Sender')
-PROTON_PYTHON_RECEIVER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python',
'amqp_types_test', 'Receiver.py')
-PROTON_PYTHON_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python',
'amqp_types_test', 'Sender.py')
-PROTON_RHEAJS_RECEIVER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'rhea-js', 'amqp_types_test',
'Receiver.js')
-PROTON_RHEAJS_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'rhea-js', 'amqp_types_test',
'Sender.js')
+PROTON_CPP_RECEIVER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-cpp',
'amqp_types_test',
+                                     'Receiver')
+PROTON_CPP_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-cpp', 'amqp_types_test',
+                                   'Sender')
+PROTON_PYTHON_RECEIVER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python',
'amqp_types_test',
+                                        'Receiver.py')
+PROTON_PYTHON_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python',
'amqp_types_test',
+                                      'Sender.py')
+PROTON_RHEAJS_RECEIVER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'rhea-js', 'amqp_types_test',
+                                        'Receiver.js')
+PROTON_RHEAJS_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'rhea-js', 'amqp_types_test',
+                                      'Sender.js')
 
 SHIM_MAP = {qpid_interop_test.shims.ProtonCppShim.NAME: \
                 qpid_interop_test.shims.ProtonCppShim(PROTON_CPP_SENDER_SHIM, PROTON_CPP_RECEIVER_SHIM),
@@ -442,12 +448,14 @@ class TestOptions(object):
         parser.add_argument('--exclude-type', action='append', metavar='AMQP-TYPE',
                             help='Name of AMQP type to exclude. Supported types:\n%s' %
                             sorted(AmqpPrimitiveTypes.TYPE_MAP.keys()))
-#        shim_group = test_group.add_mutually_exclusive_group()
-#        shim_group.add_argument('--include-shim', action='append', metavar='SHIM-NAME',
-#                                help='Name of shim to include. Supported shims:\n%s' % sorted(SHIM_MAP.keys()))
-        parser.add_argument('--exclude-shim', action='append', metavar='SHIM-NAME',
+        shim_group = parser.add_mutually_exclusive_group()
+        shim_group.add_argument('--include-shim', action='append', metavar='SHIM-NAME',
+                                help='Name of shim to include. Supported shims:\n%s' % sorted(SHIM_MAP.keys()))
+        shim_group.add_argument('--exclude-shim', action='append', metavar='SHIM-NAME',
                             help='Name of shim to exclude. Supported shims:\n%s' % sorted(SHIM_MAP.keys()))
         self.args = parser.parse_args()
+#        if self.args.include_shim is not None and self.args.exclude_shim is not None:
+#            raise RuntimeError('Connot use --include-shim and --exclude-shim together')
 
 
 #--- Main program start ---
@@ -480,10 +488,26 @@ if __name__ == '__main__':
     # type classes, each of which contains a test for the combinations of client shims
     TEST_SUITE = unittest.TestSuite()
 
+
+    # Add shims included from the command-line
+    if ARGS.include_shim is not None:
+        new_shim_map = {}
+        for shim in ARGS.include_shim:
+            try:
+                new_shim_map[shim] = SHIM_MAP[shim]
+            except KeyError:
+                print 'No such shim: "%s". Use --help for valid shims' % shim
+                sys.exit(1) # Errors or failures present
+        SHIM_MAP = new_shim_map
     # Remove shims excluded from the command-line
-    if ARGS.exclude_shim is not None:
+    elif ARGS.exclude_shim is not None:
         for shim in ARGS.exclude_shim:
-            SHIM_MAP.pop(shim)
+            try:
+                SHIM_MAP.pop(shim)
+            except KeyError:
+                print 'No such shim: "%s". Use --help for valid shims' % shim
+                sys.exit(1) # Errors or failures present
+
     # Create test classes dynamically
     for at in sorted(TYPES.get_type_list()):
         if ARGS.exclude_type is None or at not in ARGS.exclude_type:

http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/547f1dd8/src/python/qpid_interop_test/jms_hdrs_props_test.py
----------------------------------------------------------------------
diff --git a/src/python/qpid_interop_test/jms_hdrs_props_test.py b/src/python/qpid_interop_test/jms_hdrs_props_test.py
index d0d77ac..34765ac 100755
--- a/src/python/qpid_interop_test/jms_hdrs_props_test.py
+++ b/src/python/qpid_interop_test/jms_hdrs_props_test.py
@@ -585,10 +585,14 @@ def create_part_d_testcase_class(jms_message_type):
     return new_class
 
 
-PROTON_CPP_RECEIVER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-cpp',
'jms_hdrs_props_test', 'Receiver')
-PROTON_CPP_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-cpp', 'jms_hdrs_props_test',
'Sender')
-PROTON_PYTHON_RECEIVER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python',
'jms_hdrs_props_test', 'Receiver.py')
-PROTON_PYTHON_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python',
'jms_hdrs_props_test', 'Sender.py')
+PROTON_CPP_RECEIVER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-cpp',
'jms_hdrs_props_test',
+                                     'Receiver')
+PROTON_CPP_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-cpp', 'jms_hdrs_props_test',
+                                   'Sender')
+PROTON_PYTHON_RECEIVER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python',
'jms_hdrs_props_test',
+                                        'Receiver.py')
+PROTON_PYTHON_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python',
'jms_hdrs_props_test',
+                                      'Sender.py')
 QIT_JMS_CLASSPATH_FILE = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-jms', 'cp.txt')
 with open(QIT_JMS_CLASSPATH_FILE, 'r') as classpath_file:
     QIT_JMS_CLASSPATH = classpath_file.read()
@@ -632,10 +636,10 @@ class TestOptions(object):
         parser.add_argument('--exclude-type', action='append', metavar='JMS-MESSAGE-TYPE',
                             help='Name of JMS message type to exclude. Supported types:\n%s'
%
                             sorted(JmsMessageTypes.TYPE_MAP.keys()))
-#        shim_group = test_group.add_mutually_exclusive_group()
-#        shim_group.add_argument('--include-shim', action='append', metavar='SHIM-NAME',
-#                                help='Name of shim to include. Supported shims:\n%s' % sorted(SHIM_MAP.keys()))
-        parser.add_argument('--exclude-shim', action='append', metavar='SHIM-NAME',
+        shim_group = parser.add_mutually_exclusive_group()
+        shim_group.add_argument('--include-shim', action='append', metavar='SHIM-NAME',
+                                help='Name of shim to include. Supported shims:\n%s' % sorted(SHIM_MAP.keys()))
+        shim_group.add_argument('--exclude-shim', action='append', metavar='SHIM-NAME',
                             help='Name of shim to exclude. Supported shims:\n%s' % sorted(SHIM_MAP.keys()))
         self.args = parser.parse_args()
 
@@ -668,10 +672,25 @@ if __name__ == '__main__':
     # type classes, each of which contains a test for the combinations of client shims
     TEST_SUITE = unittest.TestSuite()
 
+    # Add shims included from the command-line
+    if ARGS.include_shim is not None:
+        new_shim_map = {}
+        for shim in ARGS.include_shim:
+            try:
+                new_shim_map[shim] = SHIM_MAP[shim]
+            except KeyError:
+                print 'No such shim: "%s". Use --help for valid shims' % shim
+                sys.exit(1) # Errors or failures present
+        SHIM_MAP = new_shim_map
     # Remove shims excluded from the command-line
-    if ARGS.exclude_shim is not None:
+    elif ARGS.exclude_shim is not None:
         for shim in ARGS.exclude_shim:
-            SHIM_MAP.pop(shim)
+            try:
+                SHIM_MAP.pop(shim)
+            except KeyError:
+                print 'No such shim: "%s". Use --help for valid shims' % shim
+                sys.exit(1) # Errors or failures present
+
     # Create test classes dynamically
     create_testcases()
 

http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/547f1dd8/src/python/qpid_interop_test/jms_messages_test.py
----------------------------------------------------------------------
diff --git a/src/python/qpid_interop_test/jms_messages_test.py b/src/python/qpid_interop_test/jms_messages_test.py
index fb35fc6..7ddd590 100755
--- a/src/python/qpid_interop_test/jms_messages_test.py
+++ b/src/python/qpid_interop_test/jms_messages_test.py
@@ -297,10 +297,14 @@ def create_testcase_class(jms_message_type, shim_product):
     return new_class
 
 
-PROTON_CPP_RECEIVER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-cpp',
'jms_messages_test', 'Receiver')
-PROTON_CPP_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-cpp', 'jms_messages_test',
'Sender')
-PROTON_PYTHON_RECEIVER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python',
'jms_messages_test', 'Receiver.py')
-PROTON_PYTHON_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python',
'jms_messages_test', 'Sender.py')
+PROTON_CPP_RECEIVER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-cpp',
'jms_messages_test',
+                                     'Receiver')
+PROTON_CPP_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-cpp', 'jms_messages_test',
+                                   'Sender')
+PROTON_PYTHON_RECEIVER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python',
'jms_messages_test',
+                                        'Receiver.py')
+PROTON_PYTHON_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python',
'jms_messages_test',
+                                      'Sender.py')
 QIT_JMS_CLASSPATH_FILE = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-jms', 'cp.txt')
 with open(QIT_JMS_CLASSPATH_FILE, 'r') as classpath_file:
     QIT_JMS_CLASSPATH = classpath_file.read()
@@ -344,10 +348,10 @@ class TestOptions(object):
         parser.add_argument('--exclude-type', action='append', metavar='JMS-MESSAGE-TYPE',
                             help='Name of JMS message type to exclude. Supported types:\n%s'
%
                             sorted(JmsMessageTypes.TYPE_MAP.keys()))
-#        shim_group = test_group.add_mutually_exclusive_group()
-#        shim_group.add_argument('--include-shim', action='append', metavar='SHIM-NAME',
-#                                help='Name of shim to include. Supported shims:\n%s' % sorted(SHIM_MAP.keys()))
-        parser.add_argument('--exclude-shim', action='append', metavar='SHIM-NAME',
+        shim_group = parser.add_mutually_exclusive_group()
+        shim_group.add_argument('--include-shim', action='append', metavar='SHIM-NAME',
+                                help='Name of shim to include. Supported shims:\n%s' % sorted(SHIM_MAP.keys()))
+        shim_group.add_argument('--exclude-shim', action='append', metavar='SHIM-NAME',
                             help='Name of shim to exclude. Supported shims:\n%s' % sorted(SHIM_MAP.keys()))
         self.args = parser.parse_args()
 
@@ -384,10 +388,25 @@ if __name__ == '__main__':
     # type classes, each of which contains a test for the combinations of client shims
     TEST_SUITE = unittest.TestSuite()
 
+    # Add shims included from the command-line
+    if ARGS.include_shim is not None:
+        new_shim_map = {}
+        for shim in ARGS.include_shim:
+            try:
+                new_shim_map[shim] = SHIM_MAP[shim]
+            except KeyError:
+                print 'No such shim: "%s". Use --help for valid shims' % shim
+                sys.exit(1) # Errors or failures present
+        SHIM_MAP = new_shim_map
     # Remove shims excluded from the command-line
-    if ARGS.exclude_shim is not None:
+    elif ARGS.exclude_shim is not None:
         for shim in ARGS.exclude_shim:
-            SHIM_MAP.pop(shim)
+            try:
+                SHIM_MAP.pop(shim)
+            except KeyError:
+                print 'No such shim: "%s". Use --help for valid shims' % shim
+                sys.exit(1) # Errors or failures present
+
     # Create test classes dynamically
     for jmt in sorted(TYPES.get_type_list()):
         if ARGS.exclude_type is None or jmt not in ARGS.exclude_type:

http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/547f1dd8/src/python/qpid_interop_test/jms_types.py
----------------------------------------------------------------------
diff --git a/src/python/qpid_interop_test/jms_types.py b/src/python/qpid_interop_test/jms_types.py
deleted file mode 100644
index 32745da..0000000
--- a/src/python/qpid_interop_test/jms_types.py
+++ /dev/null
@@ -1,39 +0,0 @@
-"""
-Common JMS types and definitions as implemented by QpidJMS
-"""
-
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from proton import byte, symbol
-
-QPID_JMS_TYPE_ANNOTATION_NAME = symbol(u'x-opt-jms-msg-type')
-
-QPID_JMS_TYPE_ANNOTATIONS = {
-    'JMS_MESSAGE_TYPE': byte(0),
-    'JMS_BYTESMESSAGE_TYPE': byte(3),
-    'JMS_MAPMESSAGE_TYPE': byte(2),
-    'JMS_OBJECTMESSAGE_TYPE': byte(1),
-    'JMS_STREAMMESSAGE_TYPE': byte(4),
-    'JMS_TEXTMESSAGE_TYPE': byte(5)
-    }
-
-def create_annotation(jms_msg_type):
-    """Function which creates a message annotation for JMS message type as used by the Qpid
JMS client"""
-    return {QPID_JMS_TYPE_ANNOTATION_NAME: QPID_JMS_TYPE_ANNOTATIONS[jms_msg_type]}


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


Mime
View raw message