Posted on 2010-05-23 19:35
leekiang 阅读(420)
评论(0) 编辑 收藏 所属分类:
测试
public class UsersTest extends AbstractTransactionalDataSourceSpringContextTests {
private IDatabaseTester databaseTester;
@Override
protected void onSetUp() throws Exception {
databaseTester = new JdbcDatabaseTester("oracle.jdbc.driver.OracleDriver",
"jdbc:oracle:thin:@localhost:1521:orcl", "test", "test");
IDataSet dataSet = getDataSet();
databaseTester.setDataSet(dataSet);
databaseTester.onSetup();
}
@Override
protected void onTearDown() throws Exception {
databaseTester.onTearDown();
}
protected IDataSet getDataSet() throws Exception {
String path = "users.xml";
InputStream in = this.getClass().getResourceAsStream(path);
return new FlatXmlDataSetBuilder().build(in);
}
}
Unitils是一个简化测试开发,提高测试维护性的一个工具集
Dbdeploy是Thoughtworks公司开发的数据库工具,获得Jolt大奖