在根单元测试类中添加以下内容:
@RunWith( SpringJUnit4ClassRunner.class )@ContextConfiguration
这将在你的默认路径中使用XML。如果需要指定非默认路径,则可以为ContextConfiguration批注提供locations属性。

在根单元测试类中添加以下内容:
@RunWith( SpringJUnit4ClassRunner.class )@ContextConfiguration
这将在你的默认路径中使用XML。如果需要指定非默认路径,则可以为ContextConfiguration批注提供locations属性。