注解测试
配制文件要放到测试的资源文件当中
@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(); } }