【问题标题】:how do I test app exit with jemmy如何使用 jemmy 测试应用程序退出
【发布时间】:2011-08-17 15:59:10
【问题描述】:

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

目前我模拟点击退出按钮(导致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)

谢谢, 安德烈

【问题讨论】:

标签: java swing testing jemmy


【解决方案1】:

您可能会覆盖安全管理器并检查 System.exit() 是否会发生。

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

【讨论】:

    【解决方案2】:

    您可以尝试使用文件菜单中的操作并退出。

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-27
      相关资源
      最近更新 更多