Changes between Version 1 and Version 2 of demo_02
- Timestamp:
- 04/05/2012 02:54:10 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
demo_02
v1 v2 1 1 2 2 == 单元测试应用示例——测试DAO层对象 == 3 cn.com.pcgames.gamehall2.repository.impl.GameDAOImpl是GameDAO实现类,完成Game对象在数据库中增删改查的功能.[[BR]] 4 我们在DAO层使用了Spring JdbcTemplate封装了DAO操作,我们使用Spring测试框架辅助编写单写单元测试,可以简化测化,我们让测试类去继承AbstractTransactionalJUnit4SpringContextTests[[BR]] 5 {{{ #!java 6 /** 7 * GameDAO测试 8 * @author ChenYang 9 */ 10 @RunWith(SpringJUnit4ClassRunner.class) 11 @ContextConfiguration(locations={"classpath:applicationContext.xml"}) 12 public class GameDAOImplTest extends AbstractTransactionalJUnit4SpringContextTests{ 13 14 ...... 15 16 } 17 }}}
![(please configure the [header_logo] section in trac.ini)](http://www1.pconline.com.cn/hr/2009/global/images/logo.gif)