vertx-unit icon indicating copy to clipboard operation
vertx-unit copied to clipboard

Allow to define a global repeat mode per tests classes

Open gchauvet opened this issue 8 years ago • 5 comments

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) {
        //.....
    }
}

gchauvet avatar Jul 09 '16 11:07 gchauvet

I will update this pull request today to add an inheritance configuration mechanism for repeat annotation

gchauvet avatar Jul 09 '16 11:07 gchauvet

it is missing documentation and javadoc of the annotation should be updated too

vietj avatar Jul 09 '16 12:07 vietj

It is missing a test for this new behavior

vietj avatar Jul 09 '16 14:07 vietj

Done, but I need to introduce Mockito to easily mock Description class

gchauvet avatar Jul 10 '16 06:07 gchauvet

I'm asking for a review ;)

gchauvet avatar Jan 11 '17 21:01 gchauvet