旧版junit4可能出现的问题
I have a JUnit 4 test class in Eclipse Ganymede that has the following annotations :
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:/applicationContext.xml"})
public class TestSybaseDao extends TestCase {
This annotation gives compilation error "Type mismatch: cannot convert from Class<SpringJUnit4ClassRunner> to Class<? extends Runner>
How can I resolve this problem? Thanks.
解决方法
http://forum.springsource.org/showthread.php?t=70834
I have a JUnit 4 test class in Eclipse Ganymede that has the following annotations :
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:/applicationContext.xml"})
public class TestSybaseDao extends TestCase {
This annotation gives compilation error "Type mismatch: cannot convert from Class<SpringJUnit4ClassRunner> to Class<? extends Runner>
How can I resolve this problem? Thanks.
解决方法
http://forum.springsource.org/showthread.php?t=70834
本文介绍了解决JUnit4测试类与Spring框架集成时出现的编译错误的方法。通过调整@RunWith注解的使用方式,可以成功运行带有@SpringJUnit4ClassRunner注解的测试案例。
807

被折叠的 条评论
为什么被折叠?



