Skip to content

All JUnit annotations should be able to be applied as meta-annotations #194

Closed as not planned
@nealeu

Description

@nealeu

As stated in https://github.com/KentBeck/junit/issues/100, it would enhance the DRYness and hence maintainability and readability of JUnit tests if @RunWith(SomeCustomRunner.class) could be specified in a single place, alongside other annotations to form testing meta-annotations.

At the moment it is suggested that SpringJUnit4Runner should be a @Rule (which has become the subject of issue 100), yet this migration would still require the repetition of:

@Rule @ClassRule 
public static TestRule springRule = new SpringContextRule();

At class level, and example would be @IntegrationTestSuite (which could contain custom @RunWith and/or @Rule (assuming https://github.com/KentBeck/junit/issues/#issue/32 is implemented).

At test level, allowing @Test to be on a meta annotation would allow standard timeouts to be declared, such as a meta-annotation @PerformanceCriticalReadOnlyTest with the annotations @Test(timeout=100) @Transactional(readOnly=true)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions