改造测试用例
tfw.integration_demo._04_spring_web_mvc._02_crud._01_basic_jdbc_crud.UserMgrTestCase
,测试数据源配置文件的正确性:
……
public class UserMgrTestCase
{
private String strClasspathConfFile =
"tfw/integration_demo/_04_spring_web_mvc/applicationContext.xml";
@Test
public void testObjects()
throws FileNotFoundException, SQLException
{
……
Properties props = actxt.getBean("dsProps", Properties.class);
System.out.println("Connection Configuration:\n\t" + props);
DataSource ds = actxt.getBean("ds", DataSource.class);
System.out.println("Data Source:\n\t" + ds);
Connection cnct = ds.getConnection();
System.out.println("Connection:\n\t" + cnct);
cnct.close();
System.out.println("Connection Closed:\n\t" + cnct);
actxt.close();
System.out.println("Application Context Closed:\n\t" + actxt);
}
}