Search in sources :

Example 6 with Thread

use of cn.edu.zju.acm.onlinejudge.bean.Thread in project zoj by licheng.

the class ForumPersistenceImplTest method testUpdateThread1.

/**
	 * Tests updateThread method
	 * @throws Exception to JUnit
	 */
public void testUpdateThread1() throws Exception {
    thread1.setId(thread2.getId());
    persistence.updateThread(thread1, 1);
    Thread thread = persistence.getThread(thread1.getId());
    checkThread(thread1, thread);
}
Also used : Thread(cn.edu.zju.acm.onlinejudge.bean.Thread)

Example 7 with Thread

use of cn.edu.zju.acm.onlinejudge.bean.Thread in project zoj by licheng.

the class ForumPersistenceImplTest method newThread.

/**
	 * Creates a new thread.
	 * @param id the id
	 * @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;
}
Also used : Thread(cn.edu.zju.acm.onlinejudge.bean.Thread)

Example 8 with Thread

use of cn.edu.zju.acm.onlinejudge.bean.Thread in project zoj by licheng.

the class AuthorizationPersistenceImplTest method testUpdateThread1.

/**
	 * Tests updateThread method
	 * @throws Exception to JUnit
	 */
public void testUpdateThread1() throws Exception {
    thread1.setId(thread2.getId());
    persistence.updateThread(thread1, 1);
    Thread thread = persistence.getThread(thread1.getId());
    checkThread(thread1, thread);
}
Also used : Thread(cn.edu.zju.acm.onlinejudge.bean.Thread)

Example 9 with Thread

use of cn.edu.zju.acm.onlinejudge.bean.Thread in project zoj by licheng.

the class AuthorizationPersistenceImplTest method testCreateThread1.

/**
	 * Tests createThread method
	 * @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);
}
Also used : Thread(cn.edu.zju.acm.onlinejudge.bean.Thread)

Aggregations

Thread (cn.edu.zju.acm.onlinejudge.bean.Thread)9 PersistenceException (cn.edu.zju.acm.onlinejudge.persistence.PersistenceException)1 Connection (java.sql.Connection)1 PreparedStatement (java.sql.PreparedStatement)1 ResultSet (java.sql.ResultSet)1 SQLException (java.sql.SQLException)1