java - Why is a junit test that is skipped because of an assumption failure is not reported as skipped? -
i use junit assumptions decide whether run test or not.
tests assumption fails ignored/skipped junit framework.
i wonder why skipped tests not reported 'skipped'?
please have @ example:
import static org.junit.assert.fail; import org.junit.assume; import org.junit.test; public class assumptiontest { @test public void skipassumptionfailuretest() { assume.assumetrue("foo".equals("bar")); fail("this should not reached!"); } }
running test in maven project results in:
running assumptiontest tests run: 1, failures: 0, errors: 0, skipped: 0, time elapsed: 0.015 sec
i prefer have test reported 'skipped'. there chance achieve this?
(junit 4.8.1; maven 2.2.1; java 1.6.0_21)
you can't out-of-the-box way skip tests @ignore
annotation. however, found blog post might looking for:
Comments
Post a Comment