junit.framework.TestCase
继承者中的 JUnit 4 @Test
注解方法。 混合 JUnit 的 API 会导致运行测试出现问题。
示例:
public class MyTest extends TestCase {
@Test //名称不是以 "test" 开头,因此将被忽略
public void wouldBeIgnored() {}
@Test //名称以 "test" 开头
@Ignore //因此即便有 @Ignore 注解也会执行
public void testWouldBeExecuted() {}
}
提供的修正:
@Ignore
注解并重命名测试方法,使名称不以“test”开头。