You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "John Blum (JIRA)" <ji...@apache.org> on 2015/07/28 23:39:05 UTC

[jira] [Updated] (GEODE-166) Enable test cases to be repeated by way of a JUnit Rule and custom annotation (e.g. @Repeat).

     [ https://issues.apache.org/jira/browse/GEODE-166?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John Blum updated GEODE-166:
----------------------------
    Attachment: RepeatRule.java
                Repeat.java

Attaching implementing source files for the @Repeat annotation and custom JUnit 4 RepeatRule.

> Enable test cases to be repeated by way of a JUnit Rule and custom annotation (e.g. @Repeat).
> ---------------------------------------------------------------------------------------------
>
>                 Key: GEODE-166
>                 URL: https://issues.apache.org/jira/browse/GEODE-166
>             Project: Geode
>          Issue Type: Bug
>          Components: general
>    Affects Versions: 1.0.0-incubating
>         Environment: Apache Geode Test environments (e.g. Gradle, Maven and IDE).
>            Reporter: John Blum
>            Priority: Minor
>         Attachments: Repeat.java, RepeatRule.java
>
>
> Ideally, it would be nice to encapsulate the logic for repeating a test case in the _Apache Geode_ test suite using the test framework (i.e. JUnit) by way of a JUnit Rule and accompanying Java Annotation, like {{@Repeat}}.
> For instance, a developer could annotate a test case method in a test class like so...
> {code:java}
> @Test
> @Repeat(10)
> public void someTestCase() {
>   ...
> }
> {code}
> Alternatively, a developer could specify the test run count using a System property that is settable from the command-line (using Gradle/Maven/Ant) or via his/her IDE, for instance...
> {code:java}
> @Test
> @Repeat("test.runs")
> public void someTestCase() {
>   ...
> }
> {code}
> Then...
> {code}
> $ gradlew test -Dsingle.test=MyTestClass *-Dtest.runs=10*
> {code}
> It is up to the developer to define different conventions and System properties used to enable a collection or specific grouping of tests to run multiple times.
> The Java Annotation approach is more portable then build-based test repetition.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)