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)
感謝, 安德烈
可能重複(http://stackoverflow.com/questions/6141252/dealing-with-system-exit0-in-junit-tests) – Pops
您可能想要嘗試在[此問題]的答案中描述的SecurityManager方法(http://stackoverflow.com/questions/6141252/dealing-with-system-exit0-in-junit-tests)。 – bkimminich