Skip to content

@RunWith(MetaAnnotations.class) #202

@dsaff

Description

@dsaff

Issue #194 suggests treating all annotations as meta-annotations.

While discussions about the relative costs and benefits of that proposal continue, there should be a way (in junit or junit.contrib) for a test developer to "opt-in" to meta-annotations. The obvious thing to try is using a custom runner:

@RunWith(MetaAnnotations.class)
@MetaAnnotationForClass
public class TestClass {
   @MetaAnnotationOnMethod public void foo();
}

Making this work will likely require some method extraction on BlockJUnit4ClassRunner. MetaAnnotations could override getAnnotatedMethods, but statements like

method.getAnnotation(Ignore.class) != null

Would need to be changed to call a protected method:

 getAnnotation(method, Ignore.class) != null

So that MetaAnnotations could override getAnnotation.

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