开发者

how do I test app exit with jemmy

I use Jemmy for Java GUI testing. Is it possible to test closing application?

Currently I simulate a click on the exit button (causing System.exit(0)) and the test fails:

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.R开发者_Python百科unClassThread.run(RunClassThread.java:154)

Thanks, Andrey


You could potentially override security manager and check that System.exit() is going to happen.

Java: How to test methods that call System.exit()?


You could try to do it with an Action from the File menu and Exit.

        Action action = new Action("File|Exit", null);
        action.perform();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜