Skip to content

Commit

Permalink
[#noissue] Fix JDBC test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
emeroad committed Dec 26, 2024
1 parent 65fa21a commit 558dcf3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ public static DriverProperties getDriverProperties() {
@Test
public void loadBalancedUrlModify() throws Exception {
// random fail
final Connection con = getConnection(getDriverProperties());
try (Connection connection = con) {
final Object internalConnection;
try (Connection connection = getConnection(getDriverProperties())) {

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

current.setAccessible(true);
Object internalConnection = current.get(invocationHandler);
internalConnection = current.get(invocationHandler);


DatabaseInfo url = ((DatabaseInfoAccessor) internalConnection)._$PINPOINT$_getDatabaseInfo();
Expand All @@ -117,7 +117,7 @@ public void loadBalancedUrlModify() throws Exception {
preparedStatement8(connection);
}

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

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

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

current.setAccessible(true);
Object internalConnection = current.get(invocationHandler);
internalConnection = current.get(invocationHandler);


DatabaseInfo url = ((DatabaseInfoAccessor) internalConnection)._$PINPOINT$_getDatabaseInfo();
Expand All @@ -118,7 +118,7 @@ public void loadBalancedUrlModify() throws Exception {

}

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

Expand Down

0 comments on commit 558dcf3

Please sign in to comment.