Package cn.edu.zju.acm.onlinejudge.bean

Examples of cn.edu.zju.acm.onlinejudge.bean.Problemset


  /**
   * Tests getContest method
   * @throws Exception to JUnit
   */
  public void testGetContest3() throws Exception {   
    Problemset contest = (Problemset) persistence.getContest(problemset1.getId());   
    checkAbstractContest(problemset1, contest);       
  }
View Full Code Here


  /**
   * Tests getContest method
   * @throws Exception to JUnit
   */
  public void testGetContest4() throws Exception {   
    Problemset contest = (Problemset) persistence.getContest(problemset2.getId());   
    checkAbstractContest(problemset2, contest);       
  }
View Full Code Here

    problemset1.setLimit(null);
    problemset1.setForumId(forum2.getId());
   
    persistence.updateContest(problemset1, 11);
   
    Problemset contest = (Problemset) persistence.getContest(problemset1.getId());   
    checkAbstractContest(problemset1, contest);       
   
  }
View Full Code Here

    problemset2.setLimit(limit2);
    problemset2.setForumId(forum1.getId());
   
    persistence.updateContest(problemset2, 11);
   
    Problemset contest = (Problemset) persistence.getContest(problemset2.getId());   
    checkAbstractContest(problemset2, contest);       
   
  }
View Full Code Here

   * @throws Exception to JUnit
   */
  public void testGetAllProblemsets() throws Exception {
    List contests = persistence.getAllProblemsets();
    assertEquals("wrong size", 2, contests.size());
    Problemset contest = (Problemset) contests.get(0);
    checkAbstractContest(problemset1, contest);   
   
    contest = (Problemset) contests.get(1);
    checkAbstractContest(problemset2, contest);
           
View Full Code Here

   * @param limit the limit
   * @param languages  a list of languages
   * @return a new problemset instance
   */
  private Problemset newProblemset(long id, long forumId, Limit limit, List languages) {
    Problemset contest = new Problemset();
    contest.setId(id);
    contest.setDescription("desc" + id);
    contest.setLimit(limit);
    contest.setLanguages(languages);
    contest.setTitle("title" + id);
    contest.setForumId(forumId);
    return contest;
  }
View Full Code Here

     */
    private AbstractContest populateContest(ResultSet rs) throws SQLException {
      AbstractContest contest = null;
        int contestType=rs.getInt(DatabaseConstants.CONTEST_PROBLEMSET);
        if (contestType==1) {
            contest = new Problemset();
        } else if (contestType==0) {
            contest = new Contest();
        } else {
            contest = new Course();
        }
View Full Code Here

    }

    public AbstractContest toContest() throws ParseException, NumberFormatException, PersistenceException {
        AbstractContest contest = null;
        if (this.contestType == 1) {
            contest = new Problemset();
        } else if (this.contestType == 0) {
            contest = new Contest();
        } else {
          contest = new Course();
        }
View Full Code Here

   * @param limit the limit
   * @param languages  a list of languages
   * @return a new problemset instance
   */
  private Problemset newProblemset(long id, long forumId, Limit limit, List languages) {
    Problemset problem = new Problemset();
    problem.setId(id);
    problem.setDescription("desc" + id);
    problem.setLimit(limit);
    problem.setLanguages(languages);
    problem.setTitle("title" + id);
    problem.setForumId(forumId);
    return problem;
  }
View Full Code Here

TOP

Related Classes of cn.edu.zju.acm.onlinejudge.bean.Problemset

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.