use of cn.edu.zju.acm.onlinejudge.bean.Forum in project zoj by licheng.
the class AuthorizationPersistenceImplTest method testUpdateForum1.
/**
* Tests updateForum method
* @throws Exception to JUnit
*/
public void testUpdateForum1() throws Exception {
forum1.setName("new name");
forum1.setDescription("new desc");
persistence.updateForum(forum1, 1);
Forum forum11 = persistence.getForum(forum1.getId());
checkForum(forum1, forum11);
}
use of cn.edu.zju.acm.onlinejudge.bean.Forum in project zoj by licheng.
the class ProblemPersistenceImplTest method newForum.
/**
* Creates a new forum.
* @param id the id
* @return a new forum instance
*/
private Forum newForum(long id) {
Forum forum = new Forum();
forum.setId(id);
forum.setName("forum" + id);
forum.setDescription("forum" + id + " description");
return forum;
}
use of cn.edu.zju.acm.onlinejudge.bean.Forum in project zoj by licheng.
the class ForumPersistenceImplTest method testCreateForum1.
/**
* Tests createForum method
* @throws Exception to JUnit
*/
public void testCreateForum1() throws Exception {
Forum forum = new Forum();
forum.setName("name");
forum.setDescription("desc");
persistence.createForum(forum, 1);
Forum forum1 = persistence.getForum(forum.getId());
checkForum(forum, forum1);
}
use of cn.edu.zju.acm.onlinejudge.bean.Forum in project zoj by licheng.
the class ForumPersistenceImplTest method testUpdateForum1.
/**
* Tests updateForum method
* @throws Exception to JUnit
*/
public void testUpdateForum1() throws Exception {
forum1.setName("new name");
forum1.setDescription("new desc");
persistence.updateForum(forum1, 1);
Forum forum11 = persistence.getForum(forum1.getId());
checkForum(forum1, forum11);
}
use of cn.edu.zju.acm.onlinejudge.bean.Forum in project zoj by licheng.
the class ForumPersistenceImplTest method testCreateForum2.
/**
* Tests createForum method
* @throws Exception to JUnit
*/
public void testCreateForum2() throws Exception {
Forum forum1 = new Forum();
forum1.setName("name1");
forum1.setDescription("desc1");
Forum forum2 = new Forum();
forum2.setName("name2");
forum2.setDescription("desc2");
persistence.createForum(forum1, 1);
persistence.createForum(forum2, 1);
Forum forum11 = persistence.getForum(forum1.getId());
checkForum(forum1, forum11);
Forum forum22 = persistence.getForum(forum2.getId());
checkForum(forum2, forum22);
}
Aggregations