Excluding some tests from a testsuite

Hi MicroEJ team,

I am currently working on the creation of a testsuite with JUNIT for a java library.
I would like to know if I can exclude some tests from the testsuite.

I have seen on your documentation(Run a Test Suite on a Device — MicroEJ Documentation) that I can exclude a whole test class, but can I exclude a specific test in a class letting other tests running?



Hello Anton,

The configurations of the test suite plugin are documented in Module Natures - Test Suite.
The test harness is not aware of JUnit: it is only capable of building, deploying and analyzing results of an application.
Therefore, the given test classes pattern must match entrypoint classes (Java classes with a main static method).

To run JUnit tests, the “JUnit classes” are scanned by the MicroEJ JUnit processor.
The full process is documented in Test Suite with JUnit, including the list of auto-generated classes.

In your case, you can use the classes generated to run a test method.
You can add **/_SingleTest_[TestCase]_*.class to the include pattern and **/_SingleTest_[TestCase]_[TestMethod].class to the exclude pattern for each test you want to exclude.
Please note that this means the tests are built/deployed/ran for each method individually.
If your test suite contains many tests, I suggest you to keep the number of “test case” in “single” mode small to speed up the test suite runs.

Best regards,