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

后端 未结 2 1735
离开以前
离开以前 2021-02-11 12:14

I have a base class for many tests that has some helper methods they all need.

It does not by itself have any tests on it, but JUnit (in eclipse) is invoking the test ru

2条回答
  •  面向向阳花
    2021-02-11 12:37

    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

提交回复
热议问题