In this section:
Integrating with a Build System
Jtest ships with support for Maven, Ant, and Gradle. Integrating your build system with Jtest allows you to collect and report unit test results and coverage data. See the following sections for details about integration, usage, and supported versions:
By defaut, Jtest collects results for tests that are executed using the JUnit 4 or JUnit 5 frameworks. See Collecting Test Results for JUnit 3 Tests for information about how to obtain test results for JUnit 3 tests.
Collecting Test Results for JUnit 3 Tests (Deprecated)
Support for JUnit 3 is deprecated and will be removed in future versions.
To obtain tests results for JUnit 3 tests, we recommend that your project be configured to execute JUnit 3 tests using JUnit 4 or JUnit 5. Alternatively, you can configure Jtest to obtain test results using the deprecated XML processing mechanism. To enable XML processing, configure the following option in the jtestcli.properties
configuration file:
jtest.unittest.xml.results.processing.enabled=true
Typically, XML files are generated by build systems and may vary between different versions of a build system, which may affect the consistency of test results obtained with different build system versions. Also, configuring this option may impact performance, because of the time-consuming code instrumentation required in this workflow.
Executing Test Suites
Jtest can collect and report test suite execution results.
For JUnit 4.13 or later, if a test is executed in two or more different test suites, the execution result is reported multiple times – in the context of each test suite. In addition, if your project includes nested suites, the Jtest report shows test suite hierarchy
For JUnit 4.12 and earlier, the Jtest report does not present the hierarchy of nested suites and includes one test execution result per test - even if the test was run in more than one test suite.
Jtest does not collect results for nested suites if you enable the deprecated XML processing mechanism (see Collecting Test Results for JUnit 3 Tests).