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

zhangliang 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 eda5d70a8fd Refactor : import a new module and fix some checkstyle 
issues (#21141)
eda5d70a8fd is described below

commit eda5d70a8fd396f15d4d18ae935e995e61bfa38b
Author: 孙念君 Nianjun Sun <[email protected]>
AuthorDate: Thu Sep 22 20:48:26 2022 +0800

    Refactor : import a new module and fix some checkstyle issues (#21141)
---
 shardingsphere-test/shardingsphere-integration-test/pom.xml  |  1 +
 .../composer/ClusterShowProcessListContainerComposer.java    |  6 ++----
 .../showprocesslist/engine/ShowProcessListIT.java            | 12 +++++++-----
 3 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/shardingsphere-test/shardingsphere-integration-test/pom.xml 
b/shardingsphere-test/shardingsphere-integration-test/pom.xml
index 3250f3c777c..a45435e55cc 100644
--- a/shardingsphere-test/shardingsphere-integration-test/pom.xml
+++ b/shardingsphere-test/shardingsphere-integration-test/pom.xml
@@ -35,6 +35,7 @@
         <module>shardingsphere-integration-test-scaling</module>
         <module>shardingsphere-integration-test-transaction</module>
         <module>shardingsphere-integration-test-ha</module>
+        <module>shardingsphere-integration-test-showprocesslist</module>
     </modules>
     
     <properties>
diff --git 
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-showprocesslist/src/test/java/org/apache/shardingsphere/test/integration/showprocesslist/container/composer/ClusterShowProcessListContainerComposer.java
 
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-showprocesslist/src/test/java/org/apache/shardingsphere/test/integration/showprocesslist/container/composer/ClusterShowProcessListContainerComposer.java
index 4bfb50916af..d8850daff3c 100644
--- 
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-showprocesslist/src/test/java/org/apache/shardingsphere/test/integration/showprocesslist/container/composer/ClusterShowProcessListContainerComposer.java
+++ 
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-showprocesslist/src/test/java/org/apache/shardingsphere/test/integration/showprocesslist/container/composer/ClusterShowProcessListContainerComposer.java
@@ -55,10 +55,8 @@ public final class ClusterShowProcessListContainerComposer {
                 
StorageContainerConfigurationFactory.newInstance(parameterized.getDatabaseType())));
         AdaptorContainerConfiguration containerConfig = new 
AdaptorContainerConfiguration(parameterized.getScenario(),
                 getMountedResources(parameterized.getScenario(), 
parameterized.getDatabaseType()), 
AdapterContainerUtil.getAdapterContainerImage());
-        jdbcContainer = AdapterContainerFactory.newInstance(
-                "cluster", "jdbc", parameterized.getDatabaseType(), 
storageContainer, parameterized.getScenario(), containerConfig);
-        proxyContainer = AdapterContainerFactory.newInstance(
-                "cluster", "proxy", parameterized.getDatabaseType(), 
storageContainer, parameterized.getScenario(), containerConfig);
+        jdbcContainer = AdapterContainerFactory.newInstance("cluster", "jdbc", 
parameterized.getDatabaseType(), storageContainer, parameterized.getScenario(), 
containerConfig);
+        proxyContainer = AdapterContainerFactory.newInstance("cluster", 
"proxy", parameterized.getDatabaseType(), storageContainer, 
parameterized.getScenario(), containerConfig);
         if (proxyContainer instanceof DockerITContainer) {
             ((DockerITContainer) 
proxyContainer).dependsOn(governanceContainer, storageContainer);
         }
diff --git 
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-showprocesslist/src/test/java/org/apache/shardingsphere/test/integration/showprocesslist/engine/ShowProcessListIT.java
 
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-showprocesslist/src/test/java/org/apache/shardingsphere/test/integration/showprocesslist/engine/ShowProcessListIT.java
index c1aebe4f143..b2aba8b2f9c 100644
--- 
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-showprocesslist/src/test/java/org/apache/shardingsphere/test/integration/showprocesslist/engine/ShowProcessListIT.java
+++ 
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-showprocesslist/src/test/java/org/apache/shardingsphere/test/integration/showprocesslist/engine/ShowProcessListIT.java
@@ -81,8 +81,9 @@ public final class ShowProcessListIT {
         CompletableFuture<Void> executeSelectSleep2 = 
CompletableFuture.runAsync(getExecuteSleepThread("proxy"));
         CompletableFuture<Void> executeSelectSleep3 = 
CompletableFuture.runAsync(getExecuteSleepThread("proxy"));
         Thread.sleep(100);
-        try (Connection connection = 
containerComposer.getProxyDataSource().getConnection();
-             Statement statement = connection.createStatement()
+        try (
+                Connection connection = 
containerComposer.getProxyDataSource().getConnection(); 
+                Statement statement = connection.createStatement()
         ) {
             ResultSet resultSet = statement.executeQuery("show processlist");
             assertResultSet(resultSet);
@@ -105,10 +106,11 @@ public final class ShowProcessListIT {
         assertTrue(resultSet.next());
     }
     
-    private Runnable getExecuteSleepThread(String targetContainer) {
+    private Runnable getExecuteSleepThread(final String targetContainer) {
         return () -> {
-            try (Connection connection = "proxy".equals(targetContainer) ? 
containerComposer.getProxyDataSource().getConnection() : 
containerComposer.getJdbcDataSource().getConnection();
-                 Statement statement = connection.createStatement()
+            try (
+                    Connection connection = "proxy".equals(targetContainer) ? 
containerComposer.getProxyDataSource().getConnection() : 
containerComposer.getJdbcDataSource().getConnection(); 
+                    Statement statement = connection.createStatement()
             ) {
                 statement.executeQuery("select sleep(10)");
             } catch (SQLException ex) {

Reply via email to