use of cn.edu.zju.acm.onlinejudge.bean.enumeration.JudgeReply in project zoj by licheng.
the class SubmissionPersistenceImplTest method testGetJudgeReply1.
/**
* Tests getJudgeReply method
* @throws Exception to JUnit
*/
public void testGetJudgeReply1() throws Exception {
JudgeReply judgeReply = persistence.getJudgeReply(judgeReply1.getId());
checkJudgeReply(judgeReply1, judgeReply);
}
use of cn.edu.zju.acm.onlinejudge.bean.enumeration.JudgeReply in project zoj by licheng.
the class SubmissionPersistenceImplTest method testGetAllJudgeReplies.
/**
* Tests getAllJudgeReplies method
* @throws Exception to JUnit
*/
public void testGetAllJudgeReplies() throws Exception {
List judgeReplies = persistence.getAllJudgeReplies();
for (int i = 0; i < 3; ++i) {
JudgeReply judgeReply = (JudgeReply) judgeReplies.get(i);
long id = judgeReply.getId();
assertEquals("wrong name", "judgeReply" + id, judgeReply.getName());
assertEquals("wrong desc", "JudgeReply " + id, judgeReply.getDescription());
assertEquals("wrong options", "style" + id, judgeReply.getStyle());
assertEquals("wrong compiler", i % 2 == 0, judgeReply.isCommitted());
}
}
use of cn.edu.zju.acm.onlinejudge.bean.enumeration.JudgeReply in project zoj by licheng.
the class SubmissionPersistenceImplTest method testSearchSubmissions7.
/**
* Tests searchSubmissions method
* @throws Exception to JUnit
*/
public void testSearchSubmissions7() throws Exception {
List submissions = null;
SubmissionCriteria criteria = new SubmissionCriteria();
criteria.setJudgeReplies(Arrays.asList(new Object[] { judgeReply1, judgeReply3 }));
submissions = persistence.searchSubmissions(criteria, 0, 100);
checkSubmissions(Arrays.asList(new Object[] { submission1, submission3 }), submissions);
criteria.setJudgeReplies(Arrays.asList(new Object[] { judgeReply2 }));
submissions = persistence.searchSubmissions(criteria, 0, 100);
checkSubmissions(Arrays.asList(new Object[] { submission2, submission4 }), submissions);
criteria.setJudgeReplies(Arrays.asList(new Object[] { new JudgeReply(4, "x", "x", "x", true) }));
submissions = persistence.searchSubmissions(criteria, 0, 100);
checkSubmissions(new ArrayList(), submissions);
criteria.setJudgeReplies(new ArrayList());
submissions = persistence.searchSubmissions(criteria, 0, 100);
checkSubmissions(new ArrayList(), submissions);
}
use of cn.edu.zju.acm.onlinejudge.bean.enumeration.JudgeReply in project zoj by licheng.
the class SubmissionPersistenceImplTest method testGetJudgeReply4.
/**
* Tests getJudgeReply method
* @throws Exception to JUnit
*/
public void testGetJudgeReply4() throws Exception {
JudgeReply judgeReply = persistence.getJudgeReply(1234567890l);
assertNull("no such contest", judgeReply);
}
use of cn.edu.zju.acm.onlinejudge.bean.enumeration.JudgeReply in project zoj by licheng.
the class SubmissionPersistenceImplTest method testCreateJudgeReply.
/**
* Tests createJudgeReply method
* @throws Exception to JUnit
*/
public void testCreateJudgeReply() throws Exception {
persistence.createJudgeReply(new JudgeReply(4, "judgeReply4", "JudgeReply 4", "style4", false), 10);
List judgeReplies = persistence.getAllJudgeReplies();
for (int i = 0; i < 4; ++i) {
JudgeReply judgeReply = (JudgeReply) judgeReplies.get(i);
long id = judgeReply.getId();
assertEquals("wrong name", "judgeReply" + id, judgeReply.getName());
assertEquals("wrong desc", "JudgeReply " + id, judgeReply.getDescription());
assertEquals("wrong options", "style" + id, judgeReply.getStyle());
assertEquals("wrong compiler", i % 2 == 0, judgeReply.isCommitted());
}
}
Aggregations