什么时候调用 robots.cleanUp() 合适

发布于 2024-10-06 20:29:35 字数 125 浏览 1 评论 0原文

我使用 JUnit 和 FEST 对我们的应用程序进行 Swing 集成测试,在测试用例中多次启动和停止。 @after 应该包含对 robot.cleanUp() 的调用吗?

I'm using JUnit and FEST for Swing integration testing of our app that I start and stop, multiple times in the test case. Should @after include a call to robot.cleanUp()?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

暖伴 2024-10-13 20:29:35

一般规则如下:FrameFixture 的每个初始化站点都应该有一个相应的清理站点。

具体来说,如果您的 @Before 方法初始化了 FrameFixture (如: w = new FrameFixture() 其中 w 是测试类的字段),那么您应该定义一个 @After 方法,该方法将通过 w.cleanUp() 释放资源。

请参阅示例:http://docs.codehaus.org/display/FEST/Getting+开始了

The general rule is as follows: each initialization site of a FrameFixture should have a corresponding cleanup site.

Sepcifically, if your @Before method initializes a FrameFixture (as in: w = new FrameFixture<MyWindow>() where w is a field of the test class) then you should define a @After method that will release the resources via w.cleanUp().

See the sample in: http://docs.codehaus.org/display/FEST/Getting+Started.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文