Apply patch by sebb from
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 30 Jun 2009 19:15:28 +0000 (19:15 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 30 Jun 2009 19:15:28 +0000 (19:15 +0000)
https://issues.apache.org/bugzilla/show_bug.cgi?id=47458
Store db properties in build.properties using a prefix of testdb

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@789883 13f79535-47bb-0310-9956-ffa450edef68

modules/jdbc-pool/build.properties.default
modules/jdbc-pool/build.xml

index 5e68b40..0809ed0 100644 (file)
@@ -41,6 +41,27 @@ compile.source=1.5
 compile.target=1.5
 compile.debug=true
 
+# ----- Settings for Junit test database.
+
+# Common settings
+testdb.username=root
+testdb.password=password
+
+# H2
+testdb.url=jdbc:h2x:~/.h2/test;QUERY_TIMEOUT=0;DB_CLOSE_ON_EXIT=FALSE
+testdb.driverClassName=org.h2.Driver
+testdb.validationQuery=SELECT 1
+
+# MySQL
+#testdb.url=jdbc:mysql://localhost:3306/mysql?autoReconnect=true
+#testdb.driverClassName=com.mysql.jdbc.Driver
+#testdb.validationQuery=SELECT 1
+
+# Derby
+#testdb.url=jdbc:derby:derbyDB;create=true
+#testdb.driverClassName=org.apache.derby.jdbc.EmbeddedDriver
+#testdb.validationQuery=VALUES 1       
+
 # ----- JUnit Unit Test Suite, version 3.7 or later -----
 junit.home=${base.path}/junit3.8.2
 junit.lib=${junit.home}
index 822401c..60959bb 100644 (file)
     </antcall>
   </target>
   
+  <!-- Extract the testdb.* properties and remove the leading testdb. -->
+  <propertyset dynamic="false" id="testdb">
+       <propertyref prefix="testdb"/>
+       <mapper type="regexp" from="^testdb\.(.*)$$" to="\1"/>
+  </propertyset>
+
   <target name="test" depends="build,build-test">
     <echo/>
     <echo>Creating test table for test purposes.</echo>
     <junit printsummary="withOutAndErr" showoutput="on">
+      <syspropertyset refid="testdb"/>
       <classpath refid="tomcat.jdbc.classpath"/>
       <classpath refid="test.classpath"/>
       <batchtest fork="yes" todir="${tomcat.testclasses}">
     <echo/>
     <echo>Performance and fairness tests.</echo>
     <junit printsummary="withOutAndErr" showoutput="on">
+      <syspropertyset refid="testdb"/>
       <classpath refid="tomcat.jdbc.classpath"/>
       <classpath refid="test.classpath"/>
       <batchtest fork="yes" todir="${tomcat.testclasses}">
     <echo/>
     <echo>Functional tests.</echo>
     <junit printsummary="yes">
+      <syspropertyset refid="testdb"/>
       <formatter type="plain"/>
       <classpath refid="tomcat.jdbc.classpath"/>
       <classpath refid="test.classpath"/>