【发布时间】:2012-02-24 19:58:50
【问题描述】:
我有一个User 表,在UserController.java 我有一个方法userList();,它使用休眠返回数据库中的所有用户。
如何为这段代码编写JUnit 测试用例。我是 JUnit 的新手。
请帮忙。
public List<User> userList() {
try
{
List <User> result = hibernateTemplate.find("from User");
return result;
}
finally {
//close the session and user-supplied JDBC connection
}
}
【问题讨论】: