Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#noissue] Fix JDBC test failures #11861

Merged
merged 1 commit into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ private Connection connectDB() throws SQLException {
public void testModify() throws Exception {
logger.debug("testModify");

try (Connection connection = connectDB() ) {

final Connection con = connectDB();
try (Connection connection = con) {
logger.debug("Connection class name:{}", connection.getClass().getName());
logger.debug("Connection class cl:{}", connection.getClass().getClassLoader());

Expand Down Expand Up @@ -152,11 +152,11 @@ public void testModify() throws Exception {
preparedStatement7(connection);

preparedStatement8(connection);

DatabaseInfo clearUrl = ((DatabaseInfoAccessor) connection)._$PINPOINT$_getDatabaseInfo();
Assertions.assertNull(clearUrl);
}

DatabaseInfo clearUrl = ((DatabaseInfoAccessor) con)._$PINPOINT$_getDatabaseInfo();
Assertions.assertNull(clearUrl);

}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ protected JDBCDriverClass getJDBCDriverClass() {
public void testModify() throws Exception {

DriverProperties driverProperties = getDriverProperties();
try (Connection connection = getConnection(driverProperties)) {
final Connection con = getConnection(driverProperties);
try (Connection connection = con) {

logger.info("Connection class name:{}", connection.getClass().getName());
logger.info("Connection class cl:{}", connection.getClass().getClassLoader());
Expand All @@ -81,10 +82,10 @@ public void testModify() throws Exception {

preparedStatement3(connection);

DatabaseInfo clearUrl = ((DatabaseInfoAccessor) connection)._$PINPOINT$_getDatabaseInfo();
Assertions.assertNull(clearUrl);
}

DatabaseInfo clearUrl = ((DatabaseInfoAccessor) con)._$PINPOINT$_getDatabaseInfo();
Assertions.assertNull(clearUrl);
}

private void statement(Connection connection) throws SQLException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ protected JDBCDriverClass getJDBCDriverClass() {
public void testModify() throws Exception {

DriverProperties driverProperties = getDriverProperties();
try (Connection connection = getConnection(driverProperties)) {
final Connection con = getConnection(driverProperties);
try (Connection connection = con) {

logger.info("Connection class name:{}", connection.getClass().getName());
logger.info("Connection class cl:{}", connection.getClass().getClassLoader());
Expand All @@ -79,11 +80,10 @@ public void testModify() throws Exception {
preparedStatement2(connection);

preparedStatement3(connection);

DatabaseInfo clearUrl = ((DatabaseInfoAccessor) connection)._$PINPOINT$_getDatabaseInfo();
Assertions.assertNull(clearUrl);
}

DatabaseInfo clearUrl = ((DatabaseInfoAccessor) con)._$PINPOINT$_getDatabaseInfo();
Assertions.assertNull(clearUrl);
}

private void statement(Connection connection) throws SQLException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ public static DriverProperties getDriverProperties() {
@Test
public void loadBalancedUrlModify() throws Exception {
// random fail
try (Connection connection = getConnection(getDriverProperties())) {
final Connection con = getConnection(getDriverProperties());
try (Connection connection = con) {

logger.info("Connection class name:{}", connection.getClass().getName());
logger.info("Connection class cl:{}", connection.getClass().getClassLoader());
Expand Down Expand Up @@ -114,11 +115,10 @@ public void loadBalancedUrlModify() throws Exception {
preparedStatement7(connection);

preparedStatement8(connection);

DatabaseInfo clearUrl = ((DatabaseInfoAccessor) internalConnection)._$PINPOINT$_getDatabaseInfo();
Assertions.assertNull(clearUrl);
}

DatabaseInfo clearUrl = ((DatabaseInfoAccessor) con)._$PINPOINT$_getDatabaseInfo();
Assertions.assertNull(clearUrl);
}

private void statement(Connection connection) throws SQLException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ public static DriverProperties getDriverProperties() {
@Test
public void loadBalancedUrlModify() throws Exception {
// random fail
try (Connection connection = getConnection(getDriverProperties())) {
final Connection con = getConnection(getDriverProperties());
try (Connection connection = con) {

logger.info("Connection class name:{}", connection.getClass().getName());
logger.info("Connection class cl:{}", connection.getClass().getClassLoader());
Expand Down Expand Up @@ -115,10 +116,10 @@ public void loadBalancedUrlModify() throws Exception {

preparedStatement8(connection);

DatabaseInfo clearUrl = ((DatabaseInfoAccessor) internalConnection)._$PINPOINT$_getDatabaseInfo();
Assertions.assertNull(clearUrl);
}

DatabaseInfo clearUrl = ((DatabaseInfoAccessor) con)._$PINPOINT$_getDatabaseInfo();
Assertions.assertNull(clearUrl);
}

private void statement(Connection connection) throws SQLException {
Expand Down