All suites

The package comes with a testsuite that is disabled by default.

With a few fixes I'll work:

Prepare MySQL server:

If you need to investigate a stuck/long test:

        <junit printsummary="yes"
         showoutput="yes" enabletestlistenerevents="true"

Additional build dependencies:

apt-get install libjboss-connector-java  # or grab from wheezy
cp -a /usr/share/java/junit-3.8.2.jar lib/
cp -a /usr/share/java/jboss-connector-4.2.3.GA.jar lib/

Old RefFSContextFactory JNDI class that isn't bundled anymore, for testsuite.simple.DataSourceTest,testsuite.regression.DataSourceRegressionTest:

Prepare environment:

quilt push -a
JAVA_HOME=/usr/lib/jvm/default-java

Run the testsuite:

ant \
  -Dcom.mysql.jdbc.jdk5.javac=$JAVA_HOME/bin/javac \
  -Dcom.mysql.jdbc.jdk8.javac=$JAVA_HOME/bin/javac \
  -Dsnapshot.version= \
  -Dcom.mysql.jdbc.extra.libs=lib \
  -Dant.java.version=1.5 \
  -Dant.build.javac.source=1.6 \
  -Dant.build.javac.target=1.6 \
  \
  -Dcom.mysql.jdbc.testsuite.url='jdbc:mysql://localhost/testDB?user=root&password=root&serverTimezone=UTC' \
  -Dcom.mysql.jdbc.testsuite.jvm=$JAVA_HOME \
  -Dcom.mysql.jdbc3.testsuite.jvm.java=$JAVA_HOME/bin/java \
  -Dcom.mysql.jdbc4.testsuite.jvm.java=$JAVA_HOME/bin/java \
  -Dcom.mysql.jdbc42.testsuite.jvm.java=$JAVA_HOME/bin/java \
  -Dcom.mysql.jdbc.noCleanBetweenCompiles=true \
  compile-testsuite test

To select specific tests:

-Dtest=testsuite.simple.StringUtilsTest
-Dtest=testsuite.simple.ConnectionTest -Dmethods=testCacheDefaultTimezone 

The test suite should run in ~15mn.

There are some errors, make sure there are no more than in the previous upload.

See also: https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-testing.html