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

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


  /**
   * Tests getProblem method
   * @throws Exception to JUnit
   */
  public void testGetProblem1() throws Exception {   
    Problem problem = persistence.getProblem(problem1.getId());   
    checkProblem(problem1, problem);       
  }
View Full Code Here


  /**
   * Tests getProblem method
   * @throws Exception to JUnit
   */
  public void testGetProblem2() throws Exception {   
    Problem problem = persistence.getProblem(problem2.getId());   
    checkProblem(problem2, problem);       
  }
View Full Code Here

  /**
   * Tests getProblem method
   * @throws Exception to JUnit
   */
  public void testGetProblem3() throws Exception {   
    Problem problem = persistence.getProblem(problem3.getId());   
    checkProblem(problem3, problem);       
  }
View Full Code Here

  /**
   * Tests getProblem method
   * @throws Exception to JUnit
   */
  public void testGetProblem4() throws Exception {   
    Problem problem = persistence.getProblem(1234567890l);   
    assertNull("no such problem", problem);       
  }
View Full Code Here

    problem1.setTitle("new title" + id);   
 
   
    persistence.updateProblem(problem1, 11);
   
    Problem problem = (Problem) persistence.getProblem(problem1.getId());   
    checkProblem(problem1, problem);       
   
  }
View Full Code Here

    problem2.setSource("new source" + id);
    problem2.setTitle("new title" + id);   
     
    persistence.updateProblem(problem2, 11);
   
    Problem problem = (Problem) persistence.getProblem(problem2.getId());   
    checkProblem(problem2, problem)
  }
View Full Code Here

    problem3.setSource("new source" + id);
    problem3.setTitle("new title" + id);   
     
    persistence.updateProblem(problem3, 11);
   
    Problem problem = (Problem) persistence.getProblem(problem3.getId());   
    checkProblem(problem3, problem);     
   
  }
View Full Code Here

   * @param limit the limit
   * @param languages  a list of languages
   * @return a new Problem instance
   */
  private Problem newProblem(long id, long contestId, Limit limit) {
    Problem problem = new Problem();
    problem.setId(id);
    problem.setContestId(contestId);
    problem.setCode("code" + id);
    problem.setAuthor("author" + id);
    problem.setChecker(id % 2 == 1);
    problem.setContest("contest" + id);
    problem.setLimit(limit);
    problem.setRevision((int) id * 10);
    problem.setSource("source" + id);
    problem.setTitle("title" + id);   
    return problem;
 
View Full Code Here

    int sourcefrom = Integer.parseInt(temp);
   
    List<Problem> problems =
            ContestManager.getInstance().getContestProblems(contest.getId());
    for(int i=0;i<problems.size();++i) {
      Problem p=problems.get(i);
      if(p.getTitle()!=null) {
        if(p.getTitle().toLowerCase().indexOf(query)>=0) {
          TitleQueryResult.add(p);
        }
      }
      if(p.getAuthor()!=null) {
        if(p.getAuthor().toLowerCase().indexOf(query)>=0) {
          AuthorQueryResult.add(p);
        }
      }
      if(p.getSource()!=null) {
        if(p.getSource().toLowerCase().indexOf(query)>=0) {
          SourceQueryResult.add(p);
        }
      }
    }
   
View Full Code Here

TOP

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

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.