这种“忽略”是指方法还没有准备好进行测试,JUnit引擎会绕过(忽略)这个方法。
import org.junit.*; /**
* JUnit Ignore Test
* @author yiibai
*
*/
public class JunitTest3 { @Ignore("Not Ready to Run")
@Test
public void divisionWithException() {
System.out.println("Method is not ready yet");
} }
在上面的例子中,JUnit不会执行 divisionWithException()方法。