|
<?xml version='1.0'?> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<project name="MySQL Connector/J" default="dist" basedir="."> |
|
|
|
<property file="build.properties"/> |
|
|
|
<property name="major_version" value="5"/> |
|
<property name="minor_version" value="1"/> |
|
<property name="subminor_version" value="10"/> |
|
<property name="version_status" value=""/> |
|
|
|
<property name="version" value="${major_version}.${minor_version}.${subminor_version}${version_status}"/> |
|
<property name="prodName" value="mysql-connector-java"/> |
|
<property name="extra.version" value=""/> |
|
<property name="full.version" value="${version}${extra.version}"/> |
|
<property name="fullProdName" value="${prodName}-${version}${extra.version}"/> |
|
<property name="sourceDir" value="./src"/> |
|
<property name="buildDir" value="./build"/> |
|
<property name="distDir" value="./dist"/> |
|
<property name="junit.results" value="${buildDir}/junit"/> |
|
<property name="debug.enable" value="on" /> |
|
|
|
|
|
|
|
<condition property="compiler.output" value="bin" else="${buildDir}/${fullProdName}"> |
|
<or> |
|
<isset property="eclipse.running" /> |
|
<isset property="eclipse.pdebuild.home" /> |
|
<contains string="${ant.home}" substring="plugins" /> |
|
</or> |
|
</condition> |
|
|
|
<echo>Compiling class files to ${compiler.output}...</echo> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<property name="com.mysql.jdbc.java6.java" value="/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/bin/java" /> |
|
<property name="com.mysql.jdbc.java6.javac" value="/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/bin/javac" /> |
|
<property name="com.mysql.jdbc.java6.rtjar" value="/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Classes/classes.jar" /> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<property name="com.mysql.jdbc.docs.sourceDir" value="/home/mmatthew/work/docs/prebuilt"/> |
|
|
|
<taskdef resource="net/sf/antcontrib/antlib.xml"> |
|
<classpath> |
|
<pathelement location="${sourceDir}/lib/ant-contrib.jar"/> |
|
</classpath> |
|
</taskdef> |
|
|
|
<path id="built.driver.only.classpath"> |
|
<pathelement location="${buildDir}/${fullProdName}" /> |
|
</path> |
|
|
|
<path id="project.build.classpath"> |
|
<fileset dir="${buildDir}/${fullProdName}/lib-nodist"> |
|
<include name="**/*.jar"/> |
|
</fileset> |
|
|
|
<fileset dir="${buildDir}/${fullProdName}/lib"> |
|
<include name="**/*.jar"/> |
|
</fileset> |
|
|
|
<pathelement location="${buildDir}/${fullProdName}" /> |
|
</path> |
|
|
|
<target name="-compiler-check"> |
|
<if> |
|
<and> |
|
<not> |
|
<or> |
|
<equals arg1="${ant.java.version}" arg2="1.4" /> |
|
<equals arg1="${ant.java.version}" arg2="1.5" /> |
|
</or> |
|
</not> |
|
<or> |
|
<not> |
|
<available file="${com.mysql.jdbc.java6.javac}" /> |
|
</not> |
|
<not> |
|
<available file="${com.mysql.jdbc.java6.rtjar}" /> |
|
</not> |
|
</or> |
|
</and> |
|
<then> |
|
<echo>This version of MySQL Connector/J requires a compiler from Java-1.4 or Java-1.5 to be used, set your JAVA_HOME property to point to one of these versions of the JDK. |
|
|
|
Compiling this version also requires Java-6 for compiling the JDBC-4.0 implementation, please set the full path to the javac executable with the property "com.mysql.jdbc.java6.javac" |
|
and the full path to the rt.jar from Java-6 with the property "com.mysql.jdbc.java6.rtjar". |
|
</echo> |
|
<fail/> |
|
</then> |
|
</if> |
|
</target> |
|
|
|
<target name="init" depends="-compiler-check, -init-copy, -init-no-crypto"> |
|
|
|
|
|
<if> |
|
<isset property="cctimestamp"/> |
|
<then> |
|
<exec executable="svn"> |
|
<arg line="up"/> |
|
</exec> |
|
</then> |
|
</if> |
|
|
|
|
|
|
|
|
|
|
|
<mkdir dir="${buildDir}/${fullProdName}/lib-nodist" /> |
|
|
|
<available file="${com.mysql.jdbc.docs.sourceDir}" property="com.mysql.jdbc.docs.sourcesPresent" /> |
|
|
|
<available classname="com.mchange.v2.c3p0.QueryConnectionTester" |
|
classpathref="project.build.classpath" |
|
property="com.mysql.jdbc.c3p0Present" /> |
|
|
|
<available classname="org.apache.log4j.Logger" |
|
classpathref="project.build.classpath" |
|
property="com.mysql.jdbc.log4jPresent" /> |
|
|
|
<available classname="org.jboss.resource.adapter.jdbc.ValidConnectionChecker" |
|
classpathref="project.build.classpath" |
|
property="com.mysql.jdbc.jbossPresent" /> |
|
</target> |
|
|
|
<target name="-init-copy" depends="clean"> |
|
<tstamp/> |
|
|
|
<filter token="VERSION" value="${version}"/> |
|
|
|
<mkdir dir="${buildDir}" /> |
|
|
|
<exec executable="svn" |
|
output="${buildDir}/svn.properties" |
|
failifexecutionfails="false" |
|
failonerror="false"> |
|
<arg value="info" /> |
|
</exec> |
|
|
|
<property prefix="svn" file="${buildDir}/svn.properties"/> |
|
|
|
<copy todir="${buildDir}/${fullProdName}" filtering="true"> |
|
<fileset dir="${sourceDir}/" excludes="**/CVS"> |
|
<patternset id="classjar" > |
|
<exclude name="**/*.class*"/> |
|
<exclude name="**/*.jar"/> |
|
</patternset> |
|
</fileset> |
|
|
|
<filterset> |
|
<filter token="MYSQL_CJ_MAJOR_VERSION" value="${major_version}"/> |
|
<filter token="MYSQL_CJ_MINOR_VERSION" value="${minor_version}"/> |
|
<filter token="MYSQL_CJ_SUBMINOR_VERSION" value="${subminor_version}"/> |
|
<filter token="MYSQL_CJ_VERSION_STATUS" value="${version_status}"/> |
|
<filter token="MYSQL_CJ_VERSION" value="${version}"/> |
|
<filter token="MYSQL_CJ_REVISION" value="${svn.Revision}" /> |
|
<filter token="MYSQL_CJ_FULL_PROD_NAME" value="${fullProdName}"/> |
|
</filterset> |
|
</copy> |
|
|
|
<copy todir="${buildDir}/${fullProdName}" filtering="false"> |
|
<fileset dir="${sourceDir}" excludes="**/CVS"> |
|
<patternset id="dojar" > |
|
<include name="**/*.jar*"/> |
|
</patternset> |
|
</fileset> |
|
</copy> |
|
</target> |
|
|
|
<target name="-init-no-crypto" depends="-init-copy" if="com.mysql.jdbc.noCryptoBuild"> |
|
<copy file="${sourceDir}//lib-nodist/ExportControlledNoCrypto.notjava" |
|
toFile="${buildDir}/${fullProdName}/com/mysql/jdbc/ExportControlled.java" |
|
overwrite="true"/> |
|
</target> |
|
|
|
|
|
|
|
|
|
|
|
|
|
<target name="full-package" description="Builds driver, binary .jar file, docs and packages (.zip, .tar.gz) suitable for distribution that _do_ contain sources" |
|
depends="full-dist, -make-packages, -create-archives"/> |
|
|
|
|
|
|
|
<target name="full-package-no-sources" description="Builds driver, binary .jar file, docs and packages (.zip, .tar.gz) suitable for distribution that do _not_ contain sources" |
|
depends="full-dist, -make-packages, -remove-sources, -create-archives"/> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<target name="full-dist" description="Builds driver, binary .jar file and docs, basically a distribution 'image'" |
|
depends="dist, -bundle-docs"/> |
|
|
|
<target name="package" depends="dist, -make-packages, -create-archives"/> |
|
|
|
<target name="-remove-sources"> |
|
<echo>Removing sources from ${distDir}/toArchive</echo> |
|
<delete> |
|
<fileset dir="${distDir}/toArchive"> |
|
<include name="**/*.java"/> |
|
</fileset> |
|
</delete> |
|
|
|
<delete dir="${distDir}/toArchive/${fullProdName}/src"/> |
|
</target> |
|
|
|
<target name="-create-archives" depends="-make-packages"> |
|
<tar destfile="${distDir}/${fullProdName}.tar.gz" |
|
compression="gzip" longfile="gnu"> |
|
<tarfileset dir="${toPackage}"> |
|
<patternset refid="non.test.sources" /> |
|
</tarfileset> |
|
</tar> |
|
|
|
<checksum file="${distDir}/${fullProdName}.tar.gz" forceOverwrite="yes" fileext=".md5"/> |
|
|
|
<delete file="${distDir}/${fullProdName}.zip"/> |
|
|
|
<zip zipfile="${distDir}/${fullProdName}.zip"> |
|
<fileset dir="${toPackage}"> |
|
<patternset refid="non.test.sources" /> |
|
</fileset> |
|
</zip> |
|
|
|
<checksum file="${distDir}/${fullProdName}.zip" forceOverwrite="yes" fileext=".md5"/> |
|
|
|
<if> |
|
<isset property="com.mysql.jdbc.commercialBuild"/> |
|
<then> |
|
<echo message="Not building maven bundle for commercial build" /> |
|
</then> |
|
<else> |
|
|
|
|
|
<checksum file="${distDir}/${fullProdName}.zip" forceOverwrite="yes" fileext=".md5"/> |
|
|
|
<tempfile destdir="${buildDir}" prefix="maven-bundle-" property="mavenUploadDir" /> |
|
|
|
<mkdir dir="${mavenUploadDir}" /> |
|
|
|
<copy file="${buildDir}/${fullProdName}/${fullProdName}-bin.jar" |
|
toFile="${mavenUploadDir}/${fullProdName}.jar" /> |
|
|
|
<copy file="${buildDir}/${fullProdName}/doc/sources/pom.xml" |
|
toDir="${mavenUploadDir}" filtering="true"> |
|
</copy> |
|
|
|
<copy file="./COPYING" |
|
toDir="${mavenUploadDir}" /> |
|
|
|
<copy file="./EXCEPTIONS-CONNECTOR-J" |
|
toDir="${mavenUploadDir}" /> |
|
|
|
<jar jarfile="${distDir}/${fullProdName}.bundle.jar" |
|
basedir="${mavenUploadDir}" /> |
|
</else> |
|
</if> |
|
</target> |
|
|
|
<target name="-make-packages" depends="dist"> |
|
<property name="toPackage" value="${distDir}/toArchive"/> |
|
<property name="packageDest" value = "${toPackage}/${fullProdName}"/> |
|
|
|
<delete dir="${toPackage}" /> |
|
<mkdir dir="${toPackage}"/> |
|
<mkdir dir="${packageDest}"/> |
|
|
|
<delete file="${distDir}/${fullProdName}.tar.gz"/> |
|
|
|
<patternset id="non.test.sources" > |
|
<exclude name="**/*.nb*"/> |
|
<exclude name="**/*.bak"/> |
|
<exclude name="**/*.*~"/> |
|
<exclude name="**/lib-nodist/*"/> |
|
<exclude name="**/lib-coverage/*"/> |
|
<exclude name="**/clover/*"/> |
|
<exclude name="**/checkstyle/*"/> |
|
<exclude name="**/.*"/> |
|
</patternset> |
|
|
|
<copy todir="${packageDest}"> |
|
<fileset dir="${buildDir}/${fullProdName}" |
|
includes="debug/*, docs/**, *.jar" excludes="docs/sources"> |
|
<patternset refid="non.test.sources"/> |
|
</fileset> |
|
|
|
<fileset dir="." includes="src/com/**, src/doc/**, src/lib/*, src/org/**, src/testsuite/**, build.xml, CHANGES, COPYING, EXCEPTIONS-CONNECTOR-J, README"> |
|
<patternset refid="non.test.sources"/> |
|
</fileset> |
|
</copy> |
|
|
|
|
|
<copy file="${packageDest}/README" tofile="${packageDest}/README.txt"/> |
|
<copy file="${packageDest}/docs/README.txt" tofile="${packageDest}/docs/README"/> |
|
|
|
|
|
|
|
<fixcrlf srcdir="${packageDest}" |
|
tab="remove" tablength="8" |
|
eol="crlf" includes="**/README.txt"/> |
|
|
|
|
|
|
|
<fixcrlf srcdir="${packageDest}" |
|
tab="remove" tablength="8" |
|
eol="lf" includes="**/README"/> |
|
|
|
<if> |
|
<isset property="com.mysql.jdbc.commercialBuild"/> |
|
<then> |
|
|
|
|
|
|
|
<delete file="${packageDest}/COPYING"/> |
|
<delete file="${packageDest}/EXCEPTIONS-CONNECTOR-J"/> |
|
|
|
|
|
|
|
<copy file="${sourceDir}/lib-nodist/LICENSE.mysql" toDir="${packageDest}"/> |
|
|
|
<loadfile property="commercialLicenseText" |
|
srcFile="${sourceDir}/lib-nodist/commercialLicense.txt"/> |
|
<replaceregexp |
|
match="Copyright.*1307.[^replaceregexp]*USA" |
|
replace="${commercialLicenseText}" |
|
flags="s"> |
|
<fileset dir="${packageDest}" includes="**/*"/> |
|
</replaceregexp> |
|
</then> |
|
</if> |
|
</target> |
|
|
|
<target name="dist" depends="init, compile"> |
|
|
|
<delete file="${buildDir}/${fullProdName}-bin.jar" /> |
|
<delete file="${distDir}/${fullProdName}.jar" /> |
|
|
|
<mkdir dir="${distDir}" /> |
|
<mkdir dir="${buildDir}/META-INF" /> |
|
|
|
|
|
|
|
<mkdir dir="${buildDir}/${fullProdName}/META-INF/services/" /> |
|
<echo file="${buildDir}/${fullProdName}/META-INF/services/java.sql.Driver" |
|
message="com.mysql.jdbc.Driver" /> |
|
|
|
<property name="osgid-version" value="${major_version}.${minor_version}.${subminor_version}"/> |
|
|
|
<property name="jee-imports" value="javax.naming,javax.naming.spi,javax.sql,javax.transaction.xa;version="[1.0.1, 2.0.0)";resolution:=optional" /> |
|
<property name="crypto-imports" value="javax.net,javax.net.ssl;version="[1.0.1, 2.0.0)";resolution:=optional" /> |
|
<property name="jdbc4-imports" value="javax.xml.parsers, javax.xml.stream,javax.xml.transform,javax.xml.transform.dom,javax.xml.transform.sax,javax.xml.transform.stax,javax.xml.transform.stream,org.w3c.dom,org.xml.sax,org.xml.sax.helpers;resolution:=optional" /> |
|
<property name="logging-imports" value="org.apache.commons.logging;version="[1.1.1,2.0.0)",org.apache.log4j;version="[1.2.15, 2.0.0)";resolution:=optional" /> |
|
<property name="integration-imports" value="com.mchange.v2.c3p0;version="[0.9.1.2, 1.0.0)";resolution:=optional,org.jboss.resource.adapter.jdbc;resolution:=optional,org.jboss.resource.adapter.jdbc.vendor;resolution:=optional" /> |
|
|
|
<property name="driver-exports" value="com.mysql.jdbc;version="${osgid-version}";uses:="com.mysql.jdbc.log,javax.naming,javax.net.ssl,javax.xml.transform,org.xml.sax"" /> |
|
<property name="jee-exports" value="com.mysql.jdbc.jdbc2.optional;version="${osgid-version}";uses:="com.mysql.jdbc,com.mysql.jdbc.log,javax.naming,javax.sql,javax.transaction.xa"" /> |
|
<property name="logging-exports" value="com.mysql.jdbc.log;version="${osgid-version}"" /> |
|
<property name="profiling-exports" value="com.mysql.jdbc.profiler;version="${osgid-version}";uses:="com.mysql.jdbc"" /> |
|
<property name="util-exports" value="com.mysql.jdbc.util;version="${osgid-version}";uses:="com.mysql.jdbc.log"" /> |
|
<property name="exceptions-exports" value="com.mysql.jdbc.exceptions;version="${osgid-version}"" /> |
|
<property name="jdbc4-exceptions-exports" value="com.mysql.jdbc.exceptions.jdbc4;version="${osgid-version}";uses:="com.mysql.jdbc"" /> |
|
|
|
<property name="interceptors-exports" value="com.mysql.jdbc.interceptors;version="${osgid-version}";uses:="com.mysql.jdbc"" /> |
|
<property name="integration-exports" value="com.mysql.jdbc.integration.c3p0;version="${osgid-version}",com.mysql.jdbc.integration.jboss;version="${osgid-version}"" /> |
|
<property name="configs-exports" value="com.mysql.jdbc.configs;version="${osgid-version}"" /> |
|
<property name="legacy-exports" value="org.gjt.mm.mysql;version="${osgid-version}"" /> |
|
|
|
<manifest file="${buildDir}/${fullProdName}/META-INF/MANIFEST.MF"> |
|
<attribute name="Built-By" value="${user.name}" /> |
|
|
|
<section name="common"> |
|
<attribute name="Specification-Title" value="JDBC" /> |
|
<attribute name="Specification-Version" value="4.0" /> |
|
<attribute name="Specification-Vendor" value="Sun Microsystems Inc." /> |
|
<attribute name="Implementation-Title" value="MySQL Connector/J" /> |
|
<attribute name="Implementation-Version" value="${full.version}" /> |
|
<attribute name="Implementation-Vendor-Id" value="com.mysql" /> |
|
<attribute name="Implementation-Vendor" value="Sun Microsystems Inc." /> |
|
</section> |
|
|
|
|
|
|
|
<attribute name="Bundle-Vendor" value="Sun Microsystems Inc." /> |
|
<attribute name="Bundle-Classpath" value="." /> |
|
<attribute name="Bundle-Version" value="${osgid-version}" /> |
|
<attribute name="Bundle-Name" value="Sun Microsystems' JDBC Driver for MySQL" /> |
|
<attribute name="Bundle-ManifestVersion" value="2" /> |
|
<attribute name="Bundle-SymbolicName" value="com.mysql.jdbc" /> |
|
<attribute name="Export-Package" value="${driver-exports},${jee-exports},${logging-exports},${profiling-exports},${util-exports},${exceptions-exports},${jdbc4-exceptions-exports},${interceptors-exports},${integration-exports},${configs-exports},${legacy-exports}" /> |
|
<attribute name="Import-Package" value="${crypto-imports},${jdbc4-imports},${jee-imports},${logging-imports},${integration-imports}" /> |
|
</manifest> |
|
|
|
<jar jarfile="${buildDir}/${fullProdName}/${fullProdName}-bin.jar" |
|
basedir="${buildDir}/${fullProdName}" |
|
includes="**/*.class,**/*.properties*,COPYING,README,META-INF/**" |
|
excludes="testsuite/**" |
|
index="true" |
|
manifest="${buildDir}/${fullProdName}/META-INF/MANIFEST.MF"/> |
|
</target> |
|
|
|
<target name="-dist-trace" depends="init, compile-driver-trace"> |
|
|
|
<delete file="${buildDir}/${fullProdName}-bin-g.jar"/> |
|
|
|
<mkdir dir="${distDir}" /> |
|
<mkdir dir="${buildDir}/${fullProdName}/debug"/> |
|
|
|
|
|
|
|
<mkdir dir="${buildDir}/${fullProdName}/META-INF/services/" /> |
|
<echo file="${buildDir}/${fullProdName}/META-INF/services/java.sql.Driver" |
|
message="com.mysql.jdbc.Driver" /> |
|
|
|
<manifest file="${buildDir}/${fullProdName}/MANIFEST.MF"> |
|
<attribute name="Built-By" value="${user.name}" /> |
|
|
|
<section name="common"> |
|
<attribute name="Specification-Title" value="JDBC" /> |
|
<attribute name="Specification-Version" value="4.0" /> |
|
<attribute name="Specification-Vendor" value="Sun Microsystems Inc." /> |
|
<attribute name="Implementation-Title" value="MySQL Connector/J (trace/debug enabled)" /> |
|
<attribute name="Implementation-Version" value="${full-version} (trace/debug-enabled)" /> |
|
<attribute name="Implementation-Vendor" value="MySQL AB" /> |
|
</section> |
|
</manifest> |
|
|
|
<jar jarfile="${buildDir}/${fullProdName}/debug/${fullProdName}-bin-g.jar" |
|
basedir="${buildDir}/${fullProdName}" |
|
includes="**/*.class,**/*.properties*,COPYING,README,META-INF/**" |
|
excludes="testsuite/**" |
|
index="true" |
|
manifest="${buildDir}/${fullProdName}/MANIFEST.MF" |
|
/> |
|
</target> |
|
|
|
<target name="-bundle-docs" depends="init"> |
|
<copy file="${com.mysql.jdbc.docs.sourceDir}/en/html/connector-j.html" |
|
todir="${buildDir}/${fullProdName}/docs" |
|
failonerror="true"/> |
|
<copy file="${com.mysql.jdbc.docs.sourceDir}/en/pdf/connector-j.pdf" |
|
todir="${buildDir}/${fullProdName}/docs" |
|
failonerror="true"/> |
|
<copy file="${com.mysql.jdbc.docs.sourceDir}/en/txt/connector-j.txt" |
|
tofile="${buildDir}/${fullProdName}/docs/README.txt" |
|
failonerror="true"/> |
|
<copy todir="${buildDir}/${fullProdName}/docs/release-test-output" failonerror="false"> |
|
<fileset dir="${com.mysql.jdbc.docs.sourceDir}/release-test-output" excludes="**/CVS"> |
|
</fileset> |
|
</copy> |
|
</target> |
|
|
|
<target name="test-all-multi" depends="compile"> |
|
<delete dir="${buildDir}/junit" /> |
|
<antcall target="test-multijvm" /> |
|
<antcall target="test-compliance-multijvm" /> |
|
|
|
<fail message="Tests failed. Check logs and/or reports in ${buildDir}/junit." |
|
if="tests.compliance.failed"/> |
|
</target> |
|
|
|
|
|
|
|
<target name="test-multijvm" depends="compile"> |
|
<for list="1,2,3,4,5,6,7,8" param="jvm.number"> |
|
<sequential> |
|
<if> |
|
<isset property="com.mysql.jdbc.testsuite.jvm.@{jvm.number}"/> |
|
<then> |
|
<for list="1,2,3,4,5,6,7,8" param="url.number"> |
|
<sequential> |
|
<if> |
|
<isset property="com.mysql.jdbc.testsuite.url.@{url.number}"/> |
|
<then> |
|
<make-output-hier |
|
jdbcUrl="${com.mysql.jdbc.testsuite.url.@{url.number}}" |
|
junitOutput="${junit.results}" |
|
jvm="${com.mysql.jdbc.testsuite.jvm.@{jvm.number}}" |
|
unitOrCompliance="unit" /> |
|
|
|
<property name="test.multi.junitOut.@{url.number}" value="eraseMe" /> |
|
<var name="test.multi.junitOut.@{url.number}" unset="true" /> |
|
|
|
<loadfile srcfile="${junit.results}/hier" |
|
property="test.multi.junitOut.@{url.number}" /> |
|
|
|
<antcall target="test"> |
|
<param name="com.mysql.jdbc.testsuite.url" value="${com.mysql.jdbc.testsuite.url.@{url.number}}" /> |
|
<param name="test.result.prefix" value="/${test.multi.junitOut.@{url.number}}" /> |
|
<param name="com.mysql.jdbc.testsuite.jvm" value="${com.mysql.jdbc.testsuite.jvm.@{jvm.number}}"/> |
|
</antcall> |
|
</then> |
|
</if> |
|
</sequential> |
|
</for> |
|
</then> |
|
</if> |
|
</sequential> |
|
</for> |
|
</target> |
|
|
|
<target name="-set-test-result-prefix" unless="${test.result.prefix}"> |
|
<property name="test.result.prefix" value=""/> |
|
</target> |
|
|
|
<target name="test" depends="compile, -set-test-result-prefix"> |
|
<property name="com.mysql.jdbc.testsuite.jvm" value="java"/> |
|
<mkdir dir="${junit.results}"/> |
|
<echo message="Running unit tests against ${com.mysql.jdbc.testsuite.url} with jvm ${com.mysql.jdbc.testsuite.jvm}"/> |
|
|
|
<property name="junit.unitregress.results" value="${junit.results}/${test.result.prefix}/unitregress" /> |
|
|
|
<mkdir dir="${junit.results}/${test.result.prefix}"/> |
|
<mkdir dir="${junit.unitregress.results}"/> |
|
|
|
<mkdir dir="${junit.unitregress.results}/report"/> |
|
|
|
<junit printSummary="yes" |
|
fork="on" |
|
forkmode="once" |
|
jvm="${com.mysql.jdbc.testsuite.jvm}" |
|
errorProperty="tests.failed" |
|
failureProperty="tests.failed"> |
|
<jvmarg value="-Xmx384m" /> |
|
|
|
|
|
|
|
<jvmarg value="-Xverify:none" /> |
|
|
|
<sysproperty key="com.mysql.jdbc.testsuite.url" value="${com.mysql.jdbc.testsuite.url}"/> |
|
|
|
<classpath> |
|
<fileset dir="${sourceDir}/lib-nodist"> |
|
<include name="**/*.jar"/> |
|
</fileset> |
|
<fileset dir="${buildDir}/${fullProdName}/lib"> |
|
<include name="**/*.jar"/> |
|
</fileset> |
|
<pathelement location="${buildDir}/${fullProdName}" /> |
|
<pathelement path="${java.class.path}" /> |
|
</classpath> |
|
|
|
<formatter type="xml"/> |
|
|
|
<batchtest todir="${junit.unitregress.results}" > |
|
<fileset dir="${buildDir}/${fullProdName}"> |
|
<include name="**/*Test.java" /> |
|
<exclude name="**/perf/*.java"/> |
|
<exclude name="**/jdbc4/*Test.java"/> |
|
</fileset> |
|
</batchtest> |
|
</junit> |
|
|
|
|
|
<junit printSummary="yes" |
|
fork="on" |
|
forkmode="once" |
|
jvm="${com.mysql.jdbc.java6.java}" |
|
errorProperty="tests.failed" |
|
failureProperty="tests.failed"> |
|
<jvmarg value="-Xmx384m" /> |
|
|
|
<sysproperty key="com.mysql.jdbc.testsuite.url" value="${com.mysql.jdbc.testsuite.url}"/> |
|
|
|
<classpath> |
|
<fileset dir="${sourceDir}/lib-nodist"> |
|
<include name="**/*.jar"/> |
|
</fileset> |
|
<fileset dir="${buildDir}/${fullProdName}/lib"> |
|
<include name="**/*.jar"/> |
|
</fileset> |
|
<pathelement location="${buildDir}/${fullProdName}" /> |
|
<pathelement path="${java.class.path}" /> |
|
</classpath> |
|
|
|
<formatter type="xml"/> |
|
|
|
<batchtest todir="${junit.unitregress.results}" > |
|
<fileset dir="${buildDir}/${fullProdName}"> |
|
<include name="**/jdbc4/*Test.java" /> |
|
|
|
</fileset> |
|
</batchtest> |
|
</junit> |
|
|
|
|
|
<junitreport todir="${junit.unitregress.results}/report"> |
|
<fileset dir="${junit.unitregress.results}"> |
|
<include name="**/TEST-*.xml"/> |
|
</fileset> |
|
<report format="frames" todir="${junit.unitregress.results}/report"/> |
|
</junitreport> |
|
|
|
|
|
<if> |
|
<equals arg1="${test.result.prefix}" arg2="" /> |
|
<then> |
|
<fail message="Tests failed. Check logs and/or reports in ${junit.results}." if="tests.failed"/> |
|
</then> |
|
<else> |
|
<echo message="Not checking test failures because we're doing a multi-test..." /> |
|
</else> |
|
</if> |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="test-compliance-multijvm" depends="compile"> |
|
<for list="1,2,3,4,5,6,7,8" param="jvm.number"> |
|
<sequential> |
|
<if> |
|
<isset property="com.mysql.jdbc.testsuite.jvm.@{jvm.number}"/> |
|
<then> |
|
<for list="1,2,3,4,5,6,7,8" param="url.number"> |
|
<sequential> |
|
<if> |
|
<isset property="com.mysql.jdbc.compliance.url.@{url.number}"/> |
|
<then> |
|
<make-output-hier |
|
jdbcUrl="${com.mysql.jdbc.compliance.url.@{url.number}}" |
|
junitOutput="${junit.results}" |
|
jvm="${com.mysql.jdbc.testsuite.jvm.@{jvm.number}}" |
|
unitOrCompliance="compliance"/> |
|
|
|
<property name="test.compliance.multi.junitOut.@{url.number}" value="eraseMe" /> |
|
<var name="test.compliance.multi.junitOut.@{url.number}" unset="true" /> |
|
|
|
<loadfile srcfile="${junit.results}/hier" property="test.compliance.multi.junitOut.@{url.number}" /> |
|
|
|
<antcall target="test-compliance"> |
|
<param name="com.mysql.jdbc.compliance.url" value="${com.mysql.jdbc.compliance.url.@{url.number}}"/> |
|
<param name="com.mysql.jdbc.testsuite.jvm" value="${com.mysql.jdbc.testsuite.jvm.@{jvm.number}}"/> |
|
<param name="test.result.prefix" value="/${test.compliance.multi.junitOut.@{url.number}}"/> |
|
</antcall> |
|
</then> |
|
</if> |
|
</sequential> |
|
</for> |
|
</then> |
|
</if> |
|
</sequential> |
|
</for> |
|
</target> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<target name="test-compliance" depends="compile"> |
|
<property name="com.mysql.jdbc.test.jvm" value="java"/> |
|
<mkdir dir="${junit.results}"/> |
|
<echo message="Running compliance tests against ${com.mysql.jdbc.compliance.url} with jvm ${com.mysql.jdbc.testsuite.jvm}"/> |
|
|
|
<property name="junit.compliance.results" |
|
value="${junit.results}/${test.result.prefix}/compliance"/> |
|
|
|
<mkdir dir="${junit.results}/${test.result.prefix}"/> |
|
<mkdir dir="${junit.compliance.results}"/> |
|
<mkdir dir="${junit.compliance.results}/report"/> |
|
|
|
<junit fork="on" forkmode="once" |
|
printsummary="yes" jvm="${com.mysql.jdbc.testsuite.jvm}" |
|
errorProperty="tests.compliance.failed" |
|
failureProperty="tests.compliance.failed"> |
|
<jvmarg value="-Xmx128m"/> |
|
|
|
|
|
|
|
<jvmarg value="-Xverify:none"/> |
|
|
|
<sysproperty key="com.mysql.jdbc.compliance.url" value="${com.mysql.jdbc.compliance.url}"/> |
|
|
|
<classpath> |
|
<pathelement location="${buildDir}/${fullProdName}"/> |
|
<fileset dir="${sourceDir}/lib-nodist"> |
|
<include name="**/*.jar"/> |
|
</fileset> |
|
<fileset dir="${buildDir}/${fullProdName}/lib"> |
|
<include name="**/*.jar"/> |
|
</fileset> |
|
<pathelement path="${java.class.path}" /> |
|
<pathelement location="${jdbc-compliance-location}"/> |
|
</classpath> |
|
|
|
<formatter type="xml"/> |
|
|
|
<test todir="${junit.compliance.results}" |
|
name="com.mysql.jdbc.compliance.tests.BatchUpdateTest"/> |
|
<test todir="${junit.compliance.results}" |
|
name="com.mysql.jdbc.compliance.tests.ConnectionTest"/> |
|
<test todir="${junit.compliance.results}" |
|
name="com.mysql.jdbc.compliance.tests.DatabaseMetaDataTest"/> |
|
<test todir="${junit.compliance.results}" |
|
name="com.mysql.jdbc.compliance.tests.EscapeSyntaxTest"/> |
|
<test todir="${junit.compliance.results}" |
|
name="com.mysql.jdbc.compliance.tests.PreparedStatementTest"/> |
|
<test todir="${junit.compliance.results}" |
|
name="com.mysql.jdbc.compliance.tests.ResultSetMetadataTest"/> |
|
<test todir="${junit.compliance.results}" |
|
name="com.mysql.jdbc.compliance.tests.ResultSetTest"/> |
|
<test todir="${junit.compliance.results}" |
|
name="com.mysql.jdbc.compliance.tests.StatementTest"/> |
|
</junit> |
|
|
|
<junitreport todir="${junit.compliance.results}/report"> |
|
<fileset dir="${junit.compliance.results}"> |
|
<include name="**/TEST-*.xml"/> |
|
</fileset> |
|
<report format="frames" todir="${junit.compliance.results}/report"/> |
|
</junitreport> |
|
|
|
|
|
<if> |
|
<equals arg1="${test.result.prefix}" arg2="" /> |
|
<then> |
|
<fail message="Tests failed. Check logs and/or reports in ${junit.compliance.results}." if="tests.compliance.failed"/> |
|
</then> |
|
<else> |
|
<echo message="Not checking test failures because we're doing a multi-test..." /> |
|
</else> |
|
</if> |
|
|
|
</target> |
|
|
|
|
|
<target name="compile" depends="init, compile-driver, compile-testsuite, compile.integration"> |
|
</target> |
|
|
|
<target name="compile-trace" depends="init, compile-driver-trace"> |
|
</target> |
|
|
|
|
|
|
|
<target name="compile-driver" depends="compile-driver-jdbc3, compile-driver-jdbc4" /> |
|
|
|
<target name="compile-driver-jdbc3" depends="init, -clean-output"> |
|
<javac sourcepath="" srcdir="${buildDir}/${fullProdName}" |
|
destdir="${compiler.output}" |
|
deprecation="off" |
|
debug="${debug.enable}"> |
|
<include name="**/*.java" /> |
|
<exclude name="testsuite/**" /> |
|
<exclude name="com/mysql/jdbc/integration/**" /> |
|
<exclude name="com/mysql/jdbc/log/Log4JLogger.java" /> |
|
<exclude name="**/JDBC4*.java" /> |
|
<exclude name="com/mysql/jdbc/exceptions/jdbc4/*" /> |
|
|
|
<classpath refid="project.build.classpath" /> |
|
</javac> |
|
</target> |
|
|
|
<target name="compile-driver-jdbc4" depends="compile-driver-jdbc3"> |
|
|
|
<javac destdir="${compiler.output}" |
|
deprecation="off" |
|
debug="${debug.enable}" |
|
fork="yes" |
|
executable="${com.mysql.jdbc.java6.javac}" |
|
compiler="modern" |
|
sourcepath="" srcdir="${buildDir}/${fullProdName}" |
|
bootclasspath="${com.mysql.jdbc.java6.rtjar}"> |
|
<include name="**/JDBC4*.java" /> |
|
<include name="com/mysql/jdbc/exceptions/jdbc4/*" /> |
|
|
|
<classpath refid="project.build.classpath" /> |
|
</javac> |
|
|
|
</target> |
|
|
|
|
|
|
|
<target name="compile-driver-trace" depends="init"> |
|
<taskdef |
|
resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties"> |
|
<classpath> |
|
<pathelement location="${sourceDir}/lib/aspectjtools.jar"/> |
|
</classpath> |
|
</taskdef> |
|
|
|
|
|
<iajc destdir="${compiler.output}"> |
|
<sourceroots> |
|
<pathelement location="${buildDir}/${fullProdName}/org"/> |
|
<pathelement location="${buildDir}/${fullProdName}/com"/> |
|
</sourceroots> |
|
<classpath refid="project.build.classpath"/> |
|
<classpath> |
|
<pathelement location="${sourceDir}/lib/aspectjtools.jar"/> |
|
</classpath> |
|
</iajc> |
|
</target> |
|
|
|
|
|
<target name="compile.integration" |
|
depends="compile-driver, |
|
compile-integration-c3p0, |
|
compile-integration-jboss, |
|
compile-integration-log4j"/> |
|
|
|
<target name="compile-integration-c3p0" |
|
depends="compile-driver" |
|
if="com.mysql.jdbc.c3p0Present"> |
|
<javac srcdir="${buildDir}/${fullProdName}" |
|
destdir="${compiler.output}" |
|
deprecation="off" |
|
debug="${debug.enable}" |
|
includes="com/mysql/jdbc/integration/c3p0/**"> |
|
<classpath refid="project.build.classpath" /> |
|
</javac> |
|
</target> |
|
|
|
<target name="compile-integration-jboss" |
|
depends="compile-driver" |
|
if="com.mysql.jdbc.jbossPresent"> |
|
<javac srcdir="${buildDir}/${fullProdName}" |
|
destdir="${compiler.output}" |
|
deprecation="off" |
|
debug="${debug.enable}" |
|
includes="com/mysql/jdbc/integration/jboss/**"> |
|
<classpath refid="project.build.classpath" /> |
|
</javac> |
|
</target> |
|
|
|
<target name="compile-integration-log4j" |
|
depends="compile-driver" |
|
if="com.mysql.jdbc.log4jPresent"> |
|
<javac srcdir="${buildDir}/${fullProdName}" |
|
destdir="${compiler.output}" |
|
deprecation="off" |
|
debug="${debug.enable}" |
|
includes="com/mysql/jdbc/log/Log4JLogger.java"> |
|
<classpath refid="project.build.classpath" /> |
|
</javac> |
|
</target> |
|
|
|
|
|
|
|
<target name="compile-testsuite" depends="init, compile-driver"> |
|
<javac |
|
srcdir="${buildDir}/${fullProdName}" |
|
destdir="${compiler.output}" |
|
deprecation="off" |
|
debug="${debug.enable}" |
|
includes="testsuite/**" |
|
excludes="testsuite/requiresNonRedists/**, testsuite/**/jdbc4/**"> |
|
<classpath refid="project.build.classpath"/> |
|
</javac> |
|
|
|
<javac destdir="${compiler.output}" |
|
deprecation="off" |
|
debug="${debug.enable}" |
|
fork="yes" |
|
executable="${com.mysql.jdbc.java6.javac}" |
|
compiler="modern" |
|
sourcepath="" srcdir="${buildDir}/${fullProdName}" |
|
bootclasspath="${com.mysql.jdbc.java6.rtjar}"> |
|
<include name="testsuite/**/jdbc4/**" /> |
|
|
|
<classpath refid="project.build.classpath" /> |
|
</javac> |
|
</target> |
|
|
|
<target name="real-clean"> |
|
<delete dir="${buildDir}"/> |
|
<delete> |
|
<fileset dir="${distDir}" |
|
includes="${fullProdName}.zip,${fullProdName}.tar.gz"/> |
|
</delete> |
|
</target> |
|
|
|
<target name="clean" unless="com.mysql.jdbc.noCleanBetweenCompiles"> |
|
<delete dir="${buildDir}"/> |
|
</target> |
|
|
|
<target name="-clean-output" unless="com.mysql.jdbc.noCleanBetweenCompiles"> |
|
<delete> |
|
<fileset dir="${buildDir}" |
|
includes="**/*.class"/> |
|
</delete> |
|
</target> |
|
|
|
<target name="docs-generate-dynamic-docs" |
|
depends="docs-generate-properties-table, docs-generate-error-mapping-table"/> |
|
|
|
<target name="docs-generate-properties-table" depends="compile-driver"> |
|
<tempfile property="properties-xml" suffix=".xml" /> |
|
|
|
<java classname="com.mysql.jdbc.util.PropertiesDocGenerator" |
|
output="${properties-xml}" classpath="${buildDir}/${fullProdName}"/> |
|
<tempfile property="docsPropXslTempfile" suffix="xsl"/> |
|
<copy file="${buildDir}/${fullProdName}/doc/sources/connPropsToDocbook.xsl" tofile="${docsPropXslTempfile}"/> |
|
|
|
<style in="${properties-xml}" style="${docsPropXslTempfile}" |
|
out="${buildDir}/${fullProdName}/docs/sources/connPropsDocBook.xml"/> |
|
<delete file="${properties-xml}"/> |
|
<delete file="${docsPropXslTempfile}"/> |
|
</target> |
|
|
|
<target name="docs-generate-error-mapping-table" depends="compile-driver"> |
|
<tempfile property="errorsMapping-xml" suffix=".xml" /> |
|
|
|
<java classname="com.mysql.jdbc.util.ErrorMappingsDocGenerator" |
|
output="${errorsMapping-xml}" classpath="${buildDir}/${fullProdName}"/> |
|
<tempfile property="docsErrorXslTempfile" suffix="xsl"/> |
|
<copy file="${buildDir}/${fullProdName}/doc/sources/errorMapToDocbook.xsl" tofile="${docsErrorXslTempfile}"/> |
|
|
|
<style in="${errorsMapping-xml}" style="${docsErrorXslTempfile}" |
|
out="${buildDir}/${fullProdName}/docs/sources/errorMappingDocBook.xml"/> |
|
<delete file="${docsErrorXslTempfile}"/> |
|
</target> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<target name="emma" description="turns on EMMA instrumentation/reporting" > |
|
|
|
<property name="emma.dir" value="${sourceDir}/lib-coverage" /> |
|
|
|
<path id="emma.lib" > |
|
<pathelement location="${emma.dir}/emma.jar" /> |
|
<pathelement location="${emma.dir}/emma_ant.jar" /> |
|
</path> |
|
|
|
<taskdef resource="emma_ant.properties" classpathref="emma.lib" /> |
|
|
|
<property name="emma.enabled" value="true" /> |
|
<property name="emma.coverage.dir" value="${buildDir}/${fullProdName}-coverage" /> |
|
</target> |
|
|
|
<target name="instrument" depends="init, compile" |
|
description="runs the examples" > |
|
|
|
<emma enabled="${emma.enabled}" > |
|
<instr instrpathref="built.driver.only.classpath" |
|
destdir="${compiler.output}" |
|
metadatafile="${emma.coverage.dir}/metadata.emma" |
|
merge="true" |
|
mode="overwrite"> |
|
<filter excludes="*Test*" /> |
|
<filter excludes="org.junit.*" /> |
|
</instr> |
|
</emma> |
|
|
|
</target> |
|
|
|
<target name="test-emma-report" depends="test-coverage, test-coverage-compliance"> |
|
<emma enabled="${emma.enabled}" > |
|
<report sourcepath="${buildDir}/${fullProdName}" > |
|
<fileset dir="${emma.coverage.dir}" > |
|
<include name="*.emma" /> |
|
</fileset> |
|
|
|
<txt outfile="${emma.coverage.dir}/coverage.txt" /> |
|
<html outfile="${emma.coverage.dir}/coverage.html" /> |
|
</report> |
|
</emma> |
|
</target> |
|
|
|
<target name="test-coverage-all-report" depends="test-coverage-multijvm, test-coverage-compliance-multijvm"> |
|
<emma enabled="${emma.enabled}" > |
|
<report sourcepath="${buildDir}/${fullProdName}" > |
|
<fileset dir="${emma.coverage.dir}" > |
|
<include name="*.emma" /> |
|
</fileset> |
|
|
|
<txt outfile="${emma.coverage.dir}/coverage.txt" /> |
|
<html outfile="${emma.coverage.dir}/coverage.html" /> |
|
</report> |
|
</emma> |
|
</target> |
|
|
|
|
|
<target name="test-coverage" depends="instrument"> |
|
<property name="com.mysql.jdbc.testsuite.jvm" value="java"/> |
|
<mkdir dir="${junit.results}"/> |
|
<echo message="Running unit tests against ${com.mysql.jdbc.testsuite.url} with jvm ${com.mysql.jdbc.testsuite.jvm}"/> |
|
|
|
<property name="junit.unitregress.results" value="${junit.results}/${test.result.prefix}/unitregress" /> |
|
|
|
<mkdir dir="${junit.results}/${test.result.prefix}"/> |
|
<mkdir dir="${junit.unitregress.results}"/> |
|
|
|
<mkdir dir="${junit.unitregress.results}/report"/> |
|
|
|
<junit printSummary="yes" fork="on" jvm="${com.mysql.jdbc.testsuite.jvm}"> |
|
<jvmarg value="-Xmx128m" /> |
|
<jvmarg value="-Xverify:none" /> |
|
|
|
<jvmarg value="-Demma.coverage.out.file=${emma.coverage.dir}/coverage.emma" /> |
|
<jvmarg value="-Demma.coverage.out.merge=true" /> |
|
<sysproperty key="com.mysql.jdbc.testsuite.url" value="${com.mysql.jdbc.testsuite.url}"/> |
|
<classpath> |
|
<fileset dir="${sourceDir}/lib-nodist"> |
|
<include name="**/*.jar"/> |
|
</fileset> |
|
<fileset dir="${buildDir}/${fullProdName}/lib"> |
|
<include name="**/*.jar"/> |
|
</fileset> |
|
<pathelement location="${buildDir}/${fullProdName}" /> |
|
<pathelement path="${java.class.path}" /> |
|
<pathelement location="${emma.dir}/emma.jar" /> |
|
<pathelement location="${emma.dir}/emma_ant.jar" /> |
|
</classpath> |
|
|
|
<formatter type="xml"/> |
|
|
|
<batchtest fork="yes" todir="${junit.unitregress.results}"> |
|
<fileset dir="${buildDir}/${fullProdName}"> |
|
<include name="**/*Test.java" /> |
|
<exclude name="**/perf/*.java"/> |
|
</fileset> |
|
</batchtest> |
|
</junit> |
|
|
|
|
|
<junitreport todir="${junit.unitregress.results}/report"> |
|
<fileset dir="${junit.unitregress.results}"> |
|
<include name="**/TEST-*.xml"/> |
|
</fileset> |
|
<report format="frames" todir="${junit.unitregress.results}/report"/> |
|
</junitreport> |
|
</target> |
|
|
|
<target name="test-coverage-compliance" depends="instrument"> |
|
<property name="com.mysql.jdbc.test.jvm" value="java"/> |
|
<mkdir dir="${junit.results}"/> |
|
<echo message="Running compliance tests against ${com.mysql.jdbc.compliance.url} with jvm ${com.mysql.jdbc.testsuite.jvm}"/> |
|
|
|
<property name="junit.compliance.results" |
|
value="${junit.results}/${test.result.prefix}/compliance"/> |
|
|
|
<mkdir dir="${junit.results}/${test.result.prefix}"/> |
|
<mkdir dir="${junit.compliance.results}"/> |
|
<mkdir dir="${junit.compliance.results}/report"/> |
|
|
|
<junit printsummary="yes" jvm="${com.mysql.jdbc.testsuite.jvm}"> |
|
<jvmarg value="-Xmx128m"/> |
|
<jvmarg value="-Xverify:none"/> |
|
|
|
<jvmarg value="-Demma.coverage.out.file=${emma.coverage.dir}/coverage.emma" /> |
|
<jvmarg value="-Demma.coverage.out.merge=true" /> |
|
<sysproperty key="com.mysql.jdbc.compliance.url" value="${com.mysql.jdbc.compliance.url}"/> |
|
<classpath> |
|
<pathelement location="${buildDir}/${fullProdName}"/> |
|
<fileset dir="${sourceDir}/lib-nodist"> |
|
<include name="**/*.jar"/> |
|
</fileset> |
|
<fileset dir="${buildDir}/${fullProdName}/lib"> |
|
<include name="**/*.jar"/> |
|
</fileset> |
|
<pathelement path="${java.class.path}" /> |
|
<pathelement location="${jdbc-compliance-location}"/> |
|
<pathelement location="${emma.dir}/emma.jar" /> |
|
<pathelement location="${emma.dir}/emma_ant.jar" /> |
|
</classpath> |
|
|
|
<formatter type="xml"/> |
|
|
|
|
|
<test fork="yes" todir="${junit.compliance.results}" |
|
name="com.mysql.jdbc.compliance.tests.BatchUpdateTest"/> |
|
<test fork="yes" todir="${junit.compliance.results}" |
|
name="com.mysql.jdbc.compliance.tests.ConnectionTest"/> |
|
<test fork="yes" todir="${junit.compliance.results}" |
|
name="com.mysql.jdbc.compliance.tests.DatabaseMetaDataTest"/> |
|
<test fork="yes" todir="${junit.compliance.results}" |
|
name="com.mysql.jdbc.compliance.tests.EscapeSyntaxTest"/> |
|
<test fork="yes" todir="${junit.compliance.results}" |
|
name="com.mysql.jdbc.compliance.tests.PreparedStatementTest"/> |
|
<test fork="yes" todir="${junit.compliance.results}" |
|
name="com.mysql.jdbc.compliance.tests.ResultSetMetadataTest"/> |
|
<test fork="yes" todir="${junit.compliance.results}" |
|
name="com.mysql.jdbc.compliance.tests.ResultSetTest"/> |
|
<test fork="yes" todir="${junit.compliance.results}" |
|
name="com.mysql.jdbc.compliance.tests.StatementTest"/> |
|
</junit> |
|
|
|
<junitreport todir="${junit.compliance.results}/report"> |
|
<fileset dir="${junit.compliance.results}"> |
|
<include name="**/TEST-*.xml"/> |
|
</fileset> |
|
<report format="frames" todir="${junit.compliance.results}/report"/> |
|
</junitreport> |
|
</target> |
|
|
|
|
|
|
|
|
|
<macrodef name="make-output-hier"> |
|
<attribute name="jvm" /> |
|
<attribute name="jdbcUrl" /> |
|
<attribute name="unitOrCompliance" /> |
|
<attribute name="junitOutput" /> |
|
<sequential> |
|
<java fork="true" jvm="@{jvm}" classname="com.mysql.jdbc.util.VersionFSHierarchyMaker"> |
|
|
|
<jvmarg value="-Xmx128m" /> |
|
<jvmarg value="-Xverify:none" /> |
|
|
|
<jvmarg value="-Demma.coverage.out.file=${emma.coverage.dir}/coverage.emma" /> |
|
<jvmarg value="-Demma.coverage.out.merge=true" /> |
|
|
|
<sysproperty key="com.mysql.jdbc.testsuite.url" value="@{jdbcUrl}" /> |
|
|
|
<classpath> |
|
<fileset dir="${sourceDir}/lib-nodist"> |
|
<include name="**/*.jar" /> |
|
</fileset> |
|
<fileset dir="${buildDir}/${fullProdName}/lib"> |
|
<include name="**/*.jar" /> |
|
</fileset> |
|
<pathelement location="${buildDir}/${fullProdName}" /> |
|
<pathelement path="${java.class.path}" /> |
|
<pathelement location="${emma.dir}/emma.jar" /> |
|
<pathelement location="${emma.dir}/emma_ant.jar" /> |
|
</classpath> |
|
<arg line="@{unitOrCompliance} @{junitOutput} @{junitOutput}/hier" /> |
|
</java> |
|
</sequential> |
|
</macrodef> |
|
|
|
|
|
|
|
|
|
<target name="test-coverage-multijvm" depends="instrument"> |
|
<for list="1,2,3,4,5,6,7,8" param="jvm.number"> |
|
<sequential> |
|
<if> |
|
<isset property="com.mysql.jdbc.testsuite.jvm.@{jvm.number}"/> |
|
<then> |
|
<for list="1,2,3,4,5,6,7,8" param="url.number"> |
|
<sequential> |
|
<if> |
|
<isset property="com.mysql.jdbc.testsuite.url.@{url.number}"/> |
|
<then> |
|
<make-output-hier |
|
jdbcUrl="${com.mysql.jdbc.testsuite.url.@{url.number}}" |
|
junitOutput="${junit.results}" |
|
jvm="${com.mysql.jdbc.testsuite.jvm.@{jvm.number}}" |
|
unitOrCompliance="unit" /> |
|
|
|
<property name="test.coverage.multi.junitOut.@{url.number}" value="eraseMe" /> |
|
<var name="test.coverage.multi.junitOut.@{url.number}" unset="true" /> |
|
|
|
<loadfile srcfile="${junit.results}/hier" |
|
property="test.coverage.multi.junitOut.@{url.number}" /> |
|
|
|
<antcall target="test-coverage"> |
|
<param name="com.mysql.jdbc.testsuite.url" value="${com.mysql.jdbc.testsuite.url.@{url.number}}" /> |
|
<param name="test.result.prefix" value="/${test.coverage.multi.junitOut.@{url.number}}" /> |
|
<param name="com.mysql.jdbc.testsuite.jvm" value="${com.mysql.jdbc.testsuite.jvm.@{jvm.number}}"/> |
|
</antcall> |
|
</then> |
|
</if> |
|
</sequential> |
|
</for> |
|
</then> |
|
</if> |
|
</sequential> |
|
</for> |
|
</target> |
|
|
|
|
|
|
|
|
|
<target name="test-coverage-compliance-multijvm" depends="instrument"> |
|
<for list="1,2,3,4,5,6,7,8" param="jvm.number" xmlns:ac="antlib:net.sf.antcontrib"> |
|
<sequential> |
|
<if> |
|
<isset property="com.mysql.jdbc.testsuite.jvm.@{jvm.number}"/> |
|
<then> |
|
<for list="1,2,3,4,5,6,7,8" param="url.number"> |
|
<sequential> |
|
<if> |
|
<isset property="com.mysql.jdbc.compliance.url.@{url.number}"/> |
|
<then> |
|
<make-output-hier |
|
jdbcUrl="${com.mysql.jdbc.compliance.url.@{url.number}}" |
|
junitOutput="${junit.results}" |
|
jvm="${com.mysql.jdbc.testsuite.jvm.@{jvm.number}}" |
|
unitOrCompliance="compliance"/> |
|
|
|
<property name="test.coverage.compliance.multi.junitOut.@{url.number}" value="eraseMe" /> |
|
<var name="test.coverage.compliance.multi.junitOut.@{url.number}" unset="true" /> |
|
|
|
<loadfile srcfile="${junit.results}/hier" property="test.coverage.compliance.multi.junitOut.@{url.number}" /> |
|
|
|
<antcall target="test-coverage-compliance"> |
|
<param name="com.mysql.jdbc.compliance.url" value="${com.mysql.jdbc.compliance.url.@{url.number}}"/> |
|
<param name="com.mysql.jdbc.testsuite.jvm" value="${com.mysql.jdbc.testsuite.jvm.@{jvm.number}}"/> |
|
<param name="test.result.prefix" value="/${test.coverage.compliance.multi.junitOut.@{url.number}}"/> |
|
</antcall> |
|
</then> |
|
</if> |
|
</sequential> |
|
</for> |
|
</then> |
|
</if> |
|
</sequential> |
|
</for> |
|
</target> |
|
</project> |
|
|