不幸的是,悬空输入往往会导致模拟错误,甚至会使模拟根本无法运行,因为活动或网关一直在等待某个永远不会接收到的输入。
Unfortunately, dangling inputs are often the source of simulation errors or prevent the simulation from running at all, because an activity or gateway waits for some input that it can never receive.
要测试GUI,你需要一种可以模拟用户输入的方法,一直等到生成的事件散播给所有侦听者,然后检查结果,就像GUI响应用户一样。
To test GUIs, you need a way to simulate user input, wait until the generated events have been broadcast to all listeners, and then check the result as the GUI would appear to the user.
应用使用的线程和进程在输入到达之前会一直挂起,而不管等待了多久。
Both the thread and the process it's using will be held until the input arrives, however long that takes.
应用推荐