On 30/06/2009, fha...@apache.org <fha...@apache.org> wrote:
> Author: fhanik
>  Date: Tue Jun 30 19:15:28 2009
>  New Revision: 789883
>
>  URL: http://svn.apache.org/viewvc?rev=789883&view=rev
>  Log:
>  Apply patch by sebb from
>  https://issues.apache.org/bugzilla/show_bug.cgi?id=47458
>  Store db properties in build.properties using a prefix of testdb
>
>  Modified:
>     tomcat/trunk/modules/jdbc-pool/build.properties.default
>     tomcat/trunk/modules/jdbc-pool/build.xml
>
>  Modified: tomcat/trunk/modules/jdbc-pool/build.properties.default
>  URL: 
> http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/build.properties.default?rev=789883&r1=789882&r2=789883&view=diff
>  
> ==============================================================================
>  --- tomcat/trunk/modules/jdbc-pool/build.properties.default (original)
>  +++ tomcat/trunk/modules/jdbc-pool/build.properties.default Tue Jun 30 
> 19:15:28 2009
>  @@ -41,6 +41,27 @@
>   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

Oops, sorry, I was testing the code to ensure that the properties were
picked up OK, and accidentally left in an error:

":h2x:" should be ":h2:"

otherwise tests will fail.

>  +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}
>
>  Modified: tomcat/trunk/modules/jdbc-pool/build.xml
>  URL: 
> http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/build.xml?rev=789883&r1=789882&r2=789883&view=diff
>  
> ==============================================================================
>  --- tomcat/trunk/modules/jdbc-pool/build.xml (original)
>  +++ tomcat/trunk/modules/jdbc-pool/build.xml Tue Jun 30 19:15:28 2009
>  @@ -367,10 +367,17 @@
>      </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}">
>  @@ -383,6 +390,7 @@
>      <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}">
>  @@ -398,6 +406,7 @@
>      <echo/>
>      <echo>Functional tests.</echo>
>      <junit printsummary="yes">
>  +      <syspropertyset refid="testdb"/>
>        <formatter type="plain"/>
>        <classpath refid="tomcat.jdbc.classpath"/>
>        <classpath refid="test.classpath"/>
>
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
>  For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to