📄 delayedtest.java
字号:
package covertjava.loadtest;
import junit.framework.*;
import junit.extensions.TestDecorator;
/**
* <p>A test decorator that executes the given test after a specified delay</p>
* <p>Copyright: Copyright (c) 2004 Sams Publishing</p>
* @author Alex Kalinovsky
* @version 1.0
*/
public class DelayedTest extends TestDecorator {
protected int delay;
/**
* Executes the given test after the delay
* @param test test to run
* @param delay delay to sleep in milliseconds before running the test
*/
public DelayedTest(Test test, int delay) {
super(test);
}
public void run(TestResult result) {
try {
Thread.currentThread().sleep(delay*1000);
super.run(result);
}
catch(InterruptedException x) {
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -