JUnit Test Runner,可以在运行测试之前创建测试 [英] JUnit Test Runner that creates tests just before running them

查看:123
本文介绍了JUnit Test Runner,可以在运行测试之前创建测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用JUnit 3.x TestRunner在运行它们之前立即实例化所有测试.

I use JUnit 3.x TestRunner that intantiates all tests at once before running them.

是否有可用的Test Runner,可以在运行它们之前创建每个测试(或至少每个测试套件的测试)?
我可以使用JUnit 4.x运行程序,但我的测试是3.x测试.

Is there a Test Runner available that would create each test (or at least each test suite's tests) just before running them?
I can use JUnit 4.x runners but my tests are 3.x tests.

推荐答案

在JUnit 3中,您需要编写自己的TestSuite类,以延迟套件中测试的实例化.

In JUnit 3 you'd need to write your own TestSuite class that delayed instantiation of the tests in the suite.

这篇关于JUnit Test Runner,可以在运行测试之前创建测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆