Updates to ABLUnit
- Last Updated: February 9, 2026
- 4 minute read
- OpenEdge
- Version 12.8
- Version 12.2
- Documentation
OpenEdge.ABLUnit namespaces may need to be recompiled or
updated to use the new public API (classes and methods). The following changes require
the modification and removal of a number of public members:- Methods with lifecycle annotations
- Lifecycle method failure and error reporting
errNumkey for expected error numbers- Failure and errors written to
results.xml <skipped>element for ignored tests- Stop conditions caught
<properties>element for test suites@Testsuiteor@Testannotations required
results.xml file is consistent with the JUnit results
standard.Methods with lifecycle annotations
The ABLUnit test framework has the concept of lifecycle methods that add behavior to test cases and individual tests, for instance, code that must run before each test method. Previous releases allowed multiple methods with the same annotation to be run, but at run time, only a single lifecycle method was run.
Now, all of the methods that have lifecycle annotations are run in the
order in which they are defined. Methods must all have the same signature (return
void, no parameters), but the OOABL class requires
the methods to have different names.
Setup_A and
Setup_B both run before Test1 runs.
|
In order for multiple methods with lifecycle annotations to be run, additional behavior changes were made.
Lifecycle method failure and error reporting
A test that returns OpenEdge.Core.AssertionFailedError is a failure because a particular
assertion was tested. All other conditions raised are considered errors.
If a test method has one or more lifecycle methods, and one of those methods (either the test method itself or one or more of the lifecycle methods) raises any error, then the most severe condition raised is reported. For example, if the test method raises a failure due to an assertion failing, and the lifecycle method raises an error, then the error is reported because an error is more severe than a failure.
errNum key for expected error numbers
@Test annotation enables
developers to specify the type of exception raised using an expected key with an
OOABL type name value. To specify an error
number, use the errNum key. The value for errNum must be an integer. The test passes if the
following are true: - The test raises an exception, and the exception matches the expected type.
- An
errNumvalue is provided. - The exception's first error number equals the
errNumvalue.
If no errNum key is provided, then
only the expected type is used to determine a test's success.
For example, the following test passes because it does not expect the class to exist.
|
Failures and errors written to results.xml
A single test may have zero, one, or more lifecycle methods
associated with it. The @Setup and @TearDown methods run before and after each test
method, respectively. Failures or errors resulting from the test method or its
lifecycle methods each have a failure or error element created in the results.xml.
For example, there are two failures in the test named test3:
|
<skipped> element for ignored tests
If a test is ignored, then a <skipped> element is added with a message attribute.
|
Stop conditions caught
ABLUnit handles stop conditions raised in test methods (explicitly or
implicitly). The message written to the results.xml
file varies depending on the value of the -catchStop parameter.
If the -catchStop parameter has a
value of 0, then the Progress.Lang.AppError error
is raised and caught, and the message "stop condition raised for test-name" is added as an error to the test
result.
If the -catchStop parameter has a
value of 1, then the Progress.Lang.Stop exception
is caught, and an error message is added to the test results. The message is
typically "Stop condition raised" except for lock conflicts. If there is a lock
conflict, then the message is "Lock conflict raised".
<properties> element for test suites
A <properties> element is
added to <testcase> (test classes and
procedures) and <testsuite> elements. This
element contains a number of properties that describe the session.
The following is a list of properties and the ABL functions or attributes used to determine their values:
|
@TestSuite or @Test annotation required
Only programs (classes or procedures) that have an @TestSuite annotation or at least one @Test annotation are considered tests, and are added to
the list of tests to run. All other programs are ignored by the ABLUnit test
runner.
For more information about the ABLUnit framework, see Lifecycle of ABLUnit framework in Progress Developer Studio for OpenEdge Online Help.