xiliary icon indicating copy to clipboard operation
xiliary copied to clipboard

[ConditionalIgnore] Allow annotation on class level

Open fappel opened this issue 9 years ago • 3 comments

fappel avatar Mar 04 '16 09:03 fappel

Neat idea! Do you have something like this on your mind?

@Rule
@ConditionalIgnore(confition=NonMacOS.class)
public ConditionalIgnoreRule ignoreRule = new ConditionalIgnoreRule();

rherrmann avatar Mar 04 '16 11:03 rherrmann

I actually did not think it through thoroughly. I just wanted to capture the basic idea as I had to ignore ALL tests of a test case individually (Was indeed OS X related...). I think your approach would work well (except for the typo ;-)), but this would be field level access from the annotations @Target point of view, right? I had the notion of putting it on the test case itself, but somehow I find your solution more intuitive.

fappel avatar Mar 04 '16 12:03 fappel

Yes, that would be field level access. I like the idea to place the annotation on the class equally well. The annotation does not affect the field it is placed on but the entire class. .In that sense, it even seems to be more 'symetric' in that, well, annotations at class level affect the whole class and method lvel annotations only the method.

rherrmann avatar Mar 05 '16 09:03 rherrmann