Examples of Thread


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

            try {
                ps = conn.prepareStatement(ForumPersistenceImpl.GET_THREAD);
                ps.setLong(1, id);
                ResultSet rs = ps.executeQuery();
                if (rs.next()) {
                    Thread thread = new Thread();
                    thread.setId(rs.getLong(DatabaseConstants.THREAD_THREAD_ID));
                    thread.setForumId(rs.getLong(DatabaseConstants.THREAD_FORUM_ID));
                    thread.setUserProfileId(rs.getLong(DatabaseConstants.THREAD_USER_PROFILE_ID));
                    thread.setTitle(rs.getString(DatabaseConstants.THREAD_TITLE));
                    return thread;
                } else {
                    return null;
                }
            } finally {
View Full Code Here

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

   * Tests getThread method
   * @throws Exception to JUnit
   */
  public void testGetThread() throws Exception {   
   
    Thread thread = persistence.getThread(thread1.getId());
    checkThread(thread1, thread);   
  }
View Full Code Here

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

   * @throws Exception to JUnit
   */
  public void testCreateThread1() throws Exception {   
   
   
    Thread thread = newThread(-1, forum1.getId(), profile.getId());
    persistence.createThread(thread, 1);
   
    Thread newThread = persistence.getThread(thread.getId());
    checkThread(thread, newThread);   

  }
View Full Code Here

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

   */
  public void testUpdateThread1() throws Exception {
    thread1.setId(thread2.getId());
    persistence.updateThread(thread1, 1);
       
    Thread thread = persistence.getThread(thread1.getId());
    checkThread(thread1, thread)
   
  }
View Full Code Here

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

   * @param forumId the forum id
   * @param userId the user id
   * @return a new thread instance
   */
  private Thread newThread(long id, long forumId, long userId) {
    Thread thread = new Thread();
    thread.setId(id);
    thread.setForumId(forumId);
    thread.setUserProfileId(userId);
    thread.setTitle("thread title" + id);
    return thread;
  }
View Full Code Here

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

   * Tests getThread method
   * @throws Exception to JUnit
   */
  public void testGetThread() throws Exception {   
   
    Thread thread = persistence.getThread(thread1.getId());
    checkThread(thread1, thread);   
  }
View Full Code Here

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

   * @throws Exception to JUnit
   */
  public void testCreateThread1() throws Exception {   
   
   
    Thread thread = newThread(-1, forum1.getId(), profile.getId());
    persistence.createThread(thread, 1);
   
    Thread newThread = persistence.getThread(thread.getId());
    checkThread(thread, newThread);   

  }
View Full Code Here

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

   */
  public void testUpdateThread1() throws Exception {
    thread1.setId(thread2.getId());
    persistence.updateThread(thread1, 1);
       
    Thread thread = persistence.getThread(thread1.getId());
    checkThread(thread1, thread)
   
  }
View Full Code Here

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

   * @param forumId the forum id
   * @param userId the user id
   * @return a new thread instance
   */
  private Thread newThread(long id, long forumId, long userId) {
    Thread thread = new Thread();
    thread.setId(id);
    thread.setForumId(forumId);
    thread.setUserProfileId(userId);
    thread.setTitle("thread title" + id);
    return thread;
  }
View Full Code Here

Examples of java.lang.Thread

     * A new method that interrupts the worker thread.  Call this method
     * to force the worker to stop what it's doing.
     */
    public void interrupt()
    {
        Thread t = threadVar.get();
        if (t != null)
        {
            t.interrupt();
        }
        threadVar.clear();
    }
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.