junit测试类的多个runwith

马尤什

有谁知道如何解决这个问题。

@RunWith(SpringJUnit4ClassRunner.class)
@RunWith(Parametrized.class)

@ContextConfiguration("/META-INF/blah-spring-test.xml")
public class BlahTest
..

所以我想进行弹簧性质测试,同时希望将其参数化以避免代码重复...

约翰·B

如评论中所述,您不能使用两个跑步者。您应该Parameterized像使用Spring的TestContextManager一样使用运行程序来加载Spring上下文。

@Before 
public void before() throws Exception {
  new TestContextManager(getClass()).prepareTestInstance(this);
}

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章