2011-08-17 21 views
1

我使用Jemmy进行Java GUI测试。是否可以测试关闭应用程序?我如何使用jemmy测试应用程序退出

目前我模拟的退出按钮点击(导致System.exit(0))和测试失败:

junit.framework.AssertionFailedError: Forked Java VM exited abnormally. Please note the time in the report does not reflect the time until the VM exit. 
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:154) 

感谢, 安德烈

+0

可能重复(http://stackoverflow.com/questions/6141252/dealing-with-system-exit0-in-junit-tests) – Pops

+0

您可能想要尝试在[此问题]的答案中描述的SecurityManager方法(http://stackoverflow.com/questions/6141252/dealing-with-system-exit0-in-junit-tests)。 – bkimminich

回答

0

你可以尝试从文件菜单和退出的行动来做到这一点。 [在JUnit测试(0)与System.exit处理]的

 Action action = new Action("File|Exit", null); 
     action.perform(); 
相关问题