package jp.agentec.abook.abv.bl.logic;

import jp.agentec.abook.abv.bl.common.db.SQLiteOpenHelper;
import jp.agentec.abook.abv.bl.common.db.impl.JDBCSQLiteOpenHelper;
import jp.agentec.abook.abv.bl.data.DBConnector;
import junit.framework.TestCase;

public class ContentPageReadingLogLogicTest extends TestCase {

	private ContentPageReadingLogLogic logic = AbstractLogic.getLogic(ContentPageReadingLogLogic.class);

	@Override
	protected void setUp() throws Exception {
		super.setUp();

		DBConnector conn = DBConnector.getInstance();
		SQLiteOpenHelper sqlLiteOpenHelper = new JDBCSQLiteOpenHelper("test.db", 0);
		conn.setSqlLiteOpenHelper(sqlLiteOpenHelper);
		((JDBCSQLiteOpenHelper) sqlLiteOpenHelper).onCreate(conn.getDatabase());
	}

	@Override
	protected void tearDown() throws Exception {
		super.tearDown();
	}

	public void testContentPageReadLog() throws Exception {
//		logic.startContentPageReadLog(1443, 1, 10);
//		logic.pauseContentPageReadLog(1443, 10);
//		logic.startContentPageReadLog(1443, 1, 10);
		logic.endContentPageReadLog(1443, 10);
	}
	
	public void testGetContentPageReadLogJson(){
		System.out.println(logic.getContentPageReadLogJson(1443, 1));
	}
}
