/*
 * CB3JdbcDaoSupportTest.java
 * Copyright (C) 2008 Cyber Beans Corporation. All rights reserved.
 */
package jp.co.cybec.cb3.accessor.dbaccess;

import jp.co.cybec.cb3.accessor.dbaccess.CB3JdbcDaoSupport;
import jp.co.cybec.cb3.accessor.dbaccess.CB3JdbcTemplate;

import org.junit.Assert;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * CB3JdbcDaoSupportクラスのテストケース
 * @author Lijuan Sun
 */
public class CB3JdbcDaoSupportTest{

	ApplicationContext context = null;

	private static String[] CONTEXT_XML_PATH = new String[] {
			"jp/co/cybec/cb3/accessor/dbaccess/TestDBAccessConfig.xml",
			"datasourceContext.xml",
		};

	/**
	 * {@link jp.co.cybec.cb3.accessor.dbaccess.CB3JdbcDaoSupport} のためのテスト・メソッド。
	 * CB3JdbcTemplateを取得テスト
	 */
	@Test
	public void testGetCB3JdbcTemplate(){
		 context = new ClassPathXmlApplicationContext(CONTEXT_XML_PATH);
		 CB3JdbcDaoSupport dbaccessTmp = (CB3JdbcDaoSupport) context.getBean("CB3JdbcDaoSupport");
		 Assert.assertNotNull(dbaccessTmp.getCB3JdbcTemplate());
		 Assert.assertTrue(dbaccessTmp.getCB3JdbcTemplate() instanceof CB3JdbcTemplate);
	}
}
