重复 JUnit3 测试
我正在使用 Apache 的 Surefire JUnit Maven 插件。
我想在 JUnit 3.x 中重新运行测试套件。这在 JUnit 4 中很容易实现,它提供了“参数化”注释。
你知道我如何在 JUnit 3.x 中做同样的事情吗?
我的目标是运行整套测试两次,以便可以将两个不同的测试数据植入到所有测试中。
I am using Apache's Surefire JUnit plug-in for maven.
I would like to re-run a test suite in JUnit 3.x. This is possible easily in JUnit 4, which offers the 'Parameterized' annotation.
Do you know how I can do the same in JUnit 3.x?
My goal is to run the entire suite of tests twice so that two different test data can be seeded into all the tests.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 JUnit 3.x 中,您可以定义自己的测试套件。如果您向 JUnit 类添加
方法,JUnit 将运行返回变量中定义的所有方法。您可以查看 JUnit 和 junit.framework.TestSuite - 没有可运行的方法< /a> (针对问题)或 http://junit.org/apidocs/junit/framework/TestSuite.html
你也可以这样做:
In JUnit 3.x you can define your own test suite. If you add
method to yout JUnit class than JUnit will run all methods that are defined in the returned variable. You can look on JUnit and junit.framework.TestSuite - No runnable methods (to the question) or http://junit.org/apidocs/junit/framework/TestSuite.html
You can do also something like this: