Junit 测试作为无根测试返回
我在这个网站上提出了类似的问题,但这与我所看到的情况有点不同。
我们有一个 PC 客户端执行 JUnit 4 测试。但是,我们有一个自定义测试运行程序,它通过以太网将 JUnit 4 测试作为 JUnit 3 测试(使用 JUnit38ClassRunner)发送到正在运行使用 JUnit 3.8 执行 JUnit 测试的服务的目标系统。测试按预期执行,但是,当它们返回到 PC 客户端时,它们被标记为无根测试。有没有办法将这些测试组织为“非无根测试”?在不使用 Eclipse 的情况下,当失败的结果全部返回为一组时,筛选失败的结果有些困难。在远程系统上不可以选择使用 JUnit 4,因为目标嵌入式系统使用 Java 1.4.2,并且这种情况在不久的将来不会改变。我们真的不想因为 @RunWith 注释而在 PC 客户端降级到 JUnit 3.8,这将花费我们一些时间来弄清楚如何重新实现。
如有任何帮助,我们将不胜感激,提前致谢。
I've similar questions asked on this site, but this is a bit of a different scenario than what I have seen.
We have a PC client execute JUnit 4 tests. However, we have a custom test runner that ships the JUnit 4 tests as JUnit 3 tests (using JUnit38ClassRunner) over ethernet to a target system that is running a service that executes JUnit tests using JUnit 3.8. The tests execute as intended, however, when they are returned to the PC client they are marked as Unrooted Tests. Is there a way to organize these tests as "non-unrooted tests"? It is somewhat difficult to sift through the failed results when they are all returned in one group when not using Eclipse. Using JUnit 4 is not an option on the remote system as the target embedded system uses Java 1.4.2, and this is not changing anytime in the near future. We really do not want to have to downgrade to JUnit 3.8 on the PC client side because of the @RunWith annotation, which will take us a little while to figure out how to re-implement.
Any assistance on this is appreciated, thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我无法在 Eclipse 中找到解决方案,但使用 Ant 管理 junit 执行会生成 xml 报告,并且我可以通过使用编译这些报告来在网页中查看摘要。元素。
I wasn't able to find a solution for this in Eclipse, but using Ant to manage the junit execution generates xml reports, and I can view the summary in a web page by compiling those reports using the <junitreport> element.