我正在尝试使用 JUnit 和 FEST 编写一些 GUI 和集成测试。这是我所拥有的:
@Before
public void setUp(){
try{
program.main(args);
robot.wait(30000); //gives IllegalMonitorStateException
Thread.sleep(30000); //no Exception occurs here
} catch (Exception e){
e.printStackTrace();
}
}
robot
并且args
已经初始化。
为什么我打电话时会出现这样的异常wait
?为什么我打电话时没有得到同样的异常sleep
?