Changes between Version 1 and Version 2 of demo_02


Ignore:
Timestamp:
04/05/2012 02:54:10 PM (14 years ago)
Author:
chenyang
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • demo_02

    v1 v2  
    11 
    22== 单元测试应用示例——测试DAO层对象 == 
     3cn.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"})   
     12public class GameDAOImplTest extends AbstractTransactionalJUnit4SpringContextTests{ 
     13 
     14...... 
     15 
     16} 
     17}}}