随笔分类 - Junit--测试
摘要:前言: spring容器以xml的形式注入bean,然后可以在类中获取,获取的形式主要有二种:第一种最简单--采用@Resource 或@Autowired关键字在加载spring文件时将bean注入到相应的类中;第二种方式是先用FileSystemXmlApplicationContext、Cla
阅读全文
摘要:前言: 前些日子碰到一个诡异的问题--用springJUnit进行测试,运行方法什么反应也没有,控制台 也没有输出,百度也没有答案--只好暂时作罢。今天我只好用上了排除法,建个测试小项目,将只要能测试的几个Spring相关jar拷进去,测试正常,然后开始与原项目进行对比排除jar,看看到底是哪个/哪
阅读全文
摘要:spring在线文档:https://docs.spring.io/spring/docs/current/javadoc-api/index.html?index-files/index-13.html -----------------------------------------------
阅读全文
摘要:路径说明: 一、加载类目录下的配置文件 @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("classpath:applicationContext_test.xml") public class MyTest1 { @Aut
阅读全文