ActiveVOS Designer User’s Guide
Previous | Next
Creating and Running a B-unit Ant Script
If you want to include B-unit testing in an automated build
environment, you can create an Ant script to run all the B-unit
tests and suites from multiple orchestration projects outside of
Designer, on the command line. This capability is similar to using
the command line BPRD script to deploy a BPR archive to the server.
Prerequisite
You must install the B-Unit Ant Runtime component
of the ActiveVOS Designer before you can run the Ant script. The
installation creates a directory containing the runtime files required
to run the B-unit Ant script from the command line, outside of Designer.
You do not need to install Ant separately: the Apache Ant application
is installed as part of ActiveVOS Designer.
Note: Version 1.7.0 of Ant (or above) is
required.
To create a B-unit Ant script:
- Ensure your orchestration project(s)
contains one or more B-unit tests or suites, as described in Creating a BPEL Unit Test File.
- Select one B-unit test or suite and right mouse-click
to select .
- In the Export BUnit Ant Script wizard, select a folder,
such as the test folder, and enter a filename.
Select Next.
- Select the B-unit tests and suites to include. You can
select multiple tests from multiple projects. Also, after you create
the script, you can edit it to add more folders of tests.
- Select the B-unit options as desired:
- . Controls console
logging output for B-unit-specific execution commands.
- . Controls
the amount of process execution data to log. The default is none.
Enabling the checkbox turns on execution level.
If desired, you can manually edit the Ant script to enable execution-data (execution
with data) or full logging.
- Select Finish to generate the filename.ant.xml
file.
The ant script opens in an editor for you to view or edit.
Follow the instructions in the ant script to set the bunit runtime
classpath if you wish to execute this script outside of designer.
Notes on Modifying a B-unit Ant Script
Within the ant script, you can override properties in the
individual B-unit files.
- You can add a file to override the default-bunit-engine
config if needed, such as <config file="engine-configuration.xml"
/>
- Nested element <engineProperties> accepts a file relative
or absolute path to a properties file with engine config path=value
pairs in the format required by java.util.Properties. The file attribute
is optional and instead nested <engineProperty name="…" value="…"/>
elements can be used to set engine properties. If both the file
attribute and the engineProperty elements are used, the elements
will override the values in the properties file if the same config path
is specified twice.
- Examples of multiple engine properties:
- <engineProperty name="Logging" value="urn:ae:execution"
/>
- <engineProperty name="CustomFunctions/MyCustomFunction" value="com.test.my.custom.Function"
Adding Multiple B-unit and B-suite Files to an Ant
Script
Ant provides many ways to specify resource collections, such
as a group of B-unit and B-suite files. One example is the following.
<path>
<fileset dir="${test.dir}" includes="**/*.bunit"/></path>
For examples, refer to the resource collections section
of the Ant 1.7 (or later) documentation.
Running a B-unit Ant script
You can run the filename.ant.xml file from within Designer
if desired. Right-mouse click on the file and select Run As>Ant
Build. In the Console you can view trace and log details.
To run the Ant script on the command line, do the following:
- Open a command window.
- Navigate to the file system folder where the ant script
is located.
- At the command line prompt, type
ant -f filename.ant.xml
Copyright (c) 2004-2010 Active Endpoints, Inc.