Skip to content

Commit

Permalink
WL#14042, Upgrade testsuite to JUnit 5.
Browse files Browse the repository at this point in the history
  • Loading branch information
fjssilva committed Apr 25, 2020
1 parent a8fd83b commit 8b6c48c
Show file tree
Hide file tree
Showing 122 changed files with 5,175 additions and 5,034 deletions.
12 changes: 6 additions & 6 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=disabled
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
Expand All @@ -62,8 +62,8 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
Expand Down
2 changes: 2 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

Version 8.0.21

- WL#14042, Upgrade testsuite to JUnit 5.

- Fix for Bug#98237 (30911870), PREPAREDSTATEMENT.SETOBJECT(I, "FALSE", TYPES.BOOLEAN) ALWAYS SETS TRUE OR 1.

- WL#13008, DevAPI: Add schema validation to create collection.
Expand Down
115 changes: 70 additions & 45 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Coverage and instrumentation
============================

This file ships with target "test-coverage" for collecting coverage results and "report-coverage" for creating the HTML coverage report.
The JaCoCo library needed to run these targets can be found at https://github.com/jacoco/jacoco, it's JARs should be placed
The JaCoCo library needed to run these targets can be found at https://github.com/jacoco/jacoco, its JARs should be placed
into ${com.mysql.cj.extra.libs}/jacoco directory.
The "test-coverage" target enables tests execution-time JaCoCo instrumentation, runs tests collecting coverage info into result file
which path is set as ${com.mysql.cj.coverage.result.dir}/${com.mysql.cj.coverage.result.name}.
Expand Down Expand Up @@ -1312,50 +1312,75 @@ See also com.mysql.cj.conf.PropertyDefinitions.SYSP_* variables for other test o
<isset property="com.mysql.cj.coverage.result.dir.final" />
</condition>

<jacoco:coverage destfile="${com.mysql.cj.coverage.result.dir.final}/${com.mysql.cj.coverage.result.name.final}"
enabled="${com.mysql.cj.testsuite.test.coverage}">
<junit printsummary="yes"
fork="on"
forkmode="once"
jvm="${com.mysql.cj.testsuite.jvm.java}"
errorproperty="com.mysql.cj.testsuite.junit.fail"
failureproperty="com.mysql.cj.testsuite.junit.fail">
<jvmarg value="-Xmx1024m" />

<syspropertyset refid="junit.system.properties" />
<sysproperty key="com.mysql.cj.testsuite.url" value="${com.mysql.cj.testsuite.url}" />

<classpath>
<fileset dir="${com.mysql.cj.extra.libs}">
<include name="**/*.jar" />
<exclude name="**/protobuf-java-2.6.0.jar" />
</fileset>
<pathelement location="${com.mysql.cj.build.dir.driver}" />
<pathelement location="${com.mysql.cj.testsuite.build.dir}/${com.mysql.cj.build.driver.fullName}" />
<pathelement path="${com.mysql.cj.testsuite.build.classpath}" />
<pathelement path="${java.class.path}" />
</classpath>

<formatter type="xml" />

<test if="${com.mysql.cj.testsuite.test.methods.enabled}"
name="${com.mysql.cj.testsuite.test.class}"
methods="${com.mysql.cj.testsuite.test.methods}"
todir="${com.mysql.cj.testsuite.junit.results}" />

<test if="com.mysql.cj.testsuite.test.class"
unless="com.mysql.cj.testsuite.test.methods"
name="${com.mysql.cj.testsuite.test.class}"
todir="${com.mysql.cj.testsuite.junit.results}" />

<batchtest unless="com.mysql.cj.testsuite.test.class" todir="${com.mysql.cj.testsuite.junit.results}">
<fileset dir="${com.mysql.cj.testsuite.build.dir}/${com.mysql.cj.build.driver.fullName}">
<include name="**/*Test.java" />
<exclude name="**/perf/*.java" />
</fileset>
</batchtest>
</junit>
</jacoco:coverage>
<local name="com.mysql.cj.testsuite.test.coverage.jvmarg" />
<jacoco:agent destfile="${com.mysql.cj.coverage.result.dir.final}/${com.mysql.cj.coverage.result.name.final}"
enabled="${com.mysql.cj.testsuite.test.coverage}"
property="com.mysql.cj.testsuite.test.coverage.jvmarg" />

<local name="com.mysql.cj.testsuite.test.coverage.jvmargfinal" />
<condition property="com.mysql.cj.testsuite.test.coverage.jvmargfinal"
value="${com.mysql.cj.testsuite.test.coverage.jvmarg}"
else="-Dcoverage=disabled">
<and>
<isset property="com.mysql.cj.testsuite.test.coverage.jvmarg" />
<not>
<equals arg1="${com.mysql.cj.testsuite.test.coverage.jvmarg}" arg2="" />
</not>
</and>
</condition>

<junitlauncher haltOnFailure="false" printSummary="true" failureProperty="com.mysql.cj.testsuite.junit.fail">
<classpath>
<fileset dir="${com.mysql.cj.extra.libs}">
<include name="**/*.jar" />
<exclude name="**/protobuf-java-2.6.0.jar" />
</fileset>
<pathelement location="${com.mysql.cj.build.dir.driver}" />
<pathelement location="${com.mysql.cj.testsuite.build.dir}/${com.mysql.cj.build.driver.fullName}" />
<pathelement path="${com.mysql.cj.testsuite.build.classpath}" />
<pathelement path="${java.class.path}" />
</classpath>

<test if="${com.mysql.cj.testsuite.test.methods.enabled}"
name="${com.mysql.cj.testsuite.test.class}"
methods="${com.mysql.cj.testsuite.test.methods}"
outputdir="${com.mysql.cj.testsuite.junit.results}">
<fork>
<jvmarg value="-Xmx1024m" />
<jvmarg value="${com.mysql.cj.testsuite.test.coverage.jvmargfinal}" />
<syspropertyset refid="junit.system.properties" />
</fork>
<listener type="legacy-xml" sendSysOut="true" sendSysErr="true" />
<listener type="legacy-plain" sendSysOut="true" sendSysErr="true" />
</test>

<test if="com.mysql.cj.testsuite.test.class"
unless="com.mysql.cj.testsuite.test.methods"
name="${com.mysql.cj.testsuite.test.class}"
outputdir="${com.mysql.cj.testsuite.junit.results}">
<fork>
<jvmarg value="-Xmx1024m" />
<jvmarg value="${com.mysql.cj.testsuite.test.coverage.jvmargfinal}" />
<syspropertyset refid="junit.system.properties" />
</fork>
<listener type="legacy-xml" sendSysOut="true" sendSysErr="true" />
<listener type="legacy-plain" sendSysOut="true" sendSysErr="true" />
</test>

<testclasses unless="com.mysql.cj.testsuite.test.class" outputdir="${com.mysql.cj.testsuite.junit.results}">
<fileset dir="${com.mysql.cj.testsuite.build.dir}/${com.mysql.cj.build.driver.fullName}">
<include name="**/*Test.class" />
<exclude name="**/perf/*.class" />
</fileset>
<fork>
<jvmarg value="-Xmx1024m" />
<jvmarg value="${com.mysql.cj.testsuite.test.coverage.jvmargfinal}" />
<syspropertyset refid="junit.system.properties" />
</fork>
<listener type="legacy-xml" sendSysOut="true" sendSysErr="true" />
<listener type="legacy-plain" sendSysOut="true" sendSysErr="true" />
</testclasses>
</junitlauncher>

<junitreport todir="${com.mysql.cj.testsuite.junit.results}/report">
<fileset dir="${com.mysql.cj.testsuite.junit.results}">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 2.0, as published by the
Expand Down Expand Up @@ -29,26 +29,12 @@

package com.mysql.cj.jdbc.integration.jboss;

import java.sql.SQLException;

import org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter;

/**
* Exception sorter used for JBoss to make recovery of downed/stale connections work more consistently.
* Super already implements all that is needed. This class is maintained as a placeholder for configurations pointing to it.
*/
public final class ExtendedMysqlExceptionSorter extends MySQLExceptionSorter {

static final long serialVersionUID = -2454582336945931069L;

@Override
public boolean isExceptionFatal(SQLException ex) {
String sqlState = ex.getSQLState();

if (sqlState != null && sqlState.startsWith("08")) {
return true;
}

return super.isExceptionFatal(ex);
}

}
private static final long serialVersionUID = 9152916997722442502L;
}
Loading

0 comments on commit 8b6c48c

Please sign in to comment.