@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations ={“/spring-config.xml”,”/mybatis/TimeManagerMapper.xml”,”/mybatis/UserMapper.xml”})
public class daoTest {
@Autowired
private UserDao dao;
@Test
public void testlogin(){
User user=new User();
user.setUsername(“zhansan”);
Object o = dao.getUserByUsername(user);
System.out.println(“查询结果—”+o);
}
}
junit-test
最新推荐文章于 2024-08-17 19:18:43 发布