diff --git a/examples/quickstart/pom.xml b/examples/quickstart/pom.xml index c17f6af5..a3939eb4 100644 --- a/examples/quickstart/pom.xml +++ b/examples/quickstart/pom.xml @@ -664,7 +664,6 @@ refresh-db - org.apache.maven.plugins @@ -676,7 +675,7 @@ - + diff --git a/examples/quickstart/src/main/resources/applicationContext.xml b/examples/quickstart/src/main/resources/applicationContext.xml index b23fff61..3735665f 100644 --- a/examples/quickstart/src/main/resources/applicationContext.xml +++ b/examples/quickstart/src/main/resources/applicationContext.xml @@ -115,7 +115,7 @@ - + @@ -136,7 +136,7 @@ - + \ No newline at end of file diff --git a/examples/quickstart/src/test/functional/org/springside/examples/quickstart/functional/BaseFunctionalTestCase.java b/examples/quickstart/src/test/functional/org/springside/examples/quickstart/functional/BaseFunctionalTestCase.java index bbdf1781..20fdf2ec 100644 --- a/examples/quickstart/src/test/functional/org/springside/examples/quickstart/functional/BaseFunctionalTestCase.java +++ b/examples/quickstart/src/test/functional/org/springside/examples/quickstart/functional/BaseFunctionalTestCase.java @@ -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"); } } \ No newline at end of file diff --git a/examples/quickstart/src/test/resources/application.functional.properties b/examples/quickstart/src/test/resources/application.functional.properties index 9b2905ba..05f9cc01 100644 --- a/examples/quickstart/src/test/resources/application.functional.properties +++ b/examples/quickstart/src/test/resources/application.functional.properties @@ -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 diff --git a/examples/quickstart/src/test/resources/data/cleanup-data.sql b/examples/quickstart/src/test/resources/data/h2/cleanup-data.sql similarity index 100% rename from examples/quickstart/src/test/resources/data/cleanup-data.sql rename to examples/quickstart/src/test/resources/data/h2/cleanup-data.sql diff --git a/examples/quickstart/src/test/resources/data/import-data.sql b/examples/quickstart/src/test/resources/data/h2/import-data.sql similarity index 100% rename from examples/quickstart/src/test/resources/data/import-data.sql rename to examples/quickstart/src/test/resources/data/h2/import-data.sql diff --git a/examples/showcase/pom.xml b/examples/showcase/pom.xml index b6558f76..1bba2785 100644 --- a/examples/showcase/pom.xml +++ b/examples/showcase/pom.xml @@ -548,7 +548,7 @@ - + diff --git a/examples/showcase/src/main/resources/applicationContext.xml b/examples/showcase/src/main/resources/applicationContext.xml index 183c6001..6082d5b6 100644 --- a/examples/showcase/src/main/resources/applicationContext.xml +++ b/examples/showcase/src/main/resources/applicationContext.xml @@ -153,11 +153,11 @@ - + - + @@ -186,7 +186,7 @@ - + diff --git a/examples/showcase/src/test/functional/org/springside/examples/showcase/functional/BaseFunctionalTestCase.java b/examples/showcase/src/test/functional/org/springside/examples/showcase/functional/BaseFunctionalTestCase.java index c27301eb..3e00161a 100644 --- a/examples/showcase/src/test/functional/org/springside/examples/showcase/functional/BaseFunctionalTestCase.java +++ b/examples/showcase/src/test/functional/org/springside/examples/showcase/functional/BaseFunctionalTestCase.java @@ -81,6 +81,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"); } } diff --git a/examples/showcase/src/test/resources/application.functional.properties b/examples/showcase/src/test/resources/application.functional.properties index c81675ff..86d0b8eb 100644 --- a/examples/showcase/src/test/resources/application.functional.properties +++ b/examples/showcase/src/test/resources/application.functional.properties @@ -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/showcase4-test;AUTO_SERVER=TRUE jdbc.username=sa diff --git a/examples/showcase/src/test/resources/data/cleanup-data.sql b/examples/showcase/src/test/resources/data/h2/cleanup-data.sql similarity index 100% rename from examples/showcase/src/test/resources/data/cleanup-data.sql rename to examples/showcase/src/test/resources/data/h2/cleanup-data.sql diff --git a/examples/showcase/src/test/resources/data/import-data.sql b/examples/showcase/src/test/resources/data/h2/import-data.sql similarity index 100% rename from examples/showcase/src/test/resources/data/import-data.sql rename to examples/showcase/src/test/resources/data/h2/import-data.sql