use of cn.edu.zju.acm.onlinejudge.bean.request.SubmissionCriteria in project zoj by licheng.
the class SubmissionPersistenceImplTest method testSearchSubmissions2.
/**
* Tests searchSubmissions method
* @throws Exception to JUnit
*/
public void testSearchSubmissions2() throws Exception {
List submissions = null;
SubmissionCriteria criteria = new SubmissionCriteria();
criteria.setContestId(new Long(contest.getId()));
submissions = persistence.searchSubmissions(criteria, 0, 100);
checkSubmissions(Arrays.asList(new Object[] { submission1, submission2, submission3, submission4 }), submissions);
criteria.setContestId(new Long(1234567890l));
submissions = persistence.searchSubmissions(criteria, 0, 100);
checkSubmissions(new ArrayList(), submissions);
}
use of cn.edu.zju.acm.onlinejudge.bean.request.SubmissionCriteria in project zoj by licheng.
the class SubmissionPersistenceImplTest method testSearchSubmissions1.
/**
* Tests searchSubmissions method
* @throws Exception to JUnit
*/
public void testSearchSubmissions1() throws Exception {
List submissions = null;
SubmissionCriteria criteria = new SubmissionCriteria();
criteria.setProblemId(new Long(problem2.getId()));
submissions = persistence.searchSubmissions(criteria, 0, 100);
checkSubmissions(Arrays.asList(new Object[] { submission2, submission3, submission4 }), submissions);
criteria.setProblemId(new Long(problem1.getId()));
submissions = persistence.searchSubmissions(criteria, 0, 100);
checkSubmissions(Arrays.asList(new Object[] { submission1 }), submissions);
criteria.setProblemId(new Long(1234567890l));
submissions = persistence.searchSubmissions(criteria, 0, 100);
checkSubmissions(new ArrayList(), submissions);
}
use of cn.edu.zju.acm.onlinejudge.bean.request.SubmissionCriteria in project zoj by licheng.
the class SubmissionPersistenceImplTest method testSearchSubmissions6.
/**
* Tests searchSubmissions method
* @throws Exception to JUnit
*/
public void testSearchSubmissions6() throws Exception {
List submissions = null;
SubmissionCriteria criteria = new SubmissionCriteria();
criteria.setLanguages(Arrays.asList(new Object[] { language1, language3 }));
submissions = persistence.searchSubmissions(criteria, 0, 100);
checkSubmissions(Arrays.asList(new Object[] { submission1, submission3, submission4 }), submissions);
criteria.setLanguages(Arrays.asList(new Object[] { language2 }));
submissions = persistence.searchSubmissions(criteria, 0, 100);
checkSubmissions(Arrays.asList(new Object[] { submission2 }), submissions);
criteria.setLanguages(Arrays.asList(new Object[] { new Language(4, "x", "x", "x", "x") }));
submissions = persistence.searchSubmissions(criteria, 0, 100);
checkSubmissions(new ArrayList(), submissions);
criteria.setLanguages(new ArrayList());
submissions = persistence.searchSubmissions(criteria, 0, 100);
checkSubmissions(new ArrayList(), submissions);
}
use of cn.edu.zju.acm.onlinejudge.bean.request.SubmissionCriteria in project zoj by licheng.
the class SubmissionPersistenceImplTest method testSearchSubmissions3.
/**
* Tests searchSubmissions method
* @throws Exception to JUnit
*/
public void testSearchSubmissions3() throws Exception {
List submissions = null;
SubmissionCriteria criteria = new SubmissionCriteria();
criteria.setHandle(userProfile1.getHandle());
submissions = persistence.searchSubmissions(criteria, 0, 100);
checkSubmissions(Arrays.asList(new Object[] { submission1, submission2, submission4 }), submissions);
criteria.setHandle(userProfile2.getHandle());
submissions = persistence.searchSubmissions(criteria, 0, 100);
checkSubmissions(Arrays.asList(new Object[] { submission3 }), submissions);
criteria.setHandle("foobar");
submissions = persistence.searchSubmissions(criteria, 0, 100);
checkSubmissions(new ArrayList(), submissions);
}
use of cn.edu.zju.acm.onlinejudge.bean.request.SubmissionCriteria in project zoj by licheng.
the class SubmissionPersistenceImplTest method testSearchSubmissions9.
/**
* Tests searchSubmissions method
* @throws Exception to JUnit
*/
public void testSearchSubmissions9() throws Exception {
List submissions = null;
SubmissionCriteria criteria = new SubmissionCriteria();
submissions = persistence.searchSubmissions(criteria, 0, 100);
checkSubmissions(Arrays.asList(new Object[] { submission1, submission2, submission3, submission4 }), submissions);
persistence.deleteSubmission(submission2.getId(), 11);
submissions = persistence.searchSubmissions(criteria, 0, 100);
checkSubmissions(Arrays.asList(new Object[] { submission1, submission3, submission4 }), submissions);
}
Aggregations