【发布时间】:2010-03-25 09:59:30
【问题描述】:
我目前正在转换一个将 Spring 类 AbstractTransactionalSpringContextTests 扩展为 Spring 3 的测试类。这个抽象类现在已被弃用,我应该使用 AbstractJUnit38SpringContextTests。
测试类中有这个方法:
@Override
protected boolean isDisabledInThisEnvironment(String testMethodName)
{
// Test is only needed for bugfixing and development. Do not check in with this flag on false.
return true;
}
这个 isDisabledInThisEnvironment 方法的替代品是什么?
【问题讨论】:
-
这是
ConditionalTestCase提供的一项功能,以解决JUnit 没有像TestNG 那样的“跳过测试”概念的事实。我认为没有 可以替代它,在过渡到 JUnit4 的过程中很可能被忽视了。