package com.course.testng; import org.testng.annotations.Test; public class TimeOutTest { @Test(timeOut = 3000)//單位爲毫秒 public void testSuccess() throws InterruptedException { Thread.sleep(2000); } @Test(timeOut = 2000) public void testFail() throws InterruptedException { Thread.sleep(3000); } }
TestNG實現超時測試
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.