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 91bb4d1 commit d235c26
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 19 deletions.
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

0 comments on commit d235c26

Please sign in to comment.