spring自带的测试注解
@ContextConfiguration(locations="classpath:applicationContext.xml")
@RunWith(SpringJUnit4ClassRunner.class)
public class TestUserDaoImpl extends AbstractJUnit4SpringContextTests{
@Autowired
UserDao userDao;
//TODO
}
classpath:applicationContext.xml---为你当前配置的.XML文件名