一、引入spring测试包:text包

二、@RunWith:指定spring对junit提供的一个运行器

  @ContextConfiguration:  locations指定spring配置文件位置

 1 @RunWith(SpringJUnit4ClassRunner.class)
2 @ContextConfiguration(locations={"classpath:ApplicationContext.xml"})
3 public class TestSpring1 {
4 @Autowired
5 private PersonService ps;
6 @Test
7 public void test1(){
8 ps.savePerson();
9 }
10 }

最新文章

  1. 数据库大数据处理---复制(SQLServer)
  2. RabbitMQ消息队列1: Detailed Introduction 详细介绍
  3. POJ3154 Graveyard
  4. yum Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
  5. 【2016-08-21】Linux内核版本编号规则简介
  6. BZOJ 1833 count 数字计数
  7. jQuery.Cookie.js用法
  8. Mac OS 快捷键
  9. TcxDBTreeList导出EXCEL
  10. 网站WAF的检测
  11. ORA-00933 UNION 与 ORDER BY
  12. 美丽的for循环语句
  13. 【Hibernate】双向多对多Set查询
  14. Python之路-基本数据类型
  15. list与Set、Map区别
  16. vector数组中STL习惯性用法
  17. spring security4.2.2的maven配置+spring-security配置详解+java源码+数据库设计
  18. 【JS】【3】标签显示几秒后自动隐藏
  19. awk使用教程
  20. leetcode解题报告 32. Longest Valid Parentheses 动态规划DP解

热门文章

  1. Python 到底是强类型语言,还是弱类型语言?
  2. JS中强制类型转换
  3. 谁告诉的你们Python是强类型语言!站出来,保证不打你!
  4. Linux安装Rabbitmq3.8.5
  5. git 合并两个分支的某个文件
  6. MySQL 增删查改 必知必会
  7. webpack使用优化(基本篇
  8. 如何编写高质量的C#代码(一)
  9. 网易云uwp
  10. LongAccumulator类的BUG——reset方法并不能保证初始值正确赋值