use of cn.edu.zju.acm.onlinejudge.bean.request.SubmissionCriteria in project zoj by licheng.
the class SubmissionPersistenceImplTest method testSearchSubmissions10.
/**
* Tests searchSubmissions method
* @throws Exception to JUnit
*/
public void testSearchSubmissions10() throws Exception {
List submissions = null;
SubmissionCriteria criteria = new SubmissionCriteria();
submissions = persistence.searchSubmissions(criteria, 0, 0);
checkSubmissions(new ArrayList(), submissions);
submissions = persistence.searchSubmissions(criteria, 0, 1);
checkSubmissions(Arrays.asList(new Object[] { submission1 }), submissions);
submissions = persistence.searchSubmissions(criteria, 0, 4);
checkSubmissions(Arrays.asList(new Object[] { submission1, submission2, submission3, submission4 }), submissions);
submissions = persistence.searchSubmissions(criteria, 1, 2);
checkSubmissions(Arrays.asList(new Object[] { submission2, submission3 }), submissions);
}
use of cn.edu.zju.acm.onlinejudge.bean.request.SubmissionCriteria in project zoj by licheng.
the class SubmissionPersistenceImplTest method testSearchSubmissions4.
/**
* Tests searchSubmissions method
* @throws Exception to JUnit
*/
public void testSearchSubmissions4() throws Exception {
List submissions = null;
SubmissionCriteria criteria = new SubmissionCriteria();
criteria.setIdEnd(new Long(submission2.getId()));
criteria.setIdStart(null);
submissions = persistence.searchSubmissions(criteria, 0, 100);
checkSubmissions(Arrays.asList(new Object[] { submission1, submission2 }), submissions);
criteria.setIdEnd(null);
criteria.setIdStart(new Long(submission3.getId()));
submissions = persistence.searchSubmissions(criteria, 0, 100);
checkSubmissions(Arrays.asList(new Object[] { submission3, submission4 }), submissions);
criteria.setIdEnd(new Long(submission3.getId()));
criteria.setIdStart(new Long(submission2.getId()));
submissions = persistence.searchSubmissions(criteria, 0, 100);
checkSubmissions(Arrays.asList(new Object[] { submission2, submission3 }), submissions);
criteria.setIdEnd(new Long(submission1.getId() - 1));
criteria.setIdStart(null);
submissions = persistence.searchSubmissions(criteria, 0, 100);
checkSubmissions(new ArrayList(), submissions);
criteria.setIdEnd(null);
criteria.setIdStart(new Long(submission4.getId() + 1));
submissions = persistence.searchSubmissions(criteria, 0, 100);
checkSubmissions(new ArrayList(), submissions);
criteria.setIdEnd(new Long(submission2.getId()));
criteria.setIdStart(new Long(submission3.getId()));
submissions = persistence.searchSubmissions(criteria, 0, 100);
checkSubmissions(new ArrayList(), submissions);
}
Aggregations