20 import java.sql.SQLException;
22 import com.mysql.clusterj.ClusterJUserException;
24 import testsuite.clusterj.AbstractClusterJTest;
29 getConnection(
"target/test-classes/bad-connection-no-connection-lifecycle-interceptor.properties");
30 connection.prepareStatement(
"SELECT 1 FROM DUAL");
31 fail(
"Missing connection lifecycle interceptor should fail with ClusterJUserException.");
32 }
catch (SQLException e) {
34 }
catch (RuntimeException runtimeException) {
35 Throwable sqlException = runtimeException.getCause();
36 if (sqlException instanceof SQLException) {
37 Throwable clusterJException = sqlException.getCause();
39 if (clusterJException.getMessage().contains(
"connectionLifecycleInterceptors")) {
42 fail(
"Exception should contain the string 'connectionLifecycleInterceptors'");
43 if (
getDebug()) sqlException.printStackTrace();
46 fail(
"Exception should be a ClusterJUserException wrapped in a SQLException.");
47 if (
getDebug()) sqlException.printStackTrace();
50 fail(
"Exception should be a ClusterJUserException wrapped in a SQLException.");
51 if (
getDebug()) sqlException.printStackTrace();