vertx-unit
vertx-unit copied to clipboard
Allow to define a global repeat mode per tests classes
This pull request allow to define a global repeat behaviour mode :
@RunWith(VertxUnitRunner.class)
@Repeat(value = AsyncUtilsTest.REPEAT_LIMIT, silent = true)
public final class AsyncUtilsTest {
/**
* Limits
*/
private static final int TIMEOUT_LIMIT = 1500;
static final int REPEAT_LIMIT = 100;
@Rule
public RepeatRule repeater = new RepeatRule();
@Rule
public RunTestOnContext rule = new RunTestOnContext();
@Test(timeout = AsyncUtilsTest.TIMEOUT_LIMIT)
public void timeoutNotRaised(final TestContext context) {
//.....
}
@Test(timeout = AsyncUtilsTest.TIMEOUT_LIMIT)
public void timeoutNotRaisedWithError(final TestContext context) {
//.....
}
@Test(timeout = AsyncUtilsTest.TIMEOUT_LIMIT)
public void timeoutRaised(final TestContext context) {
//.....
}
@Test(timeout = AsyncUtilsTest.TIMEOUT_LIMIT)
public void timeoutRaisedWithError(final TestContext context) {
//.....
}
@Test(timeout = AsyncUtilsTest.TIMEOUT_LIMIT)
@Repeat(value = 1, silent = true)
public void createMemoize(final TestContext context) {
// 1 repeat in silent mode
}
@Test(timeout = AsyncUtilsTest.TIMEOUT_LIMIT)
public void constantWithNull(final TestContext context) {
//.....
}
@Test(timeout = AsyncUtilsTest.TIMEOUT_LIMIT)
public void asyncifyAFunction(final TestContext context) {
//.....
}
}
I will update this pull request today to add an inheritance configuration mechanism for repeat annotation
it is missing documentation and javadoc of the annotation should be updated too
It is missing a test for this new behavior
Done, but I need to introduce Mockito to easily mock Description class
I'm asking for a review ;)