注解测试

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

@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();
  }
}

 

posted on 2016-01-15 09:49  网络终结者  阅读(177)  评论(0编辑  收藏  举报