The ABLUnit testing framework uses the source-only ABL annotation syntax to identify and execute the methods or internal procedures in a test class or test procedure.

The following table provides an overview of the supported annotation names in the ABLUnit testing framework. Annotations appear in the order in which they are executed during the lifecycle of a test class or test procedure. Note that some annotation names prefixed with “Legacy” indicate an older, but still supported, name. It is suggested to adopt the new names to improve readability and clarity.

Note: The ABLUnit framework ignores any annotations which are not included in this list.
Annotation Purpose
@Testsuite1 Identifies a listing of test procedures or test classes. See Test Suite Class and Test Suite Procedure.
Note: This annotation is mandatory for a test suite.
@BeforeAll

Legacy: @Before

Executes the method or procedure once per class, before the start of all tests. This annotation may be used to perform time-sensitive activities such as connecting to a database.
Note: Use of @Before is deprecated but still supported.
@BeforeEach

Legacy: @Setup

Identifies a method or procedure to be executed before each of the test methods or procedures. This annotation may be used to prepare the test environment such as by reading input data or initializing the test class.

You may have multiple @BeforeEach methods/procedures and they are executed in the order in which they are defined.

Note: Use of @Setup is deprecated but still supported.
@Test Indicates that a class method or internal procedure is a test case.
Note: This annotation is mandatory for a test method or procedure.
@Test(expected="ExceptionType") Specialized variation of the @Test annotation. This causes the test method/procedure to fail if it does not throw the exception mentioned in the expected attribute. Use this to test a use case which is expected to fail by throwing an error.

Examples:

@Test(expected="Progress.Lang.AppError").
@Test(expected="OpenEdge.Core.AssertionFailedError").
@AfterEach

Legacy: @TearDown

Executes the method or procedure after each test. This annotation may be used to clean up the test environment such as deleting temporary data or restoring defaults.
Note: Use of @TearDown is deprecated but still supported.
@AfterAll

Legacy: @After

Executes the method or procedure once, after all the tests have executed. This annotation may be used to perform clean-up activities such as disconnecting from a database.
Note: Use of @After is deprecated but still supported.
@Ignore Ignores the test. You can use this annotation when you are still working on code, the test case is not ready to run, or if the execution time of the test is too long to be included at runtime.
1 Only programs (classes or procedures) which have a @TestSuite annotation or at least one @Test annotation are considered tests and will be added to the list of tests to run. All other programs are ignored by the ABLUnit test runner.