数据初始化的SQL分类型,以支持对远程的真实数据库执行functional test

This commit is contained in:
Calvin
2013-01-20 18:06:07 +08:00
parent bc404eb6ee
commit 45e42e24e7
12 changed files with 15 additions and 10 deletions
@@ -87,6 +87,8 @@ public class BaseFunctionalTestCase {
* 载入测试数据.
*/
protected static void reloadSampleData() throws Exception {
DataFixtures.executeScript(dataSource, "classpath:data/cleanup-data.sql", "classpath:data/import-data.sql");
String dbType = propertiesLoader.getProperty("db.type", "h2");
DataFixtures.executeScript(dataSource, "classpath:data/" + dbType + "cleanup-data.sql", "classpath:data/"
+ dbType + "import-data.sql");
}
}
@@ -5,6 +5,7 @@ embeddedForLocal=true
selenium.driver=firefox
#(optional)override jdbc url for functional test
db.type=h2
jdbc.driver=org.h2.Driver
jdbc.url=jdbc:h2:file:~/.h2/quickstart-test;AUTO_SERVER=TRUE
jdbc.username=sa