== 单元测试应用示例——测试DAO层对象 == cn.com.pcgames.gamehall2.repository.impl.GameDAOImpl是GameDAO实现类,完成Game对象在数据库中增删改查的功能.[[BR]] 我们在DAO层使用了Spring JdbcTemplate封装了DAO操作,我们使用Spring测试框架辅助编写单写单元测试,可以简化测化,我们让测试类去继承AbstractTransactionalJUnit4SpringContextTests[[BR]] {{{ #!java /** * GameDAO测试 * @author ChenYang */ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations={"classpath:applicationContext.xml"}) public class GameDAOImplTest extends AbstractTransactionalJUnit4SpringContextTests{ ...... } }}}