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

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


   * @throws Exception to JUnit
   */
  public void testCreatePost1() throws Exception {   
   
   
    Post post = newPost(-1, thread1.getId(), profile.getId());
    persistence.createPost(post, 1);
   
    Post newPost = persistence.getPost(post.getId());
    checkPost(post, newPost);   

  }
View Full Code Here


   */
  public void testUpdatePost1() throws Exception {
    post1.setId(post2.getId());
    persistence.updatePost(post1, 1);
       
    Post post = persistence.getPost(post1.getId());
    checkPost(post1, post)
   
  }
View Full Code Here

   * @param count the count
   */
  private void checkPostList(List posts1, int offset1, List posts2, int offset2, int count) {
   
    for (int i = 0; i < count; ++i) {
      Post post1 = (Post) posts1.get(offset1 + i);
      Post post2 = (Post) posts2.get(offset2 + i);
      checkPost(post1, post2);
    }     
  }
View Full Code Here

   * @param threadId the thread id
   * @param userId the user id
   * @return a new post instance
   */
  private Post newPost(long id, long threadId, long userId) {
    Post post = new Post();
    post.setId(id);
    post.setThreadId(threadId);
    post.setUserProfileId(userId);
    post.setContent("post content" + id);   
    return post;
  }
View Full Code Here

TOP

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

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.