Examples of JudgeReply


Examples of cn.edu.zju.acm.onlinejudge.bean.enumeration.JudgeReply

        Language language = languageMap.get(languageId);
        submission.setLanguage(language);

        // set judge reply
        long judgeReplyId = rs.getLong(DatabaseConstants.SUBMISSION_JUDGE_REPLY_ID);
        JudgeReply judgeReply = JudgeReply.findById(judgeReplyId);
        submission.setJudgeReply(judgeReply);

        return submission;
    }
View Full Code Here

Examples of cn.edu.zju.acm.onlinejudge.bean.enumeration.JudgeReply

    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);
View Full Code Here

Examples of cn.edu.zju.acm.onlinejudge.bean.enumeration.JudgeReply

  /**
   * Tests getJudgeReply method
   * @throws Exception to JUnit
   */
  public void testGetJudgeReply1() throws Exception {   
    JudgeReply judgeReply = persistence.getJudgeReply(judgeReply1.getId());   
    checkJudgeReply(judgeReply1, judgeReply);       
  }
View Full Code Here

Examples of cn.edu.zju.acm.onlinejudge.bean.enumeration.JudgeReply

  /**
   * Tests getJudgeReply method
   * @throws Exception to JUnit
   */
  public void testGetJudgeReply2() throws Exception {   
    JudgeReply judgeReply = persistence.getJudgeReply(judgeReply1.getId());   
    checkJudgeReply(judgeReply1, judgeReply);       
  }
View Full Code Here

Examples of cn.edu.zju.acm.onlinejudge.bean.enumeration.JudgeReply

  /**
   * Tests getJudgeReply method
   * @throws Exception to JUnit
   */
  public void testGetJudgeReply3() throws Exception {   
    JudgeReply judgeReply = persistence.getJudgeReply(judgeReply1.getId());   
    checkJudgeReply(judgeReply1, judgeReply);       
  }
View Full Code Here

Examples of cn.edu.zju.acm.onlinejudge.bean.enumeration.JudgeReply

  /**
   * Tests getJudgeReply method
   * @throws Exception to JUnit
   */
  public void testGetJudgeReply4() throws Exception {   
    JudgeReply judgeReply = persistence.getJudgeReply(1234567890l);     
    assertNull("no such contest", judgeReply);       
  }
View Full Code Here

Examples of cn.edu.zju.acm.onlinejudge.bean.enumeration.JudgeReply

   */
  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());           
    }
  }
View Full Code Here

Examples of cn.edu.zju.acm.onlinejudge.bean.enumeration.JudgeReply

   * 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());           
    }
  }
View Full Code Here

Examples of cn.edu.zju.acm.onlinejudge.bean.enumeration.JudgeReply

   */
  public void testUpdateJudgeReply() throws Exception {   
   
    List judgeReplies = persistence.getAllJudgeReplies();
    for (int i = 0; i < 3; ++i) {
      JudgeReply judgeReply = (JudgeReply) judgeReplies.get(i);     
      long id = judgeReply.getId();   
      persistence.updateJudgeReply(
          new JudgeReply(id, "new judgeReply" + id, "new JudgeReply " + id, "new style" + id, i % 2 == 1), 10);
    }
   
    judgeReplies = persistence.getAllJudgeReplies();
    for (int i = 0; i < 3; ++i) {
      JudgeReply judgeReply = (JudgeReply) judgeReplies.get(i);
      long id = judgeReply.getId();     
      assertEquals("wrong name", "new judgeReply" + id, judgeReply.getName());
      assertEquals("wrong desc", "new JudgeReply " + id, judgeReply.getDescription());
      assertEquals("wrong options", "new style" + id, judgeReply.getStyle());
      assertEquals("wrong compiler", i %2 == 1, judgeReply.isCommitted());           
    }   
  }
View Full Code Here

Examples of cn.edu.zju.acm.onlinejudge.bean.enumeration.JudgeReply

   */
  public void testDeleteJudgeReply() throws Exception {   
   
    List judgeReplies = persistence.getAllJudgeReplies();
    for (int i = 0; i < 3; ++i) {
      JudgeReply judgeReply = (JudgeReply) judgeReplies.get(i);     
      long id = judgeReply.getId();   
      persistence.deleteJudgeReply(id, 10);
    }
     
    judgeReplies = persistence.getAllJudgeReplies();
    assertEquals("wrong size", 0, judgeReplies.size());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.