On 01/06/2010 06:14 AM, Gordon Sim wrote:
On 01/04/2010 06:41 PM, john dunning wrote:
I'm squiffing up qpid-config to add the ability to configure xml
exchanges and queue bindings. I'm trying to add stuff to the test suite
(cpp/src/tests/cli_tests.py and related) to match.

The difficulty I have right now is that the xml support is optional. If
you didn't configure for xml and load the module when you started the
broker, you don't get xml support, and my test case flames out.

It's not too hard to make the wrapper script (run_cli_tests) sense the
presence of the module and only optionally add the --load-module arg.
Presumably something analogous could be done on windows as well. It's
less clear to me how to make the test code sense that the environment is
sans-xml and DTRT.

Possibilities which come to mind:

1. Trap the error (about xml being unhandled) and ignore it
2. Move the xml test out into a separate module, and only invoke it if
we're configured the right way.
3. Interrogate the broker to ask him if he does xml (is this even
possible?)

Anybody care to express an opinion on the cleanest way to make the test
suite seamlessly accomodate xml support? TIA...

Just a suggestion:

The run_cli_tests script uses the qpid-python-test tool which allows an
ignore file to be specified. So you could detect the availability of the
module and load it if available as you say, and if not available specify
an ignore file that excludes the xml exchange related tests.


Thats true, but I think it is still worth splitting out test sets for optional modules into separate files for the sake of clarity and readability.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscr...@qpid.apache.org

Reply via email to