How to get Junit 4 to ignore a Base Test Class?

Just as a note, I'd always recommend giving a reason for the ignore:

@Ignore("This test will prove bug #123 is fixed, once someone fixes it")

I'm hoping the junit xml report formatter, used when running tests from ant, will one day include the ignored count (and the reasons) along with pass, fail, and error.


Use to @Ignore annotation. It also works on classes. See this one:

@Ignore public class IgnoreMe {
                        @Test public void test1() { ... }
                        @Test public void test2() { ... }
                }

Also, you can annotate a class containing test methods with @Ignore and none of the containing tests will be executed.

Source: JUnit JavaDoc

Tags:

Junit

Junit4