junit4 icon indicating copy to clipboard operation
junit4 copied to clipboard

Please implement @IgnoreWhen(true) annotation.

Open Jackalx opened this issue 14 years ago • 6 comments

Will be great to have annotation that can help ignore some tests depending on certain conditions.

Jackalx avatar Jun 19 '12 07:06 Jackalx

Can you hit any examples? The annotations accept only compile time constants and not the references either an execution code. I can only imaging Class Object, and implementation similar to Rules.

Tibor17 avatar Jun 19 '12 07:06 Tibor17

This is exactly the situation org.junit.Assume is useful for.

djh82 avatar Jun 19 '12 20:06 djh82

assume make test green, but it bad if i want to calculate count of tests that were run

Jackalx avatar Jun 20 '12 07:06 Jackalx

You're right, I'd not noticed that before. I've raised issue #455 to fix it.

djh82 avatar Jun 20 '12 18:06 djh82

@Jackalx - how are you counting test runs?

deterb avatar Jun 20 '12 19:06 deterb

We calculating it by bamboo.

P.S. I have found that Spring Annotation can do the same things, maybe it can help

@IfProfileValue(name="java.vendor", value="Sun Microsystems Inc.")

Jackalx avatar Jun 20 '12 19:06 Jackalx