Introduction to the QorusInterfaceTest Module
The QorusInterfaceTest module provides functionality for automatic testing; it is based on the QUnit module from Qore.
Currently the module provides the following test classes:
- QorusInterfaceTest: extension of the Qore QUnit module with functions testing Qorus-specific interfaces (abstract class)
- QorusJobTest: base class for testing jobs
- QorusPassiveWorkflowTest: class for testing workflows without starting execution instances (for example, for testing synchronous workflow orders, etc)
- QorusServiceTest: base class for testing services
- QorusWorkflowTest: base class for testing workflows, will automatically start execution instances if not already running
- Action: abstract class representing some action
Additionally, the following helper class is provided:
To use this module, use "%requires QorusInterfaceTest"
in your code.
Examples:
class MyJobTest inherits QorusJobTest {
constructor() : QorusJobTest("my-job", "1.0", \ARGV) {
addTestCase("my-test-1, \test1());
}
test1() {
exec(new CreateFileText(input_filename, file_content));
exec(new RunJobResult(OMQ::StatComplete));
}
}
How to run tests
Make sure your scripts have the executable bit set (on UNIX systems) and an appropriate hash-bang as the first line (ex: "#!/usr/bin/env qr"
or "#!/usr/bin/env qore"
.
If your script's name is test.qtest
, then The following command should execute the script:
test.qtest [OPTIONS]
See QorusInterfaceTest module in Qore for options, output formats and further details.
Release Notes
Version 5.1
- aligned version number with Qorus
- added constructors useful for Java and Python
Version 1.1
Version 1.0.1
- minor adjustment to FindOrderByKey::run() for an info service key search method fix (a href="https://bugs.qoretechnologies.com/issues/2108">issue 2108)
Version 1.0
- initial version of module