The BPELUnit command line client allows you to call BPELUnit from the command line. The BPELUnit runner will execute a specified Test Suite Specification, producing either a plain informational message (indicating how many tests passed, failed, and errored) or a more detailed, but still human-readable progress report, depending on the command line options:
bpelunit [-v] [-x=filename] [-l=filename] testsuite.bpts [testcase1] [testcase2] [...]
The command requires the specification of a BPELUnit test suite file, whose default ending is assumed to be .bpts. After the file, test case names may be specified, such that only the specified test cases are run. If none are specified, the complete suite is run. There are three more options:
You must call BPELUnit from the directory of the test suite file if you have relative paths specified in your .bpts file, otherwise these files will not be found.
The BPELUnit ant task allows you to call BPELUnit from inside a build script. The BPELUnit Ant task will execute a specified Test Suite Specification, producing either a plain informational message (indicating how many tests passed, failed, and errored) or a rich XML format which contains all details of the test run and can then be transformed by XLST or processed by other means.
To use the BPELUnit Ant task in your build files, you must first declare the task in your build.xml file:
<typedef name="bpelunit" classname="org.bpelunit.framework.ui.ant.BPELUnit"> <classpath> <fileset dir="${BPELUNIT_HOME}/lib" /> </classpath> </typedef>
As you can see, the typedef contains an internal classpath element, which points to the lib directory of BPELUnit. The task will thus find its libraries, there is no need to have them on the CLASSPATH when starting Ant.
Afer the declaration, you may use the BPELUnit ant task like this:
<bpelunit testsuite="somedir/someSuite.bpts" bpelunitdir="${BPELUNIT_HOME}"> <output style="XML" file="xmloutput.xml" /> <logging level="DEBUG" file="logoutput.txt" /> </bpelunit>
The testsuite and bpelunitdir attributes are required. Inside of the bpelunit task, you may use the following two sub-elements, which may each occur multiple times:
<output style="style" file="file"? />
Each output declaration produces a report of the test run. There are two styles available: XML (meaning a rich XML format which contains all details of the test run) or PLAIN, a simpler human-readable format which does not contain the details. If the file element is not specified, the output is sent to the command line; if it is specified, the output is sent to the specified file.
<logging level="level" file="file"? />
Each logging declaration sends the BPELUnit runtime log to the specified location. You may specify a level of logging (these are log4j levels, see below) and an optional file. If the file element is not specified, the output is sent to the command line.
The possible log levels are:
In most cases, the INFO level should be sufficient.
Configuration of the command line client and Ant task: In order to keep the test suite documents free from platform-specific settings, the registered deployers of BPELUnit may be configured by using the conf/configuration.xml file. In this XML file, each deployer may be parameterized with a number of options.
BPELUnit contains two deployers: The Oracle Deployer and the ActiveBPEL deployer. To configure one of these deployers (or a deployer you have added yourself), create a section for it in the configuration.xml file:
<configuration deployer="oracle"> ... </configuration>
Inside of this block, you can parameterize the deployer with the set of keys it provides, for example:
<property name="OracleDomainPassword">bpel</property>
The options for the Oracle and ActiveBPEL Deployers are as follows:
Oracle | |
OracleDirectory | The absolute file path to the Oracle BPEL server directory. |
OracleDomain | The name of the Oracle Domain to deploy to. |
OracleDomainPassword | The password for the specified domain. |
ActiveBPEL | |
ActiveBPELDeploymentDirectory | The directory of the ActiveBPEL Tomcat installation containing the .bpr files |
ActiveBPELDeploymentServiceURL | The URL to the ActiveBPEL deployment web service. |
The configuration file included in the installation package already contains some defaults for these values.