Run test cases using an Apache ANT task
- Last Updated: February 11, 2026
- 2 minute read
- OpenEdge
- Version 13.0
- Documentation
You can use a custom ANT task (build.xml) to run ABLUnit tests
cases. The task is a part of ant-ablunit.jar and is
located in:
$DLC\java location
Make sure that Apache ANT is installed on your machine and copy the
ant-ablunit.jar file into the installation location of Apache
ANT.
You must write an XML file (build.xml) for ABLUnit that runs
test cases from the ABLUnit testing framework and can display the results in the
console or save it to an XML file.
You can define ABLUnit tests by nesting elements in the test cases or using batch tests to run the ANT task.
ABLUnit Task-Level Properties
| Name | Description |
|---|---|
| DLC | Specifies the installation location of OpenEdge. |
| environment (Optional) | Specifies the environment (GUI or TTY) in which test cases should run. By default, the test cases run in the GUI environment. |
| printsummary (Optional) | Prints a one-line summary of each test case that you run. The valid values are true, false, on, off, yes, and no. By default, the value is set to true. |
| haltonerror (Optional) | Stops the build process if an error occurs while running a test case. By default, the process proceeds even when errors occur. |
| haltonfailure (Optional) | Stops the build process if a test fails. By default, the process proceeds even if the test case fails. |
| tempdir (Optional) | Specifies the directory in which temporary files are placed while running the build process. By default, the working directory is used. |
ABLUnit Elements
You can use the following ABLUnit elements in an ANT task to run an ABLUnit test case.
dbinfo element
| Name | Description |
|---|---|
| name | Specifies the database name including the absolute path or the
relative path if the database file is in the current working
directory, for example in $DLC\WRK\Sports2020.db. |
| host (Optional) | Specifies the host name of the server, for example,
localhost. |
| port (Optional) | Specifies the port of the server or the service name, for example,
4545. |
propath element
test element
| Name | Description |
|---|---|
| name | Specifies the name of a test class (.cls) or a test
procedure (.p) file. |
| todir (Optional) | Specifies the directory to which the results of the ANT task are written. |
| outfile (Optional) | Specifies the name of the test results file. The format attribute file decides the extension of the file. |
| format (Optional) | Specifies the format of the results. Currently, we support on XML format. |
| DLC (Optional) | Specifies the installation location of OpenEdge. This property overrides the value you set in the ABLUnit task. |
| environment (Optional) | Specifies the environment (GUI or TTY) in which test cases must run. It overrides the value you set in the ABLUnit task. |
| printsummary (Optional) | Prints a one-line summary of each test case that you run. The valid values are true, false, on, off, yes, and no. It overrides the value you set in the ABLUnit task. |
| haltonerror (Optional) | Stops the build process if an error occurs while running the test case. This property overrides the value you set in the ABLUnit task. |
| haltonfailure (Optional) | Stops the build process if a test case fails. This property overrides the value you set in the ABLUnit task. |
batchtest element
| Name | Description |
|---|---|
| todir (Optional) | Specifies the directory into which the results of the ANT task are written. |
| format (Optional) | Specifies the format of the test result. |
| DLC (Optional) | Specifies the installation location of OpenEdge. This property overrides the value you set in the ABLUnit task. |
| environment (Optional) | Specifies the environment (GUI or TTY) in which the test case must run. This property overrides the value you set in the ABLUnit task. |
| printsummary (Optional) | Prints a one-line summary of each test case that you run. The valid values are true, false, on, off, yes, and no. This property overrides the value you set in the ABLUnit task. |
| haltonerror (Optional) | Stops the build process if an error occurs while running the test case. This property overrides the value you set in the ABLUnit task. |
| haltonfailure (Optional) | Stops the build process if a test fails. This property overrides the value you set in the ABLUnit task. |
Here is a sample build.xml file (Ant
task):
<?xml version="1.0" encoding="UTF-8"?>
<project name="ABLUnit-Ant" default="main" basedir=".">
<!-- ABLUnit task definition target starts here -->
<target name="taskdef">
<taskdef name="ablunit" classname="com.progress.openedge.ant.ablunit.ABLUnitTask"
classpath="dist/ant-ablunit.jar" />
</target>
<!-- Main target starts here -->
<target name="main" depends="taskdef">
<ablunit dlc="$DLC" environment="gui"
printsummary="true" haltonerror="no" haltonfailure="no" tempdir="${basedir}/tmpdir">
<dbinfo name="$DLC\WRK\Sports2020.db" host="localhost" port="4545" />
<propath>
<pathelement location="${basedir}/samples/classes" />
<pathelement location="${basedir}/samples1/classes" />
</propath>
<test name="${basedir}/samples/MyTestClass.cls" todir="${basedir}/results"
outfile="result-MyTestClass-gui" format="xml" />
<test name="${basedir}/samples/MyTestProcedure.p" todir="${basedir}/results"
outfile="result-MyTestProcedure" format="xml" />
<batchtest todir="${basedir}/results" format="xml">
<fileset dir="${basedir}/samples1">
<include name="**/*.cls" />
<include name="**/*.p" />
</fileset>
</batchtest>
</ablunit>
</target>
</project>