This is an automated email from the ASF dual-hosted git repository.

menghaoran pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 688c740  Fix test cases for MySQL-proxy with empty rule (#15384)
688c740 is described below

commit 688c7400788b69000a67a19436dac976b15a8608
Author: Liang Zhang <[email protected]>
AuthorDate: Sat Feb 12 23:29:47 2022 +0800

    Fix test cases for MySQL-proxy with empty rule (#15384)
    
    * Fix test case for MySQL-proxy with empty rule
    
    * Fix test case for MySQL-proxy with empty rule
    
    * Fix test case for MySQL-proxy with empty rule
    
    * Fix test case for MySQL-proxy with empty rule
---
 .../container/atomic/storage/StorageContainer.java    | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git 
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/container/atomic/storage/StorageContainer.java
 
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/container/atomic/storage/StorageContainer.java
index a7c683f..664f52e 100644
--- 
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/container/atomic/storage/StorageContainer.java
+++ 
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/container/atomic/storage/StorageContainer.java
@@ -17,7 +17,6 @@
 
 package 
org.apache.shardingsphere.test.integration.framework.container.atomic.storage;
 
-import com.zaxxer.hikari.HikariConfig;
 import com.zaxxer.hikari.HikariDataSource;
 import lombok.Getter;
 import lombok.SneakyThrows;
@@ -79,15 +78,15 @@ public abstract class StorageContainer extends 
AtomicContainer {
     }
     
     private DataSource createDataSource(final String dataSourceName) {
-        HikariConfig config = new HikariConfig();
-        
config.setDriverClassName(DataSourceEnvironment.getDriverClassName(databaseType));
-        config.setJdbcUrl(DataSourceEnvironment.getURL(databaseType, 
isFakedContainer() ? null : getHost(), getPort(), dataSourceName));
-        config.setUsername(getUsername());
-        config.setPassword(getPassword());
-        config.setMaximumPoolSize(4);
-        config.setTransactionIsolation("TRANSACTION_READ_COMMITTED");
-        getConnectionInitSQL().ifPresent(config::setConnectionInitSql);
-        return new HikariDataSource(config);
+        HikariDataSource result = new HikariDataSource();
+        
result.setDriverClassName(DataSourceEnvironment.getDriverClassName(databaseType));
+        result.setJdbcUrl(DataSourceEnvironment.getURL(databaseType, 
isFakedContainer() ? null : getHost(), getPort(), dataSourceName));
+        result.setUsername(getUsername());
+        result.setPassword(getPassword());
+        result.setMaximumPoolSize(4);
+        result.setTransactionIsolation("TRANSACTION_READ_COMMITTED");
+        getConnectionInitSQL().ifPresent(result::setConnectionInitSql);
+        return result;
     }
     
     protected abstract String getUsername();

Reply via email to