注解测试

注解测试

配制文件要放到测试的资源文件当中

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath*:spring/data-knet.xml","classpath*:spring/applicationContext.xml"})
public class DatajunitTest extends AbstractJUnit4SpringContextTests{
  @Resource
  private IKnetService knetService;
  
  @Test
  public void aa(){
      knetService.test();
  }
}
原文地址:https://www.cnblogs.com/feiyun126/p/5132421.html