ActiveVOS Designer User’s Guide

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:

  1. Ensure your orchestration project(s) contains one or more B-unit tests or suites, as described in Creating a BPEL Unit Test File.
  2. Select one B-unit test or suite and right mouse-click to select New>BUnit Ant Script.
  3. In the Export BUnit Ant Script wizard, select a folder, such as the test folder, and enter a filename. Select Next.
  4. 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.
  5. Select the B-unit options as desired:
  6. 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.

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:

  1. Open a command window.
  2. Navigate to the file system folder where the ant script is located.
  3. At the command line prompt, type ant -f filename.ant.xml