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

import java.util.List;

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 jp.agentec.abook.abv.bl.dto.MydataDto;
import junit.framework.TestCase;



public class MyDataLogicTest extends TestCase {

	private MyDataLogic logic = AbstractLogic.getLogic(MyDataLogic.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 testGetMyDataList() throws Exception {
//		List<MyDataDto> list = logic.getMyDataList("readingdate", 2434L);
		List<MydataDto> list = logic.getMyDataList("bookmark", 2434L);

		for (MydataDto dto : list) {
			System.out.println(dto);
		}
	}
}
