パッケージcom.course.testng.suite。 輸入org.testng.annotations.Test; パブリック クラスTimeOutTest { @Test(タイムアウト = 3000 ) 公共 ボイド TestSuccess()はスローInterruptedExceptionある{ のThread.sleep( 2000 )。 } @Test(タイムアウト = 2000 ) 公共 ボイド TestFailed()スローInterruptedExceptionある{ のThread.sleep( 3000 )。 } }
パッケージcom.course.testng.suite。 輸入org.testng.annotations.Test; パブリック クラスTimeOutTest { @Test(タイムアウト = 3000 ) 公共 ボイドTestSuccessは()InterruptedExceptionある{スロー のThread.sleep(2000 )。 } }