QPIDIT-52: Make qpid-interop-test installable. Now the test is installable via the use of cmake / make from the top level directory.
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/0e153797 Tree: http://git-wip-us.apache.org/repos/asf/qpid-interop-test/tree/0e153797 Diff: http://git-wip-us.apache.org/repos/asf/qpid-interop-test/diff/0e153797 Branch: refs/heads/master Commit: 0e153797bdb6625c81be4834faf31a553997e7b6 Parents: 2380159 Author: Kim van der Riet <[email protected]> Authored: Wed Nov 23 12:51:46 2016 -0500 Committer: Kim van der Riet <[email protected]> Committed: Wed Nov 23 12:51:46 2016 -0500 ---------------------------------------------------------------------- .gitignore | 1 + CMakeLists.txt | 58 ++++++ QUICKSTART | 36 +--- setup.py | 66 +++++++ shims/qpid-proton-cpp/CMakeLists.txt | 2 +- shims/qpid-proton-python/src/__init__.py | 18 -- .../src/amqp_dtx_test/__init__.py | 19 ++ .../src/amqp_features_test/__init__.py | 19 ++ .../src/amqp_large_content_test/__init__.py | 19 ++ .../src/amqp_types_test/__init__.py | 19 ++ .../src/jms_dtx_test/__init__.py | 19 ++ .../src/jms_hdrs_props_test/__init__.py | 19 ++ .../src/jms_large_content_test/__init__.py | 19 ++ .../src/jms_messages_test/__init__.py | 19 ++ src/python/not_yet_impl/amqp_dtx_test.py | 136 +++++++++++++ src/python/not_yet_impl/amqp_features_test.py | 195 +++++++++++++++++++ src/python/not_yet_impl/jms_dtx_test.py | 146 ++++++++++++++ .../not_yet_impl/jms_large_content_test.py | 144 ++++++++++++++ src/python/qpid_interop_test/amqp_dtx_test.py | 136 ------------- .../qpid_interop_test/amqp_features_test.py | 195 ------------------- .../amqp_large_content_test.py | 12 +- src/python/qpid_interop_test/amqp_types_test.py | 19 +- src/python/qpid_interop_test/jms_dtx_test.py | 146 -------------- .../qpid_interop_test/jms_hdrs_props_test.py | 12 +- .../qpid_interop_test/jms_large_content_test.py | 144 -------------- .../qpid_interop_test/jms_messages_test.py | 12 +- 26 files changed, 927 insertions(+), 703 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/0e153797/.gitignore ---------------------------------------------------------------------- diff --git a/.gitignore b/.gitignore index b83d222..99d2bb1 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /target/ +/build/ http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/0e153797/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..830d737 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,58 @@ +# +# 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. +# + +project(qpid-interop-test) + +cmake_minimum_required(VERSION 2.8.7 FATAL_ERROR) + +set(PROTON_INSTALL_DIR "/usr/local/qpid-proton" CACHE PATH "Proton install directory") + +add_subdirectory(shims/qpid-proton-cpp/src) + +# Build Java code +install(CODE "execute_process(COMMAND mvn -DskipTests install + WORKING_DIRECTORY ../)") + +# Install files using python setup.py +install(CODE "execute_process(COMMAND python setup.py install --prefix ${CMAKE_INSTALL_PREFIX} + WORKING_DIRECTORY ../)") +install(CODE "execute_process(COMMAND chmod +x amqp_large_content_test.py + amqp_types_test.py + jms_hdrs_props_test.py + jms_messages_test.py + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/python2.7/site-packages/qpid_interop_test/)") +install(CODE "execute_process(COMMAND chmod +x Receiver.py + Sender.py + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/python2.7/site-packages/qpid_interop_test/shims/qpid-proton-python/amqp_large_content_test/)") +install(CODE "execute_process(COMMAND chmod +x Receiver.py + Sender.py + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/python2.7/site-packages/qpid_interop_test/shims/qpid-proton-python/amqp_types_test/)") +install(CODE "execute_process(COMMAND chmod +x Receiver.py + Sender.py + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/python2.7/site-packages/qpid_interop_test/shims/qpid-proton-python/jms_hdrs_props_test/)") +install(CODE "execute_process(COMMAND chmod +x Receiver.py + Sender.py + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/python2.7/site-packages/qpid_interop_test/shims/qpid-proton-python/jms_messages_test/)") + +# Install Rhea client dependencies +install(CODE "execute_process(COMMAND npm install node-uuid + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/python2.7/site-packages/qpid_interop_test/shims/rhea-js/)") +install(CODE "execute_process(COMMAND npm link rhea + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/python2.7/site-packages/qpid_interop_test/shims/rhea-js/)") + http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/0e153797/QUICKSTART ---------------------------------------------------------------------- diff --git a/QUICKSTART b/QUICKSTART index 3eb5db8..bab2081 100644 --- a/QUICKSTART +++ b/QUICKSTART @@ -13,8 +13,8 @@ These are the install steps: b. Qpid Python c. Qpid JMS d. Rhea -2. Install and build qpid-interop-test -3. Install or build AMQP brokers to test against +2. Download and build qpid-interop-test +3. Install or download / build AMQP brokers to test against 4. Run the tests @@ -86,19 +86,10 @@ npm install debug sudo npm link cd .. -2. Install and build qpid-interop-test -====================================== +2. Download and build qpid-interop-test +======================================= git clone https://git-wip-us.apache.org/repos/asf/qpid-interop-test.git cd qpid-interop-test - -a. Build Java shims -------------------- -Java shims: -mvn -DskipTests install - -b. Build C++ shims ------------------- -cd shims/qpid-proton-cpp mkdir build cd build @@ -108,17 +99,8 @@ make sudo make install # INSTALL OPTION B: -cmake -DPROTON_INSTALL_DIR=/abs/path/to/local/install/dir .. -make - -cd ../../.. - -c. Prepare Rhea shims ---------------------- -cd shims/rhea-js/amqp_types_test -npm install node-uuid -npm link rhea -cd ../../../.. +cmake -DPROTON_INSTALL_DIR=/abs/path/to/local/install/dir -DCMAKE_INSTALL_PREFIX=/abs/path/to/local/install/dir .. +make install 3. Install or build AMQP brokers to test against @@ -181,9 +163,9 @@ export LD_LIBRARY_PATH=${INSTALL_PATH}/lib64 Start the test broker -All of the tests are located in ${QPID_INTEROP_TEST_HOME}/src/python/qpid-interop-test, and can be directly called: -./src/python/qpid-interop-test/amqp_types_test.py -./src/python/qpid-interop-test/jms_messages_test.py +All of the tests are located in ${QPID_INTEROP_TEST_HOME}/src/python/qpid_interop_test, and can be directly called: +./src/python/qpid_interop_test/amqp_types_test.py +./src/python/qpid_interop_test/jms_messages_test.py etc. http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/0e153797/setup.py ---------------------------------------------------------------------- diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..ab58998 --- /dev/null +++ b/setup.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python +# +# 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 distutils.core import setup + +PACKAGE_DIR = 'lib/python2.7/site-packages/qpid_interop_test' +SHIM_DIR = '%s/shims' % PACKAGE_DIR + +setup(name='qpid-interop-test', + version='0.1', + description='Test suite for testing interoperability between Qpid AMQP clients', + author='Apache Qpid', + author_email='[email protected]', + url='http://qpid.apache.org/', + packages=['qpid_interop_test', + 'qpid_interop_test/shims/qpid-proton-python/amqp_types_test', + 'qpid_interop_test/shims/qpid-proton-python/amqp_large_content_test', + 'qpid_interop_test/shims/qpid-proton-python/jms_hdrs_props_test', + 'qpid_interop_test/shims/qpid-proton-python/jms_messages_test', + ], + package_dir={'qpid_interop_test': 'src/python/qpid_interop_test', + 'qpid_interop_test/shims/qpid-proton-python/amqp_types_test': 'shims/qpid-proton-python/src/amqp_types_test', + 'qpid_interop_test/shims/qpid-proton-python/amqp_large_content_test': 'shims/qpid-proton-python/src/amqp_large_content_test', + 'qpid_interop_test/shims/qpid-proton-python/jms_hdrs_props_test': 'shims/qpid-proton-python/src/jms_hdrs_props_test', + 'qpid_interop_test/shims/qpid-proton-python/jms_messages_test': 'shims/qpid-proton-python/src/jms_messages_test', + }, + data_files=[('%s/qpid-jms' % SHIM_DIR, ['shims/qpid-jms/target/qpid-interop-test-jms-shim-0.1.0-SNAPSHOT.jar', + 'shims/qpid-jms/cp.txt']), + ('%s/qpid-proton-cpp/amqp_types_test' % SHIM_DIR, ['build/amqp_types_test/Receiver', + 'build/amqp_types_test/Sender', + ] + ), + ('%s/qpid-proton-cpp/amqp_large_content_test' % SHIM_DIR, ['build/amqp_large_content_test/Receiver', + 'build/amqp_large_content_test/Sender', + ], + ), + ('%s/qpid-proton-cpp/jms_messages_test' % SHIM_DIR, ['build/jms_messages_test/Receiver', + 'build/jms_messages_test/Sender', + ], + ), + ('%s/qpid-proton-cpp/jms_hdrs_props_test' % SHIM_DIR, ['build/jms_hdrs_props_test/Receiver', + 'build/jms_hdrs_props_test/Sender', + ], + ), + ('%s/rhea-js/amqp_types_test' % SHIM_DIR, ['shims/rhea-js/amqp_types_test/Receiver.js', + 'shims/rhea-js/amqp_types_test/Sender.js'], + ), + ], + ) http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/0e153797/shims/qpid-proton-cpp/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/shims/qpid-proton-cpp/CMakeLists.txt b/shims/qpid-proton-cpp/CMakeLists.txt index fb00a9d..31a2581 100644 --- a/shims/qpid-proton-cpp/CMakeLists.txt +++ b/shims/qpid-proton-cpp/CMakeLists.txt @@ -19,7 +19,7 @@ project (qpid-interop-test-cpp-shims) -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 2.8.7 FATAL_ERROR) set(PROTON_INSTALL_DIR "/usr/local/qpid-proton" CACHE PATH "Proton install directory") http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/0e153797/shims/qpid-proton-python/src/__init__.py ---------------------------------------------------------------------- diff --git a/shims/qpid-proton-python/src/__init__.py b/shims/qpid-proton-python/src/__init__.py deleted file mode 100644 index 31d5a2e..0000000 --- a/shims/qpid-proton-python/src/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -# -# 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. -# http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/0e153797/shims/qpid-proton-python/src/amqp_dtx_test/__init__.py ---------------------------------------------------------------------- diff --git a/shims/qpid-proton-python/src/amqp_dtx_test/__init__.py b/shims/qpid-proton-python/src/amqp_dtx_test/__init__.py new file mode 100644 index 0000000..63a3f41 --- /dev/null +++ b/shims/qpid-proton-python/src/amqp_dtx_test/__init__.py @@ -0,0 +1,19 @@ +# +# 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. +# + http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/0e153797/shims/qpid-proton-python/src/amqp_features_test/__init__.py ---------------------------------------------------------------------- diff --git a/shims/qpid-proton-python/src/amqp_features_test/__init__.py b/shims/qpid-proton-python/src/amqp_features_test/__init__.py new file mode 100644 index 0000000..63a3f41 --- /dev/null +++ b/shims/qpid-proton-python/src/amqp_features_test/__init__.py @@ -0,0 +1,19 @@ +# +# 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. +# + http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/0e153797/shims/qpid-proton-python/src/amqp_large_content_test/__init__.py ---------------------------------------------------------------------- diff --git a/shims/qpid-proton-python/src/amqp_large_content_test/__init__.py b/shims/qpid-proton-python/src/amqp_large_content_test/__init__.py new file mode 100644 index 0000000..63a3f41 --- /dev/null +++ b/shims/qpid-proton-python/src/amqp_large_content_test/__init__.py @@ -0,0 +1,19 @@ +# +# 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. +# + http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/0e153797/shims/qpid-proton-python/src/amqp_types_test/__init__.py ---------------------------------------------------------------------- diff --git a/shims/qpid-proton-python/src/amqp_types_test/__init__.py b/shims/qpid-proton-python/src/amqp_types_test/__init__.py new file mode 100644 index 0000000..63a3f41 --- /dev/null +++ b/shims/qpid-proton-python/src/amqp_types_test/__init__.py @@ -0,0 +1,19 @@ +# +# 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. +# + http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/0e153797/shims/qpid-proton-python/src/jms_dtx_test/__init__.py ---------------------------------------------------------------------- diff --git a/shims/qpid-proton-python/src/jms_dtx_test/__init__.py b/shims/qpid-proton-python/src/jms_dtx_test/__init__.py new file mode 100644 index 0000000..63a3f41 --- /dev/null +++ b/shims/qpid-proton-python/src/jms_dtx_test/__init__.py @@ -0,0 +1,19 @@ +# +# 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. +# + http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/0e153797/shims/qpid-proton-python/src/jms_hdrs_props_test/__init__.py ---------------------------------------------------------------------- diff --git a/shims/qpid-proton-python/src/jms_hdrs_props_test/__init__.py b/shims/qpid-proton-python/src/jms_hdrs_props_test/__init__.py new file mode 100644 index 0000000..63a3f41 --- /dev/null +++ b/shims/qpid-proton-python/src/jms_hdrs_props_test/__init__.py @@ -0,0 +1,19 @@ +# +# 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. +# + http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/0e153797/shims/qpid-proton-python/src/jms_large_content_test/__init__.py ---------------------------------------------------------------------- diff --git a/shims/qpid-proton-python/src/jms_large_content_test/__init__.py b/shims/qpid-proton-python/src/jms_large_content_test/__init__.py new file mode 100644 index 0000000..63a3f41 --- /dev/null +++ b/shims/qpid-proton-python/src/jms_large_content_test/__init__.py @@ -0,0 +1,19 @@ +# +# 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. +# + http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/0e153797/shims/qpid-proton-python/src/jms_messages_test/__init__.py ---------------------------------------------------------------------- diff --git a/shims/qpid-proton-python/src/jms_messages_test/__init__.py b/shims/qpid-proton-python/src/jms_messages_test/__init__.py new file mode 100644 index 0000000..63a3f41 --- /dev/null +++ b/shims/qpid-proton-python/src/jms_messages_test/__init__.py @@ -0,0 +1,19 @@ +# +# 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. +# + http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/0e153797/src/python/not_yet_impl/amqp_dtx_test.py ---------------------------------------------------------------------- diff --git a/src/python/not_yet_impl/amqp_dtx_test.py b/src/python/not_yet_impl/amqp_dtx_test.py new file mode 100644 index 0000000..7e4a644 --- /dev/null +++ b/src/python/not_yet_impl/amqp_dtx_test.py @@ -0,0 +1,136 @@ +#!/usr/bin/env python + +""" +Module to test AMQP distributed transactions across different clients +""" + +# +# 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. +# + +import argparse +import sys +import unittest + +#from itertools import product +#from json import dumps +from os import getenv, path +#from time import mktime, time +#from uuid import UUID, uuid4 + +from proton import symbol +#import qpid_interop_test.broker_properties +import qpid_interop_test.shims +#from qpid_interop_test.test_type_map import TestTypeMap + +# TODO: propose a sensible default when installation details are worked out +QPID_INTEROP_TEST_HOME = getenv('QPID_INTEROP_TEST_HOME') +if QPID_INTEROP_TEST_HOME is None: + print 'ERROR: Environment variable QPID_INTEROP_TEST_HOME is not set' + sys.exit(1) + + +class AmqpDtxTestCase(unittest.TestCase): + """ + Abstract base class for AMQP distributed transactions (DTX) test cases + """ + + def run_test(self): + """ + Run this test by invoking the shim send method to send the test values, followed by the shim receive method + to receive the values. Finally, compare the sent values with the received values. + """ + pass + + +# SHIM_MAP contains an instance of each client language shim that is to be tested as a part of this test. For +# every shim in this list, a test is dynamically constructed which tests it against itself as well as every +# 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', 'build', 'amqp_dtx_test', + 'Receiver') +PROTON_CPP_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-cpp', 'build', 'amqp_dtx_test', + 'Sender') +PROTON_PYTHON_RECEIVER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python', 'src', 'amqp_dtx_test', + 'Receiver.py') +PROTON_PYTHON_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python', 'src', 'amqp_dtx_test', + 'Sender.py') + +SHIM_MAP = {qpid_interop_test.shims.ProtonCppShim.NAME: \ + qpid_interop_test.shims.ProtonCppShim(PROTON_CPP_SENDER_SHIM, PROTON_CPP_RECEIVER_SHIM), + qpid_interop_test.shims.ProtonPythonShim.NAME: \ + qpid_interop_test.shims.ProtonPythonShim(PROTON_PYTHON_SENDER_SHIM, PROTON_PYTHON_RECEIVER_SHIM), + } + + +class TestOptions(object): + """ + Class controlling command-line arguments used to control the test. + """ + def __init__(self): + parser = argparse.ArgumentParser(description='Qpid-interop AMQP client interoparability test suite ' + 'for AMQP distrubuted (dtx) transactions') + parser.add_argument('--broker', action='store', default='localhost:5672', metavar='BROKER:PORT', + help='Broker against which to run test suite.') + parser.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() + + +#--- Main program start --- + +if __name__ == '__main__': + + ARGS = TestOptions().args + #print 'ARGS:', ARGS # debug + + # Connect to broker to find broker type + CONNECTION_PROPS = qpid_interop_test.broker_properties.get_broker_properties(ARGS.sender) + if CONNECTION_PROPS is None: + print 'WARNING: Unable to get connection properties - unknown broker' + BROKER = 'unknown' + else: + BROKER = CONNECTION_PROPS[symbol(u'product')] if symbol(u'product') in CONNECTION_PROPS \ + else '<product not found>' + BROKER_VERSION = CONNECTION_PROPS[symbol(u'version')] if symbol(u'version') in CONNECTION_PROPS \ + else '<version not found>' + BROKER_PLATFORM = CONNECTION_PROPS[symbol(u'platform')] if symbol(u'platform') in CONNECTION_PROPS \ + else '<platform not found>' + print 'Test Broker: %s v.%s on %s' % (BROKER, BROKER_VERSION, BROKER_PLATFORM) + print + sys.stdout.flush() + + # TEST_CASE_CLASSES is a list that collects all the test classes that are constructed. One class is constructed + # per AMQP type used as the key in map AmqpPrimitiveTypes.TYPE_MAP. + TEST_CASE_CLASSES = [] + + # TEST_SUITE is the final suite of tests that will be run and which contains all the dynamically created + # type classes, each of which contains a test for the combinations of client shims + TEST_SUITE = unittest.TestSuite() + + # Remove shims excluded from the command-line + if ARGS.exclude_shim is not None: + for shim in ARGS.exclude_shim: + SHIM_MAP.pop(shim) + # Create test classes dynamically + + # Finally, run all the dynamically created tests + RES = unittest.TextTestRunner(verbosity=2).run(TEST_SUITE) + if not RES.wasSuccessful(): + sys.exit(1) # Errors or failures present http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/0e153797/src/python/not_yet_impl/amqp_features_test.py ---------------------------------------------------------------------- diff --git a/src/python/not_yet_impl/amqp_features_test.py b/src/python/not_yet_impl/amqp_features_test.py new file mode 100644 index 0000000..83f140f --- /dev/null +++ b/src/python/not_yet_impl/amqp_features_test.py @@ -0,0 +1,195 @@ +#!/usr/bin/env python + +""" +Module to test AMQP features across different clients +""" + +# +# 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. +# + +import argparse +import sys +import unittest + +from json import dumps +from os import getenv, path + +from proton import symbol +import qpid_interop_test.shims + +# TODO: propose a sensible default when installation details are worked out +QPID_INTEROP_TEST_HOME = getenv('QPID_INTEROP_TEST_HOME') +if QPID_INTEROP_TEST_HOME is None: + print 'ERROR: Environment variable QPID_INTEROP_TEST_HOME is not set' + sys.exit(1) + + +class AmqpFeaturesTestCase(unittest.TestCase): + """ + Abstract base class for AMQP message features test cases + """ + + def run_test(self, sender_addr, receiver_addr, test_type, send_shim, receive_shim): + """ + Run this test by invoking the shim send method to send the test values, followed by the shim receive method + to receive the values. Finally, compare the sent values with the received values. + """ + send_queue_name = 'jms.queue.qpid-interop.amqp_features_test.%s' % send_shim.NAME + receive_queue_name = 'jms.queue.qpid-interop.amqp_features_test.%s' % receive_shim.NAME + + # Start the receive shim first (for queueless brokers/dispatch) + receiver = receive_shim.create_receiver(receiver_addr, receive_queue_name, test_type, '0') + receiver.start() + + # Start the send shim + sender = send_shim.create_sender(sender_addr, send_queue_name, test_type, dumps([None])) + sender.start() + + # Wait for both shims to finish + sender.join_or_kill(qpid_interop_test.shims.THREAD_TIMEOUT) + receiver.join_or_kill(qpid_interop_test.shims.THREAD_TIMEOUT) + + if test_type == 'connection_property': + self.check_connection_property_test_results(sender.get_return_object(), receiver.get_return_object()) + + def check_connection_property_test_results(self, sender_return_obj, receiver_return_obj): + """Check received connection property for pass/fail of test""" + self.check_connection_properties(sender_return_obj[1], 'sender') + self.check_connection_properties(receiver_return_obj[1], 'receiver') + + def check_connection_properties(self, connection_properties, source): + """Check an individual connection property for pass/fail""" + keys = connection_properties.keys() + if 'product' not in keys: + self.fail('Broker connection properties (from %s) missing "product" key' % source) + if 'version' not in keys: + self.fail('Broker connection properties (from %s) missing "version" key' % source) + for key in keys: + self.assertTrue(len(connection_properties[key]) > 0, msg='Property "%s" (from %s) is empty' % (key, source)) + + +def create_connection_property_test_class(send_shim, receive_shim): + """ + Class factory function which creates new subclasses to AmqpFeaturesTestCase. + """ + + def __repr__(self): + """Print the class name""" + return self.__class__.__name__ + + def add_test_method(cls, send_shim, receive_shim): + """Function which creates a new test method in class cls""" + + def inner_test_method(self): + self.run_test(self.sender_addr, self.receiver_addr, 'connection_property', send_shim, receive_shim) + + inner_test_method.__name__ = 'test_connection_properties_%s->%s' % (send_shim.NAME, receive_shim.NAME) + setattr(cls, inner_test_method.__name__, inner_test_method) + + class_name = 'ConnectionPropertyTestCase' + class_dict = {'__name__': class_name, + '__repr__': __repr__, + '__doc__': 'Test case for AMQP connection properties', + 'sender_addr': ARGS.sender, + 'receiver_addr': ARGS.receiver} + new_class = type(class_name, (AmqpFeaturesTestCase,), class_dict) + add_test_method(new_class, send_shim, receive_shim) + return new_class + +# SHIM_MAP contains an instance of each client language shim that is to be tested as a part of this test. For +# every shim in this list, a test is dynamically constructed which tests it against itself as well as every +# 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', 'build', 'amqp_features_test', + 'Receiver') +PROTON_CPP_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-cpp', 'build', 'amqp_features_test', + 'Sender') +PROTON_PYTHON_RECEIVER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python', 'src', + 'amqp_features_test', 'Receiver.py') +PROTON_PYTHON_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python', 'src', + 'amqp_features_test', 'Sender.py') + +SHIM_MAP = {#qpid_interop_test.shims.ProtonCppShim.NAME: \ + # qpid_interop_test.shims.ProtonCppShim(PROTON_CPP_SENDER_SHIM, PROTON_CPP_RECEIVER_SHIM), + qpid_interop_test.shims.ProtonPythonShim.NAME: \ + qpid_interop_test.shims.ProtonPythonShim(PROTON_PYTHON_SENDER_SHIM, PROTON_PYTHON_RECEIVER_SHIM), + } + + +class TestOptions(object): + """ + Class controlling command-line arguments used to control the test. + """ + def __init__(self): + parser = argparse.ArgumentParser(description='Qpid-interop AMQP client interoparability test suite ' + 'for AMQP messaging features') + parser.add_argument('--sender', action='store', default='localhost:5672', metavar='IP-ADDR:PORT', + 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', + help='Name of shim to exclude. Supported shims:\n%s' % sorted(SHIM_MAP.keys())) + self.args = parser.parse_args() + + +#--- Main program start --- + +if __name__ == '__main__': + + ARGS = TestOptions().args + #print 'ARGS:', ARGS # debug + + # Connect to broker to find broker type + CONNECTION_PROPS = qpid_interop_test.broker_properties.get_broker_properties(ARGS.sender) + if CONNECTION_PROPS is None: + print 'WARNING: Unable to get connection properties - unknown broker' + BROKER = 'unknown' + else: + BROKER = CONNECTION_PROPS[symbol(u'product')] if symbol(u'product') in CONNECTION_PROPS \ + else '<product not found>' + BROKER_VERSION = CONNECTION_PROPS[symbol(u'version')] if symbol(u'version') in CONNECTION_PROPS \ + else '<version not found>' + BROKER_PLATFORM = CONNECTION_PROPS[symbol(u'platform')] if symbol(u'platform') in CONNECTION_PROPS \ + else '<platform not found>' + print 'Test Broker: %s v.%s on %s' % (BROKER, BROKER_VERSION, BROKER_PLATFORM) + print + sys.stdout.flush() + + # TEST_CASE_CLASSES is a list that collects all the test classes that are constructed. One class is constructed + # per AMQP type used as the key in map AmqpPrimitiveTypes.TYPE_MAP. + TEST_CASE_CLASSES = [] + + # TEST_SUITE is the final suite of tests that will be run and which contains all the dynamically created + # type classes, each of which contains a test for the combinations of client shims + TEST_SUITE = unittest.TestSuite() + + # Remove shims excluded from the command-line + if ARGS.exclude_shim is not None: + for shim in ARGS.exclude_shim: + SHIM_MAP.pop(shim) + # Create test classes dynamically + for shim_name in SHIM_MAP.keys(): + test_case_class = create_connection_property_test_class(SHIM_MAP[shim_name], SHIM_MAP[shim_name]) + TEST_SUITE.addTest(unittest.makeSuite(test_case_class)) + + # Finally, run all the dynamically created tests + RES = unittest.TextTestRunner(verbosity=2).run(TEST_SUITE) + if not RES.wasSuccessful(): + sys.exit(1) # Errors or failures present http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/0e153797/src/python/not_yet_impl/jms_dtx_test.py ---------------------------------------------------------------------- diff --git a/src/python/not_yet_impl/jms_dtx_test.py b/src/python/not_yet_impl/jms_dtx_test.py new file mode 100644 index 0000000..fd998a7 --- /dev/null +++ b/src/python/not_yet_impl/jms_dtx_test.py @@ -0,0 +1,146 @@ +#!/usr/bin/env python + +""" +Module to test JMS distributed transactions (DTX) across different JMS clients +""" + +# +# 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. +# + +import argparse +import sys +import unittest + +#from itertools import product +#from json import dumps +from os import getenv, path + +from proton import symbol +#import qpid_interop_test.broker_properties +import qpid_interop_test.shims +#from qpid_interop_test.test_type_map import TestTypeMap + + +# TODO: propose a sensible default when installation details are worked out +QPID_INTEROP_TEST_HOME = getenv('QPID_INTEROP_TEST_HOME') +if QPID_INTEROP_TEST_HOME is None: + print 'ERROR: Environment variable QPID_INTEROP_TEST_HOME is not set' + sys.exit(1) +MAVEN_REPO_PATH = getenv('MAVEN_REPO_PATH', path.join(getenv('HOME'), '.m2', 'repository')) + + + +class JmsDtxTypeTestCase(unittest.TestCase): + """ + Abstract base class for JMS DTX test cases + """ + + def run_test(self, broker_addr, jms_message_type, test_values, send_shim, receive_shim): + """ + Run this test by invoking the shim send method to send the test values, followed by the shim receive method + to receive the values. Finally, compare the sent values with the received values. + """ + pass + + +PROTON_CPP_RECEIVER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-cpp', 'build', + 'jms_dtx_test', 'Receiver') +PROTON_CPP_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-cpp', 'build', + 'jms_dtx_test', 'Sender') +PROTON_PYTHON_RECEIVER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python', 'src', + 'jms_dtx_test', 'Receiver.py') +PROTON_PYTHON_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python', 'src', + 'jms_dtx_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() +QPID_JMS_RECEIVER_SHIM = 'org.apache.qpid.interop_test.jms_dtx_test.Receiver' +QPID_JMS_SENDER_SHIM = 'org.apache.qpid.interop_test.jms_dtx_test.Sender' + +# SHIM_MAP contains an instance of each client language shim that is to be tested as a part of this test. For +# every shim in this list, a test is dynamically constructed which tests it against itself as well as every +# other shim in the list. +# +# As new shims are added, add them into this map to have them included in the test cases. +SHIM_MAP = {qpid_interop_test.shims.ProtonCppShim.NAME: \ + qpid_interop_test.shims.ProtonCppShim(PROTON_CPP_SENDER_SHIM, PROTON_CPP_RECEIVER_SHIM), + qpid_interop_test.shims.ProtonPythonShim.NAME: \ + qpid_interop_test.shims.ProtonPythonShim(PROTON_PYTHON_SENDER_SHIM, PROTON_PYTHON_RECEIVER_SHIM), + qpid_interop_test.shims.QpidJmsShim.NAME: \ + qpid_interop_test.shims.QpidJmsShim(QIT_JMS_CLASSPATH, QPID_JMS_SENDER_SHIM, QPID_JMS_RECEIVER_SHIM), + } + +# TODO: Complete the test options to give fine control over running tests +class TestOptions(object): + """ + Class controlling command-line arguments used to control the test. + """ + def __init__(self,): + parser = argparse.ArgumentParser(description='Qpid-interop AMQP client interoparability test suite ' + 'for JMS distrubuted (dtx) transactions') + parser.add_argument('--sender', action='store', default='localhost:5672', metavar='IP-ADDR:PORT', + 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', + help='Name of shim to exclude. Supported shims:\n%s' % sorted(SHIM_MAP.keys())) + self.args = parser.parse_args() + + +#--- Main program start --- + +if __name__ == '__main__': + + ARGS = TestOptions().args + #print 'ARGS:', ARGS # debug + + # Connect to broker to find broker type + CONNECTION_PROPS = qpid_interop_test.broker_properties.get_broker_properties(ARGS.sender) + if CONNECTION_PROPS is None: + print 'WARNING: Unable to get connection properties - unknown broker' + BROKER = 'unknown' + else: + BROKER = CONNECTION_PROPS[symbol(u'product')] if symbol(u'product') in CONNECTION_PROPS \ + else '<product not found>' + BROKER_VERSION = CONNECTION_PROPS[symbol(u'version')] if symbol(u'version') in CONNECTION_PROPS \ + else '<version not found>' + BROKER_PLATFORM = CONNECTION_PROPS[symbol(u'platform')] if symbol(u'platform') in CONNECTION_PROPS \ + else '<platform not found>' + print 'Test Broker: %s v.%s on %s' % (BROKER, BROKER_VERSION, BROKER_PLATFORM) + print + sys.stdout.flush() + + # TEST_CASE_CLASSES is a list that collects all the test classes that are constructed. One class is constructed + # per AMQP type used as the key in map JmsMessageTypes.TYPE_MAP. + TEST_CASE_CLASSES = [] + + # TEST_SUITE is the final suite of tests that will be run and which contains all the dynamically created + # type classes, each of which contains a test for the combinations of client shims + TEST_SUITE = unittest.TestSuite() + + # Remove shims excluded from the command-line + if ARGS.exclude_shim is not None: + for shim in ARGS.exclude_shim: + SHIM_MAP.pop(shim) + # Create test classes dynamically + + # Finally, run all the dynamically created tests + RES = unittest.TextTestRunner(verbosity=2).run(TEST_SUITE) + if not RES.wasSuccessful(): + sys.exit(1) http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/0e153797/src/python/not_yet_impl/jms_large_content_test.py ---------------------------------------------------------------------- diff --git a/src/python/not_yet_impl/jms_large_content_test.py b/src/python/not_yet_impl/jms_large_content_test.py new file mode 100644 index 0000000..6387060 --- /dev/null +++ b/src/python/not_yet_impl/jms_large_content_test.py @@ -0,0 +1,144 @@ +#!/usr/bin/env python + +""" +Module to test JMS messages containing large content (either message bodies or properties) across different JMS clients +""" + +# +# 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. +# + +import argparse +import sys +import unittest + +#from itertools import product +#from json import dumps +from os import getenv, path + +from proton import symbol +#import qpid_interop_test.broker_properties +import qpid_interop_test.shims +#from qpid_interop_test.test_type_map import TestTypeMap + + +# TODO: propose a sensible default when installation details are worked out +QPID_INTEROP_TEST_HOME = getenv('QPID_INTEROP_TEST_HOME') +if QPID_INTEROP_TEST_HOME is None: + print 'ERROR: Environment variable QPID_INTEROP_TEST_HOME is not set' + sys.exit(1) +MAVEN_REPO_PATH = getenv('MAVEN_REPO_PATH', path.join(getenv('HOME'), '.m2', 'repository')) + + + +class JmsLargeContentTypeTestCase(unittest.TestCase): + """ + Abstract base class for JMS large content test cases + """ + + def run_test(self, broker_addr, jms_message_type, test_values, send_shim, receive_shim): + """ + Run this test by invoking the shim send method to send the test values, followed by the shim receive method + to receive the values. Finally, compare the sent values with the received values. + """ + pass + + +PROTON_CPP_RECEIVER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-cpp', 'build', + 'jms_large_content_test', 'Receiver') +PROTON_CPP_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-cpp', 'build', + 'jms_large_content_test', 'Sender') +PROTON_PYTHON_RECEIVER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python', 'src', + 'jms_large_content_test', 'Receiver.py') +PROTON_PYTHON_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python', 'src', + 'jms_large_content_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() +QPID_JMS_RECEIVER_SHIM = 'org.apache.qpid.interop_test.jms_large_content_test.Receiver' +QPID_JMS_SENDER_SHIM = 'org.apache.qpid.interop_test.jms_large_content_test.Sender' + +# SHIM_MAP contains an instance of each client language shim that is to be tested as a part of this test. For +# every shim in this list, a test is dynamically constructed which tests it against itself as well as every +# other shim in the list. +# +# As new shims are added, add them into this map to have them included in the test cases. +SHIM_MAP = {qpid_interop_test.shims.ProtonCppShim.NAME: \ + qpid_interop_test.shims.ProtonCppShim(PROTON_CPP_SENDER_SHIM, PROTON_CPP_RECEIVER_SHIM), + qpid_interop_test.shims.ProtonPythonShim.NAME: \ + qpid_interop_test.shims.ProtonPythonShim(PROTON_PYTHON_SENDER_SHIM, PROTON_PYTHON_RECEIVER_SHIM), + qpid_interop_test.shims.QpidJmsShim.NAME: \ + qpid_interop_test.shims.QpidJmsShim(QIT_JMS_CLASSPATH, QPID_JMS_SENDER_SHIM, QPID_JMS_RECEIVER_SHIM), + } + +# TODO: Complete the test options to give fine control over running tests +class TestOptions(object): + """ + Class controlling command-line arguments used to control the test. + """ + def __init__(self,): + parser = argparse.ArgumentParser(description='Qpid-interop AMQP client interoparability test suite ' + 'for JMS messages containing large content') + parser.add_argument('--broker', action='store', default='localhost:5672', metavar='BROKER:PORT', + help='Broker against which to run test suite.') + parser.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() + + +#--- Main program start --- + +if __name__ == '__main__': + + ARGS = TestOptions().args + #print 'ARGS:', ARGS # debug + + # Connect to broker to find broker type + CONNECTION_PROPS = qpid_interop_test.broker_properties.get_broker_properties(ARGS.broker) + if CONNECTION_PROPS is None: + print 'WARNING: Unable to get connection properties - unknown broker' + BROKER = 'unknown' + else: + BROKER = CONNECTION_PROPS[symbol(u'product')] if symbol(u'product') in CONNECTION_PROPS \ + else '<product not found>' + BROKER_VERSION = CONNECTION_PROPS[symbol(u'version')] if symbol(u'version') in CONNECTION_PROPS \ + else '<version not found>' + BROKER_PLATFORM = CONNECTION_PROPS[symbol(u'platform')] if symbol(u'platform') in CONNECTION_PROPS \ + else '<platform not found>' + print 'Test Broker: %s v.%s on %s' % (BROKER, BROKER_VERSION, BROKER_PLATFORM) + print + sys.stdout.flush() + + # TEST_CASE_CLASSES is a list that collects all the test classes that are constructed. One class is constructed + # per AMQP type used as the key in map JmsMessageTypes.TYPE_MAP. + TEST_CASE_CLASSES = [] + + # TEST_SUITE is the final suite of tests that will be run and which contains all the dynamically created + # type classes, each of which contains a test for the combinations of client shims + TEST_SUITE = unittest.TestSuite() + + # Remove shims excluded from the command-line + if ARGS.exclude_shim is not None: + for shim in ARGS.exclude_shim: + SHIM_MAP.pop(shim) + # Create test classes dynamically + + # Finally, run all the dynamically created tests + RES = unittest.TextTestRunner(verbosity=2).run(TEST_SUITE) + if not RES.wasSuccessful(): + sys.exit(1) http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/0e153797/src/python/qpid_interop_test/amqp_dtx_test.py ---------------------------------------------------------------------- diff --git a/src/python/qpid_interop_test/amqp_dtx_test.py b/src/python/qpid_interop_test/amqp_dtx_test.py deleted file mode 100755 index 7e4a644..0000000 --- a/src/python/qpid_interop_test/amqp_dtx_test.py +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/env python - -""" -Module to test AMQP distributed transactions across different clients -""" - -# -# 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. -# - -import argparse -import sys -import unittest - -#from itertools import product -#from json import dumps -from os import getenv, path -#from time import mktime, time -#from uuid import UUID, uuid4 - -from proton import symbol -#import qpid_interop_test.broker_properties -import qpid_interop_test.shims -#from qpid_interop_test.test_type_map import TestTypeMap - -# TODO: propose a sensible default when installation details are worked out -QPID_INTEROP_TEST_HOME = getenv('QPID_INTEROP_TEST_HOME') -if QPID_INTEROP_TEST_HOME is None: - print 'ERROR: Environment variable QPID_INTEROP_TEST_HOME is not set' - sys.exit(1) - - -class AmqpDtxTestCase(unittest.TestCase): - """ - Abstract base class for AMQP distributed transactions (DTX) test cases - """ - - def run_test(self): - """ - Run this test by invoking the shim send method to send the test values, followed by the shim receive method - to receive the values. Finally, compare the sent values with the received values. - """ - pass - - -# SHIM_MAP contains an instance of each client language shim that is to be tested as a part of this test. For -# every shim in this list, a test is dynamically constructed which tests it against itself as well as every -# 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', 'build', 'amqp_dtx_test', - 'Receiver') -PROTON_CPP_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-cpp', 'build', 'amqp_dtx_test', - 'Sender') -PROTON_PYTHON_RECEIVER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python', 'src', 'amqp_dtx_test', - 'Receiver.py') -PROTON_PYTHON_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python', 'src', 'amqp_dtx_test', - 'Sender.py') - -SHIM_MAP = {qpid_interop_test.shims.ProtonCppShim.NAME: \ - qpid_interop_test.shims.ProtonCppShim(PROTON_CPP_SENDER_SHIM, PROTON_CPP_RECEIVER_SHIM), - qpid_interop_test.shims.ProtonPythonShim.NAME: \ - qpid_interop_test.shims.ProtonPythonShim(PROTON_PYTHON_SENDER_SHIM, PROTON_PYTHON_RECEIVER_SHIM), - } - - -class TestOptions(object): - """ - Class controlling command-line arguments used to control the test. - """ - def __init__(self): - parser = argparse.ArgumentParser(description='Qpid-interop AMQP client interoparability test suite ' - 'for AMQP distrubuted (dtx) transactions') - parser.add_argument('--broker', action='store', default='localhost:5672', metavar='BROKER:PORT', - help='Broker against which to run test suite.') - parser.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() - - -#--- Main program start --- - -if __name__ == '__main__': - - ARGS = TestOptions().args - #print 'ARGS:', ARGS # debug - - # Connect to broker to find broker type - CONNECTION_PROPS = qpid_interop_test.broker_properties.get_broker_properties(ARGS.sender) - if CONNECTION_PROPS is None: - print 'WARNING: Unable to get connection properties - unknown broker' - BROKER = 'unknown' - else: - BROKER = CONNECTION_PROPS[symbol(u'product')] if symbol(u'product') in CONNECTION_PROPS \ - else '<product not found>' - BROKER_VERSION = CONNECTION_PROPS[symbol(u'version')] if symbol(u'version') in CONNECTION_PROPS \ - else '<version not found>' - BROKER_PLATFORM = CONNECTION_PROPS[symbol(u'platform')] if symbol(u'platform') in CONNECTION_PROPS \ - else '<platform not found>' - print 'Test Broker: %s v.%s on %s' % (BROKER, BROKER_VERSION, BROKER_PLATFORM) - print - sys.stdout.flush() - - # TEST_CASE_CLASSES is a list that collects all the test classes that are constructed. One class is constructed - # per AMQP type used as the key in map AmqpPrimitiveTypes.TYPE_MAP. - TEST_CASE_CLASSES = [] - - # TEST_SUITE is the final suite of tests that will be run and which contains all the dynamically created - # type classes, each of which contains a test for the combinations of client shims - TEST_SUITE = unittest.TestSuite() - - # Remove shims excluded from the command-line - if ARGS.exclude_shim is not None: - for shim in ARGS.exclude_shim: - SHIM_MAP.pop(shim) - # Create test classes dynamically - - # Finally, run all the dynamically created tests - RES = unittest.TextTestRunner(verbosity=2).run(TEST_SUITE) - if not RES.wasSuccessful(): - sys.exit(1) # Errors or failures present http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/0e153797/src/python/qpid_interop_test/amqp_features_test.py ---------------------------------------------------------------------- diff --git a/src/python/qpid_interop_test/amqp_features_test.py b/src/python/qpid_interop_test/amqp_features_test.py deleted file mode 100755 index 83f140f..0000000 --- a/src/python/qpid_interop_test/amqp_features_test.py +++ /dev/null @@ -1,195 +0,0 @@ -#!/usr/bin/env python - -""" -Module to test AMQP features across different clients -""" - -# -# 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. -# - -import argparse -import sys -import unittest - -from json import dumps -from os import getenv, path - -from proton import symbol -import qpid_interop_test.shims - -# TODO: propose a sensible default when installation details are worked out -QPID_INTEROP_TEST_HOME = getenv('QPID_INTEROP_TEST_HOME') -if QPID_INTEROP_TEST_HOME is None: - print 'ERROR: Environment variable QPID_INTEROP_TEST_HOME is not set' - sys.exit(1) - - -class AmqpFeaturesTestCase(unittest.TestCase): - """ - Abstract base class for AMQP message features test cases - """ - - def run_test(self, sender_addr, receiver_addr, test_type, send_shim, receive_shim): - """ - Run this test by invoking the shim send method to send the test values, followed by the shim receive method - to receive the values. Finally, compare the sent values with the received values. - """ - send_queue_name = 'jms.queue.qpid-interop.amqp_features_test.%s' % send_shim.NAME - receive_queue_name = 'jms.queue.qpid-interop.amqp_features_test.%s' % receive_shim.NAME - - # Start the receive shim first (for queueless brokers/dispatch) - receiver = receive_shim.create_receiver(receiver_addr, receive_queue_name, test_type, '0') - receiver.start() - - # Start the send shim - sender = send_shim.create_sender(sender_addr, send_queue_name, test_type, dumps([None])) - sender.start() - - # Wait for both shims to finish - sender.join_or_kill(qpid_interop_test.shims.THREAD_TIMEOUT) - receiver.join_or_kill(qpid_interop_test.shims.THREAD_TIMEOUT) - - if test_type == 'connection_property': - self.check_connection_property_test_results(sender.get_return_object(), receiver.get_return_object()) - - def check_connection_property_test_results(self, sender_return_obj, receiver_return_obj): - """Check received connection property for pass/fail of test""" - self.check_connection_properties(sender_return_obj[1], 'sender') - self.check_connection_properties(receiver_return_obj[1], 'receiver') - - def check_connection_properties(self, connection_properties, source): - """Check an individual connection property for pass/fail""" - keys = connection_properties.keys() - if 'product' not in keys: - self.fail('Broker connection properties (from %s) missing "product" key' % source) - if 'version' not in keys: - self.fail('Broker connection properties (from %s) missing "version" key' % source) - for key in keys: - self.assertTrue(len(connection_properties[key]) > 0, msg='Property "%s" (from %s) is empty' % (key, source)) - - -def create_connection_property_test_class(send_shim, receive_shim): - """ - Class factory function which creates new subclasses to AmqpFeaturesTestCase. - """ - - def __repr__(self): - """Print the class name""" - return self.__class__.__name__ - - def add_test_method(cls, send_shim, receive_shim): - """Function which creates a new test method in class cls""" - - def inner_test_method(self): - self.run_test(self.sender_addr, self.receiver_addr, 'connection_property', send_shim, receive_shim) - - inner_test_method.__name__ = 'test_connection_properties_%s->%s' % (send_shim.NAME, receive_shim.NAME) - setattr(cls, inner_test_method.__name__, inner_test_method) - - class_name = 'ConnectionPropertyTestCase' - class_dict = {'__name__': class_name, - '__repr__': __repr__, - '__doc__': 'Test case for AMQP connection properties', - 'sender_addr': ARGS.sender, - 'receiver_addr': ARGS.receiver} - new_class = type(class_name, (AmqpFeaturesTestCase,), class_dict) - add_test_method(new_class, send_shim, receive_shim) - return new_class - -# SHIM_MAP contains an instance of each client language shim that is to be tested as a part of this test. For -# every shim in this list, a test is dynamically constructed which tests it against itself as well as every -# 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', 'build', 'amqp_features_test', - 'Receiver') -PROTON_CPP_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-cpp', 'build', 'amqp_features_test', - 'Sender') -PROTON_PYTHON_RECEIVER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python', 'src', - 'amqp_features_test', 'Receiver.py') -PROTON_PYTHON_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python', 'src', - 'amqp_features_test', 'Sender.py') - -SHIM_MAP = {#qpid_interop_test.shims.ProtonCppShim.NAME: \ - # qpid_interop_test.shims.ProtonCppShim(PROTON_CPP_SENDER_SHIM, PROTON_CPP_RECEIVER_SHIM), - qpid_interop_test.shims.ProtonPythonShim.NAME: \ - qpid_interop_test.shims.ProtonPythonShim(PROTON_PYTHON_SENDER_SHIM, PROTON_PYTHON_RECEIVER_SHIM), - } - - -class TestOptions(object): - """ - Class controlling command-line arguments used to control the test. - """ - def __init__(self): - parser = argparse.ArgumentParser(description='Qpid-interop AMQP client interoparability test suite ' - 'for AMQP messaging features') - parser.add_argument('--sender', action='store', default='localhost:5672', metavar='IP-ADDR:PORT', - 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', - help='Name of shim to exclude. Supported shims:\n%s' % sorted(SHIM_MAP.keys())) - self.args = parser.parse_args() - - -#--- Main program start --- - -if __name__ == '__main__': - - ARGS = TestOptions().args - #print 'ARGS:', ARGS # debug - - # Connect to broker to find broker type - CONNECTION_PROPS = qpid_interop_test.broker_properties.get_broker_properties(ARGS.sender) - if CONNECTION_PROPS is None: - print 'WARNING: Unable to get connection properties - unknown broker' - BROKER = 'unknown' - else: - BROKER = CONNECTION_PROPS[symbol(u'product')] if symbol(u'product') in CONNECTION_PROPS \ - else '<product not found>' - BROKER_VERSION = CONNECTION_PROPS[symbol(u'version')] if symbol(u'version') in CONNECTION_PROPS \ - else '<version not found>' - BROKER_PLATFORM = CONNECTION_PROPS[symbol(u'platform')] if symbol(u'platform') in CONNECTION_PROPS \ - else '<platform not found>' - print 'Test Broker: %s v.%s on %s' % (BROKER, BROKER_VERSION, BROKER_PLATFORM) - print - sys.stdout.flush() - - # TEST_CASE_CLASSES is a list that collects all the test classes that are constructed. One class is constructed - # per AMQP type used as the key in map AmqpPrimitiveTypes.TYPE_MAP. - TEST_CASE_CLASSES = [] - - # TEST_SUITE is the final suite of tests that will be run and which contains all the dynamically created - # type classes, each of which contains a test for the combinations of client shims - TEST_SUITE = unittest.TestSuite() - - # Remove shims excluded from the command-line - if ARGS.exclude_shim is not None: - for shim in ARGS.exclude_shim: - SHIM_MAP.pop(shim) - # Create test classes dynamically - for shim_name in SHIM_MAP.keys(): - test_case_class = create_connection_property_test_class(SHIM_MAP[shim_name], SHIM_MAP[shim_name]) - TEST_SUITE.addTest(unittest.makeSuite(test_case_class)) - - # Finally, run all the dynamically created tests - RES = unittest.TextTestRunner(verbosity=2).run(TEST_SUITE) - if not RES.wasSuccessful(): - sys.exit(1) # Errors or failures present http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/0e153797/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 7130203..67a3990 100755 --- a/src/python/qpid_interop_test/amqp_large_content_test.py +++ b/src/python/qpid_interop_test/amqp_large_content_test.py @@ -177,14 +177,10 @@ 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', 'build', - 'amqp_large_content_test', 'Receiver') -PROTON_CPP_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-cpp', 'build', - 'amqp_large_content_test', 'Sender') -PROTON_PYTHON_RECEIVER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python', 'src', - 'amqp_large_content_test', 'Receiver.py') -PROTON_PYTHON_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python', 'src', - '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), http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/0e153797/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 600b3fc..0f339e4 100755 --- a/src/python/qpid_interop_test/amqp_types_test.py +++ b/src/python/qpid_interop_test/amqp_types_test.py @@ -403,18 +403,12 @@ 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', 'build', 'amqp_types_test', - 'Receiver') -PROTON_CPP_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-cpp', 'build', 'amqp_types_test', - 'Sender') -PROTON_PYTHON_RECEIVER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python', 'src', 'amqp_types_test', - 'Receiver.py') -PROTON_PYTHON_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python', 'src', '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), @@ -464,6 +458,7 @@ if __name__ == '__main__': #print 'ARGS:', ARGS # debug # Connect to broker to find broker type + # TODO: Find out why this uses auth CONNECTION_PROPS = qpid_interop_test.broker_properties.get_broker_properties(ARGS.sender) if CONNECTION_PROPS is None: print 'WARNING: Unable to get connection properties - unknown broker' http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/0e153797/src/python/qpid_interop_test/jms_dtx_test.py ---------------------------------------------------------------------- diff --git a/src/python/qpid_interop_test/jms_dtx_test.py b/src/python/qpid_interop_test/jms_dtx_test.py deleted file mode 100755 index fd998a7..0000000 --- a/src/python/qpid_interop_test/jms_dtx_test.py +++ /dev/null @@ -1,146 +0,0 @@ -#!/usr/bin/env python - -""" -Module to test JMS distributed transactions (DTX) across different JMS clients -""" - -# -# 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. -# - -import argparse -import sys -import unittest - -#from itertools import product -#from json import dumps -from os import getenv, path - -from proton import symbol -#import qpid_interop_test.broker_properties -import qpid_interop_test.shims -#from qpid_interop_test.test_type_map import TestTypeMap - - -# TODO: propose a sensible default when installation details are worked out -QPID_INTEROP_TEST_HOME = getenv('QPID_INTEROP_TEST_HOME') -if QPID_INTEROP_TEST_HOME is None: - print 'ERROR: Environment variable QPID_INTEROP_TEST_HOME is not set' - sys.exit(1) -MAVEN_REPO_PATH = getenv('MAVEN_REPO_PATH', path.join(getenv('HOME'), '.m2', 'repository')) - - - -class JmsDtxTypeTestCase(unittest.TestCase): - """ - Abstract base class for JMS DTX test cases - """ - - def run_test(self, broker_addr, jms_message_type, test_values, send_shim, receive_shim): - """ - Run this test by invoking the shim send method to send the test values, followed by the shim receive method - to receive the values. Finally, compare the sent values with the received values. - """ - pass - - -PROTON_CPP_RECEIVER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-cpp', 'build', - 'jms_dtx_test', 'Receiver') -PROTON_CPP_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-cpp', 'build', - 'jms_dtx_test', 'Sender') -PROTON_PYTHON_RECEIVER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python', 'src', - 'jms_dtx_test', 'Receiver.py') -PROTON_PYTHON_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python', 'src', - 'jms_dtx_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() -QPID_JMS_RECEIVER_SHIM = 'org.apache.qpid.interop_test.jms_dtx_test.Receiver' -QPID_JMS_SENDER_SHIM = 'org.apache.qpid.interop_test.jms_dtx_test.Sender' - -# SHIM_MAP contains an instance of each client language shim that is to be tested as a part of this test. For -# every shim in this list, a test is dynamically constructed which tests it against itself as well as every -# other shim in the list. -# -# As new shims are added, add them into this map to have them included in the test cases. -SHIM_MAP = {qpid_interop_test.shims.ProtonCppShim.NAME: \ - qpid_interop_test.shims.ProtonCppShim(PROTON_CPP_SENDER_SHIM, PROTON_CPP_RECEIVER_SHIM), - qpid_interop_test.shims.ProtonPythonShim.NAME: \ - qpid_interop_test.shims.ProtonPythonShim(PROTON_PYTHON_SENDER_SHIM, PROTON_PYTHON_RECEIVER_SHIM), - qpid_interop_test.shims.QpidJmsShim.NAME: \ - qpid_interop_test.shims.QpidJmsShim(QIT_JMS_CLASSPATH, QPID_JMS_SENDER_SHIM, QPID_JMS_RECEIVER_SHIM), - } - -# TODO: Complete the test options to give fine control over running tests -class TestOptions(object): - """ - Class controlling command-line arguments used to control the test. - """ - def __init__(self,): - parser = argparse.ArgumentParser(description='Qpid-interop AMQP client interoparability test suite ' - 'for JMS distrubuted (dtx) transactions') - parser.add_argument('--sender', action='store', default='localhost:5672', metavar='IP-ADDR:PORT', - 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', - help='Name of shim to exclude. Supported shims:\n%s' % sorted(SHIM_MAP.keys())) - self.args = parser.parse_args() - - -#--- Main program start --- - -if __name__ == '__main__': - - ARGS = TestOptions().args - #print 'ARGS:', ARGS # debug - - # Connect to broker to find broker type - CONNECTION_PROPS = qpid_interop_test.broker_properties.get_broker_properties(ARGS.sender) - if CONNECTION_PROPS is None: - print 'WARNING: Unable to get connection properties - unknown broker' - BROKER = 'unknown' - else: - BROKER = CONNECTION_PROPS[symbol(u'product')] if symbol(u'product') in CONNECTION_PROPS \ - else '<product not found>' - BROKER_VERSION = CONNECTION_PROPS[symbol(u'version')] if symbol(u'version') in CONNECTION_PROPS \ - else '<version not found>' - BROKER_PLATFORM = CONNECTION_PROPS[symbol(u'platform')] if symbol(u'platform') in CONNECTION_PROPS \ - else '<platform not found>' - print 'Test Broker: %s v.%s on %s' % (BROKER, BROKER_VERSION, BROKER_PLATFORM) - print - sys.stdout.flush() - - # TEST_CASE_CLASSES is a list that collects all the test classes that are constructed. One class is constructed - # per AMQP type used as the key in map JmsMessageTypes.TYPE_MAP. - TEST_CASE_CLASSES = [] - - # TEST_SUITE is the final suite of tests that will be run and which contains all the dynamically created - # type classes, each of which contains a test for the combinations of client shims - TEST_SUITE = unittest.TestSuite() - - # Remove shims excluded from the command-line - if ARGS.exclude_shim is not None: - for shim in ARGS.exclude_shim: - SHIM_MAP.pop(shim) - # Create test classes dynamically - - # Finally, run all the dynamically created tests - RES = unittest.TextTestRunner(verbosity=2).run(TEST_SUITE) - if not RES.wasSuccessful(): - sys.exit(1) http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/0e153797/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 4c001ca..d0d77ac 100755 --- a/src/python/qpid_interop_test/jms_hdrs_props_test.py +++ b/src/python/qpid_interop_test/jms_hdrs_props_test.py @@ -585,14 +585,10 @@ 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', 'build', 'jms_hdrs_props_test', - 'Receiver') -PROTON_CPP_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-cpp', 'build', 'jms_hdrs_props_test', - 'Sender') -PROTON_PYTHON_RECEIVER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python', 'src', - 'jms_hdrs_props_test', 'Receiver.py') -PROTON_PYTHON_SENDER_SHIM = path.join(QPID_INTEROP_TEST_HOME, 'shims', 'qpid-proton-python', 'src', - '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() --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
