OrderedRunner
is also a CategoryRunner .
public class MyTest { @Test public void test1() { ... } @Test public void test2() { ... }Nothing prevents the tests to be executed in the order test2() then test1(). To ensure that the order will be test1() then test2(), you can use:
@RunWith(OrderedRunner.class) public class MyTest { @Test @Order(order=1) public void test1() { ... } @Test @Order(order=2) public void test2() { ... }
org.mdiutil.junit.resources
package in your unit tests directory[3]
org.mdiutils.junit.resources
packagetest ==> my ====> package MyFirstTest.java MySecondTest.java org ==> mdiutils ====> junit ======> resources categories.properties
strictMode=true editor= server= client=falseOnly Unit Tests annotated by both "editor" and "server" will run.
showSkippedClasses=true editor= server= client=falseIf "showSkippedClasses" value is false, then tests which are not executed will not be shown at all.
strictMode=false long= pack= archi=false
MDIUTILITIES_JUNIT_ENV
environment variable and reused for all the Unit tests classes.
editor= server= client=All Unit Tests will run.
editor=true server=false client=falseOnly "editor" Unit Tests will run.
editor= server= client=falseAll Unit Tests except "client" Unit tests will run.
strictMode=true editor=true server=true client=Only Unit Tests annotated by both "editor" and "server" will run.
@RunWith(CategoryRunner.class) @Category(cat="editor") @Category(cat="server") public class MyTest { @Test public void test1() { ... } @Test public void test2() { ... }In this case, the MyTest class belong to two categories:
org.mdiutils.junit.resources
packageCopyright 2006-2024 Herve Girod. All Rights Reserved. Documentation and source under the LGPL v2 and Apache 2.0 licences