这种“忽略”是指方法还没有准备好进行测试,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()方法。

相关文章:

  • 2022-12-23
  • 2022-01-07
  • 2022-12-23
  • 2021-11-24
  • 2022-12-23
  • 2022-12-23
  • 2021-06-05
  • 2021-11-01
猜你喜欢
  • 2022-12-23
  • 2021-11-24
  • 2021-06-30
  • 2021-07-19
  • 2021-05-20
  • 2022-12-23
相关资源
相似解决方案