You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
I'm not sure this is a good path forward. A class can only have one runner. If you wanted to use Parameterized or Theories, you couldn't use MetaAnnotations
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:
Making this work will likely require some method extraction on BlockJUnit4ClassRunner. MetaAnnotations could override getAnnotatedMethods, but statements like
Would need to be changed to call a protected method:
So that MetaAnnotations could override getAnnotation.
The text was updated successfully, but these errors were encountered: