diff --git a/pom.xml b/pom.xml index aa6965c5d48fbf1dec88f731e55ade73143062d6..fa36387ac21cef4e387458a86faf65227ffabc18 100644 --- a/pom.xml +++ b/pom.xml @@ -668,6 +668,7 @@ ${maven-checkstyle-plugin.version} src/resources/checkstyle_ci.xml + true **/autogen/**/* @@ -842,6 +843,7 @@ ${maven-checkstyle-plugin.version} src/resources/checkstyle.xml + true **/autogen/**/* diff --git a/sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/rule/EncryptRule.java b/sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/rule/EncryptRule.java index 2da4a0d4dc645ccca23f19afdbdf44995c3d26b6..89e37d5598cbaf2acb259f49105fe9b25a76d99a 100644 --- a/sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/rule/EncryptRule.java +++ b/sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/rule/EncryptRule.java @@ -231,11 +231,7 @@ public final class EncryptRule implements BaseRule { @Override public Object apply(final Object input) { - if (input == null) { - return null; - } else { - return ((ShardingQueryAssistedEncryptor) shardingEncryptor.get()).queryAssistedEncrypt(input.toString()); - } + return null == input ? null : ((ShardingQueryAssistedEncryptor) shardingEncryptor.get()).queryAssistedEncrypt(input.toString()); } }); } @@ -255,11 +251,7 @@ public final class EncryptRule implements BaseRule { @Override public Object apply(final Object input) { - if (input == null) { - return null; - } else { - return String.valueOf(shardingEncryptor.get().encrypt(input.toString())); - } + return null == input ? null : String.valueOf(shardingEncryptor.get().encrypt(input.toString())); } }); } diff --git a/sharding-core/sharding-core-common/src/test/java/org/apache/shardingsphere/core/rule/EncryptRuleTest.java b/sharding-core/sharding-core-common/src/test/java/org/apache/shardingsphere/core/rule/EncryptRuleTest.java index d9a7977706cf2944c662459fc72f116c64acfa0c..18905b06153473535ff9fc19b9a51db5a65dc326 100644 --- a/sharding-core/sharding-core-common/src/test/java/org/apache/shardingsphere/core/rule/EncryptRuleTest.java +++ b/sharding-core/sharding-core-common/src/test/java/org/apache/shardingsphere/core/rule/EncryptRuleTest.java @@ -30,43 +30,38 @@ import java.util.Properties; import static org.junit.Assert.assertNull; -/** - * @author kezhenxu94 - */ -public class EncryptRuleTest { +public final class EncryptRuleTest { + private final String table = "table"; + private final String column = "column"; - + private EncryptRuleConfiguration encryptRuleConfig; - + @Before - public void before() { + public void setUp() { Properties props = new Properties(); - EncryptorRuleConfiguration encryptorConfig = new EncryptorRuleConfiguration("assistedTest", props); EncryptColumnRuleConfiguration columnConfig = new EncryptColumnRuleConfiguration("plain_pwd", "cipher_pwd", "", "aes"); EncryptTableRuleConfiguration tableConfig = new EncryptTableRuleConfiguration(Collections.singletonMap(column, columnConfig)); - encryptRuleConfig = new EncryptRuleConfiguration(); encryptRuleConfig.getEncryptors().put("aes", encryptorConfig); encryptRuleConfig.getTables().put(table, tableConfig); } - + @Test - public void testGetEncryptAssistedQueryValues() { + public void assertGetEncryptAssistedQueryValues() { List encryptAssistedQueryValues = new EncryptRule(encryptRuleConfig).getEncryptAssistedQueryValues(table, column, Collections.singletonList(null)); - for (final Object value : encryptAssistedQueryValues) { assertNull(value); } } - + @Test - public void testGetEncryptValues() { + public void assertGetEncryptValues() { List encryptAssistedQueryValues = new EncryptRule(encryptRuleConfig).getEncryptValues(table, column, Collections.singletonList(null)); - for (final Object value : encryptAssistedQueryValues) { assertNull(value); } } -} \ No newline at end of file +} diff --git a/sharding-core/sharding-core-parse/sharding-core-parse-test/src/test/java/org/apache/shardingsphere/core/parse/integrate/asserts/table/TableAssert.java b/sharding-core/sharding-core-parse/sharding-core-parse-test/src/test/java/org/apache/shardingsphere/core/parse/integrate/asserts/table/TableAssert.java index 3ca66650a74572d4bad33bb185068f28e4aefa43..69215ea0e8946078ffa677e5c557084fd5082f63 100644 --- a/sharding-core/sharding-core-parse/sharding-core-parse-test/src/test/java/org/apache/shardingsphere/core/parse/integrate/asserts/table/TableAssert.java +++ b/sharding-core/sharding-core-parse/sharding-core-parse-test/src/test/java/org/apache/shardingsphere/core/parse/integrate/asserts/table/TableAssert.java @@ -59,7 +59,7 @@ public final class TableAssert { } } - // TODO:yanan remove this method and make sure the table number of xml is correct + // TODO yanan remove this method and make sure the table number of xml is correct private Collection mergeTableSegments(final Collection actual) { Collection result = new LinkedList<>(); Set tableNames = new HashSet<>(actual.size(), 1); @@ -71,7 +71,7 @@ public final class TableAssert { return result; } - // TODO:yanan remove this method and make sure the seq of xml is correct + // TODO yanan remove this method and make sure the seq of xml is correct private Map getExpectedMap(final List expected) { Map result = new HashMap<>(expected.size(), 1); for (ExpectedTable each : expected) { diff --git a/sharding-core/sharding-core-route/src/test/java/org/apache/shardingsphere/core/route/type/broadcast/TableBroadcastRoutingEngineTest.java b/sharding-core/sharding-core-route/src/test/java/org/apache/shardingsphere/core/route/type/broadcast/TableBroadcastRoutingEngineTest.java index 86a211ac2cb51bd67b6f33f0b6b0ba126558dce2..2ba4a306f1413f64a3f8f549107d15749920e49f 100644 --- a/sharding-core/sharding-core-route/src/test/java/org/apache/shardingsphere/core/route/type/broadcast/TableBroadcastRoutingEngineTest.java +++ b/sharding-core/sharding-core-route/src/test/java/org/apache/shardingsphere/core/route/type/broadcast/TableBroadcastRoutingEngineTest.java @@ -67,13 +67,12 @@ public final class TableBroadcastRoutingEngineTest { TableRuleConfiguration tableRuleConfig = new TableRuleConfiguration("t_order", "ds${0..1}.t_order_${0..2}"); ShardingRuleConfiguration shardingRuleConfig = new ShardingRuleConfiguration(); shardingRuleConfig.getTableRuleConfigs().add(tableRuleConfig); - ShardingRule shardingRule = new ShardingRule(shardingRuleConfig, Arrays.asList("ds0", "ds1")); when(sqlStatementContext.getTablesContext()).thenReturn(tablesContext); when(tablesContext.getTableNames()).thenReturn(Lists.newArrayList("t_order")); when(tableMetas.getAllTableNames()).thenReturn(Lists.newArrayList("t_order")); when(tableMetas.get("t_order")).thenReturn(tableMetaData); when(tableMetaData.containsIndex("index_name")).thenReturn(true); - tableBroadcastRoutingEngine = new TableBroadcastRoutingEngine(shardingRule, tableMetas, sqlStatementContext); + tableBroadcastRoutingEngine = new TableBroadcastRoutingEngine(new ShardingRule(shardingRuleConfig, Arrays.asList("ds0", "ds1")), tableMetas, sqlStatementContext); } @Test diff --git a/sharding-integration-test/sharding-jdbc-test/src/test/java/org/apache/shardingsphere/dbtest/engine/BaseIT.java b/sharding-integration-test/sharding-jdbc-test/src/test/java/org/apache/shardingsphere/dbtest/engine/BaseIT.java index fc69705ead4b40919abaf3336616aaf1255f7fe7..7f751731582680e85465ddb0e5264eab3b614a41 100644 --- a/sharding-integration-test/sharding-jdbc-test/src/test/java/org/apache/shardingsphere/dbtest/engine/BaseIT.java +++ b/sharding-integration-test/sharding-jdbc-test/src/test/java/org/apache/shardingsphere/dbtest/engine/BaseIT.java @@ -180,7 +180,7 @@ public abstract class BaseIT { for (String each : integrateTestEnvironment.getShardingRuleTypes()) { SchemaEnvironmentManager.createDatabase(each); } - } catch (final Exception ex) { + } catch (final JAXBException | IOException | SQLException ex) { ex.printStackTrace(); } } @@ -190,7 +190,7 @@ public abstract class BaseIT { for (String each : integrateTestEnvironment.getShardingRuleTypes()) { SchemaEnvironmentManager.createTable(each); } - } catch (final Exception ex) { + } catch (final JAXBException | IOException | SQLException ex) { ex.printStackTrace(); } } @@ -200,7 +200,7 @@ public abstract class BaseIT { for (String each : integrateTestEnvironment.getShardingRuleTypes()) { SchemaEnvironmentManager.dropDatabase(each); } - } catch (final Exception ex) { + } catch (final JAXBException | IOException ex) { ex.printStackTrace(); } } @@ -210,7 +210,7 @@ public abstract class BaseIT { for (String each : integrateTestEnvironment.getShardingRuleTypes()) { SchemaEnvironmentManager.dropTable(each); } - } catch (final Exception ex) { + } catch (final JAXBException | IOException ex) { ex.printStackTrace(); } } diff --git a/sharding-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/jdbc/core/resultset/ResultSetUtil.java b/sharding-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/jdbc/core/resultset/ResultSetUtil.java index 8b51448223dcd76ced3b517edde04c9243a0d560..93177e4237b7e1541580f9e894cfaee91e263efe 100644 --- a/sharding-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/jdbc/core/resultset/ResultSetUtil.java +++ b/sharding-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/jdbc/core/resultset/ResultSetUtil.java @@ -112,7 +112,7 @@ public final class ResultSetUtil { case "java.lang.String": return value.toString(); default: - throw new ShardingException("Unsupported data type:%s", convertType); + throw new ShardingException("Unsupported data type: %s", convertType); } } @@ -128,7 +128,7 @@ public final class ResultSetUtil { case "java.lang.String": return date.toString(); default: - throw new ShardingException("Unsupported Date type:%s", convertType); + throw new ShardingException("Unsupported Date type: %s", convertType); } } diff --git a/sharding-jdbc/sharding-jdbc-core/src/test/java/org/apache/shardingsphere/shardingjdbc/jdbc/adapter/ResultSetGetterAdapterTest.java b/sharding-jdbc/sharding-jdbc-core/src/test/java/org/apache/shardingsphere/shardingjdbc/jdbc/adapter/ResultSetGetterAdapterTest.java index 8606075c8af245cc466ecce960b1110895a75594..d4fa8c4726d6af609ffec2baadfff549d389ffab 100644 --- a/sharding-jdbc/sharding-jdbc-core/src/test/java/org/apache/shardingsphere/shardingjdbc/jdbc/adapter/ResultSetGetterAdapterTest.java +++ b/sharding-jdbc/sharding-jdbc-core/src/test/java/org/apache/shardingsphere/shardingjdbc/jdbc/adapter/ResultSetGetterAdapterTest.java @@ -18,6 +18,7 @@ package org.apache.shardingsphere.shardingjdbc.jdbc.adapter; import org.apache.shardingsphere.core.database.DatabaseTypes; +import org.apache.shardingsphere.core.exception.ShardingException; import org.apache.shardingsphere.shardingjdbc.common.base.AbstractShardingJDBCDatabaseAndTableTest; import org.apache.shardingsphere.shardingjdbc.jdbc.core.connection.ShardingConnection; import org.apache.shardingsphere.shardingjdbc.jdbc.util.JDBCTestSQL; @@ -221,127 +222,127 @@ public final class ResultSetGetterAdapterTest extends AbstractShardingJDBCDataba } @Test - public void assertGetBytesForColumnIndex() { + public void assertGetBytesForColumnIndex() throws SQLException { for (ResultSet each : resultSets.values()) { try { assertTrue(each.getBytes(1).length > 0); fail("Expected an SQLException to be thrown"); - } catch (final Exception ex) { + } catch (final ShardingException ex) { assertFalse(ex.getMessage().isEmpty()); } } } @Test - public void assertGetBytesForColumnLabel() { + public void assertGetBytesForColumnLabel() throws SQLException { for (ResultSet each : resultSets.values()) { try { assertTrue(each.getBytes(columnName).length > 0); fail("Expected an SQLException to be thrown"); - } catch (final Exception ex) { + } catch (final ShardingException ex) { assertFalse(ex.getMessage().isEmpty()); } } } @Test - public void assertGetDateForColumnIndex() { + public void assertGetDateForColumnIndex() throws SQLException { for (ResultSet each : resultSets.values()) { try { each.getDate(1); fail("Expected an SQLException to be thrown"); - } catch (final Exception ex) { + } catch (final ShardingException ex) { assertFalse(ex.getMessage().isEmpty()); } } } @Test - public void assertGetDateForColumnLabel() { + public void assertGetDateForColumnLabel() throws SQLException { for (ResultSet each : resultSets.values()) { try { each.getDate(columnName); fail("Expected an SQLException to be thrown"); - } catch (final Exception ex) { + } catch (final ShardingException ex) { assertFalse(ex.getMessage().isEmpty()); } } } @Test - public void assertGetDateColumnIndexWithCalendar() { + public void assertGetDateColumnIndexWithCalendar() throws SQLException { for (ResultSet each : resultSets.values()) { try { each.getDate(1, Calendar.getInstance()); fail("Expected an SQLException to be thrown"); - } catch (final Exception ex) { + } catch (final ShardingException ex) { assertFalse(ex.getMessage().isEmpty()); } } } @Test - public void assertGetDateColumnLabelWithCalendar() { + public void assertGetDateColumnLabelWithCalendar() throws SQLException { for (ResultSet each : resultSets.values()) { try { each.getDate(columnName, Calendar.getInstance()); fail("Expected an SQLException to be thrown"); - } catch (final Exception ex) { + } catch (final ShardingException ex) { assertFalse(ex.getMessage().isEmpty()); } } } @Test - public void assertGetTimeForColumnIndex() { + public void assertGetTimeForColumnIndex() throws SQLException { for (ResultSet each : resultSets.values()) { try { each.getTime(1); fail("Expected an SQLException to be thrown"); - } catch (final Exception ex) { + } catch (final ShardingException ex) { assertFalse(ex.getMessage().isEmpty()); } } } @Test - public void assertGetTimeForColumnLabel() { + public void assertGetTimeForColumnLabel() throws SQLException { for (ResultSet each : resultSets.values()) { try { each.getTime(columnName); fail("Expected an SQLException to be thrown"); - } catch (final Exception ex) { + } catch (final ShardingException ex) { assertFalse(ex.getMessage().isEmpty()); } } } @Test - public void assertGetTimeColumnIndexWithCalendar() { + public void assertGetTimeColumnIndexWithCalendar() throws SQLException { for (ResultSet each : resultSets.values()) { try { each.getTime(1, Calendar.getInstance()); fail("Expected an SQLException to be thrown"); - } catch (final Exception ex) { + } catch (final ShardingException ex) { assertFalse(ex.getMessage().isEmpty()); } } } @Test - public void assertGetTimeColumnLabelWithCalendar() { + public void assertGetTimeColumnLabelWithCalendar() throws SQLException { for (ResultSet each : resultSets.values()) { try { each.getTime(columnName, Calendar.getInstance()); fail("Expected an SQLException to be thrown"); - } catch (final Exception ex) { + } catch (final ShardingException ex) { assertFalse(ex.getMessage().isEmpty()); } } } @Test - public void assertGetTimestampForColumnIndex() { + public void assertGetTimestampForColumnIndex() throws SQLException { for (Entry each : resultSets.entrySet()) { try { each.getValue().getTimestamp(1); @@ -349,14 +350,14 @@ public final class ResultSetGetterAdapterTest extends AbstractShardingJDBCDataba continue; } fail("Expected an SQLException to be thrown"); - } catch (final Exception ex) { + } catch (final ShardingException ex) { assertFalse(ex.getMessage().isEmpty()); } } } @Test - public void assertGetTimestampForColumnLabel() { + public void assertGetTimestampForColumnLabel() throws SQLException { for (Entry each : resultSets.entrySet()) { try { each.getValue().getTimestamp(columnName); @@ -364,14 +365,14 @@ public final class ResultSetGetterAdapterTest extends AbstractShardingJDBCDataba continue; } fail("Expected an SQLException to be thrown"); - } catch (final Exception ex) { + } catch (final ShardingException ex) { assertFalse(ex.getMessage().isEmpty()); } } } @Test - public void assertGetTimestampColumnIndexWithCalendar() { + public void assertGetTimestampColumnIndexWithCalendar() throws SQLException { for (Entry each : resultSets.entrySet()) { try { each.getValue().getTimestamp(1, Calendar.getInstance()); @@ -379,14 +380,14 @@ public final class ResultSetGetterAdapterTest extends AbstractShardingJDBCDataba continue; } fail("Expected an SQLException to be thrown"); - } catch (final Exception ex) { + } catch (final ShardingException ex) { assertFalse(ex.getMessage().isEmpty()); } } } @Test - public void assertGetTimestampColumnLabelWithCalendar() { + public void assertGetTimestampColumnLabelWithCalendar() throws SQLException { for (Entry each : resultSets.entrySet()) { try { each.getValue().getTimestamp(columnName, Calendar.getInstance()); @@ -394,7 +395,7 @@ public final class ResultSetGetterAdapterTest extends AbstractShardingJDBCDataba continue; } fail("Expected an SQLException to be thrown"); - } catch (final Exception ex) { + } catch (final ShardingException ex) { assertFalse(ex.getMessage().isEmpty()); } } @@ -433,7 +434,7 @@ public final class ResultSetGetterAdapterTest extends AbstractShardingJDBCDataba if (DatabaseTypes.getActualDatabaseType("H2") == each.getKey() || DatabaseTypes.getActualDatabaseType("SQLServer") == each.getKey()) { try { each.getValue().getUnicodeStream(1).read(b); - } catch (final Exception ignored) { + } catch (final ShardingException ignored) { } } else { each.getValue().getUnicodeStream(1).read(b); @@ -453,7 +454,7 @@ public final class ResultSetGetterAdapterTest extends AbstractShardingJDBCDataba if (DatabaseTypes.getActualDatabaseType("H2") == each.getKey() || DatabaseTypes.getActualDatabaseType("SQLServer") == each.getKey()) { try { each.getValue().getUnicodeStream(columnName).read(b); - } catch (final Exception ignored) { + } catch (final ShardingException ignored) { } } else { each.getValue().getUnicodeStream(columnName).read(b); @@ -503,13 +504,14 @@ public final class ResultSetGetterAdapterTest extends AbstractShardingJDBCDataba } @Test - public void assertGetBlobForColumnIndex() { + public void assertGetBlobForColumnIndex() throws SQLException { for (Entry each : resultSets.entrySet()) { if (DatabaseTypes.getActualDatabaseType("H2") == each.getKey()) { try { assertTrue(each.getValue().getBlob(1).length() > 0); fail("Expected an SQLException to be thrown"); - } catch (final Exception ex) { + // TODO need investigate why throw ClassCastException + } catch (final ClassCastException ex) { assertFalse(ex.getMessage().isEmpty()); } } @@ -517,13 +519,14 @@ public final class ResultSetGetterAdapterTest extends AbstractShardingJDBCDataba } @Test - public void assertGetBlobForColumnLabel() { + public void assertGetBlobForColumnLabel() throws SQLException { for (Entry each : resultSets.entrySet()) { if (DatabaseTypes.getActualDatabaseType("H2") == each.getKey()) { try { assertTrue(each.getValue().getBlob(columnName).length() > 0); fail("Expected an SQLException to be thrown"); - } catch (final Exception ex) { + // TODO need investigate why throw ClassCastException + } catch (final ClassCastException ex) { assertFalse(ex.getMessage().isEmpty()); } } @@ -531,48 +534,52 @@ public final class ResultSetGetterAdapterTest extends AbstractShardingJDBCDataba } @Test - public void assertGetClobForColumnIndex() { + public void assertGetClobForColumnIndex() throws SQLException { for (Entry each : resultSets.entrySet()) { try { - assertThat(each.getValue().getClob(1).getSubString(1, 2), is("10")); + each.getValue().getClob(1); fail("Expected an SQLException to be thrown"); - } catch (final Exception ex) { + // TODO need investigate why throw ClassCastException + } catch (final ClassCastException ex) { assertFalse(ex.getMessage().isEmpty()); } } } @Test - public void assertGetClobForColumnLabel() { + public void assertGetClobForColumnLabel() throws SQLException { for (Entry each : resultSets.entrySet()) { try { assertThat(each.getValue().getClob(columnName).getSubString(1, 2), is("10")); fail("Expected an SQLException to be thrown"); - } catch (final Exception ex) { + // TODO need investigate why throw ClassCastException + } catch (final ClassCastException ex) { assertFalse(ex.getMessage().isEmpty()); } } } @Test - public void assertGetURLForColumnIndex() { + public void assertGetURLForColumnIndex() throws SQLException { for (ResultSet each : resultSets.values()) { try { each.getURL(1); fail("Expected an SQLException to be thrown"); - } catch (final Exception ex) { + // TODO need investigate why throw ClassCastException + } catch (final ClassCastException ex) { assertFalse(ex.getMessage().isEmpty()); } } } @Test - public void assertGetURLForColumnLabel() { + public void assertGetURLForColumnLabel() throws SQLException { for (ResultSet each : resultSets.values()) { try { each.getURL(columnName); fail("Expected an SQLException to be thrown"); - } catch (final Exception ex) { + // TODO need investigate why throw ClassCastException + } catch (final ClassCastException ex) { assertFalse(ex.getMessage().isEmpty()); } } @@ -588,7 +595,8 @@ public final class ResultSetGetterAdapterTest extends AbstractShardingJDBCDataba try { each.getValue().getSQLXML(1); fail("Expected an SQLException to be thrown"); - } catch (final Exception ex) { + // TODO need investigate why throw ClassCastException + } catch (final ClassCastException ex) { assertFalse(ex.getMessage().isEmpty()); } } else { @@ -607,7 +615,8 @@ public final class ResultSetGetterAdapterTest extends AbstractShardingJDBCDataba try { each.getValue().getSQLXML(columnName); fail("Expected an SQLException to be thrown"); - } catch (final Exception ex) { + // TODO need investigate why throw ClassCastException + } catch (final ClassCastException ex) { assertFalse(ex.getMessage().isEmpty()); } } else { diff --git a/sharding-orchestration/sharding-orchestration-config/sharding-orchestration-config-zookeeper-curator/src/test/java/org/apache/shardingsphere/orchestration/config/zookeeper/curator/util/EmbedTestingServer.java b/sharding-orchestration/sharding-orchestration-config/sharding-orchestration-config-zookeeper-curator/src/test/java/org/apache/shardingsphere/orchestration/config/zookeeper/curator/util/EmbedTestingServer.java index b385a7918ebe389928c69a5632852cf702f91a72..0be1f2ba0bbee5992a01f855c435a6139149b61c 100644 --- a/sharding-orchestration/sharding-orchestration-config/sharding-orchestration-config-zookeeper-curator/src/test/java/org/apache/shardingsphere/orchestration/config/zookeeper/curator/util/EmbedTestingServer.java +++ b/sharding-orchestration/sharding-orchestration-config/sharding-orchestration-config-zookeeper-curator/src/test/java/org/apache/shardingsphere/orchestration/config/zookeeper/curator/util/EmbedTestingServer.java @@ -41,7 +41,9 @@ public final class EmbedTestingServer { } try { testingServer = new TestingServer(PORT, new File(String.format("target/test_zk_data/%s/", System.nanoTime()))); + // CHECKSTYLE:OFF } catch (final Exception ex) { + // CHECKSTYLE:ON if (!isIgnoredException(ex)) { throw new RuntimeException(ex); } diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/test/java/org/apache/shardingsphere/orchestration/config/zookeeper/curator/util/EmbedTestingServer.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/test/java/org/apache/shardingsphere/orchestration/config/zookeeper/curator/util/EmbedTestingServer.java index b385a7918ebe389928c69a5632852cf702f91a72..0be1f2ba0bbee5992a01f855c435a6139149b61c 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/test/java/org/apache/shardingsphere/orchestration/config/zookeeper/curator/util/EmbedTestingServer.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/test/java/org/apache/shardingsphere/orchestration/config/zookeeper/curator/util/EmbedTestingServer.java @@ -41,7 +41,9 @@ public final class EmbedTestingServer { } try { testingServer = new TestingServer(PORT, new File(String.format("target/test_zk_data/%s/", System.nanoTime()))); + // CHECKSTYLE:OFF } catch (final Exception ex) { + // CHECKSTYLE:ON if (!isIgnoredException(ex)) { throw new RuntimeException(ex); } diff --git a/sharding-orchestration/sharding-orchestration-zookeeper-curator-integration-test/src/test/java/org/apache/shardingsphere/orchestration/zookeeper/curator/integration/util/EmbedTestingServer.java b/sharding-orchestration/sharding-orchestration-zookeeper-curator-integration-test/src/test/java/org/apache/shardingsphere/orchestration/zookeeper/curator/integration/util/EmbedTestingServer.java index b69dc8585c7d02efba63ab81bce79b78e03e66a1..57bed2a908f1807d141dad1645d60b20325ae596 100644 --- a/sharding-orchestration/sharding-orchestration-zookeeper-curator-integration-test/src/test/java/org/apache/shardingsphere/orchestration/zookeeper/curator/integration/util/EmbedTestingServer.java +++ b/sharding-orchestration/sharding-orchestration-zookeeper-curator-integration-test/src/test/java/org/apache/shardingsphere/orchestration/zookeeper/curator/integration/util/EmbedTestingServer.java @@ -41,7 +41,9 @@ public final class EmbedTestingServer { } try { testingServer = new TestingServer(PORT, new File(String.format("target/test_zk_data/%s/", System.nanoTime()))); + // CHECKSTYLE:OFF } catch (final Exception ex) { + // CHECKSTYLE:ON if (!isIgnoredException(ex)) { throw new RuntimeException(ex); } diff --git a/sharding-spring/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/test/java/org/apache/shardingsphere/shardingjdbc/orchestration/spring/boot/util/EmbedTestingServer.java b/sharding-spring/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/test/java/org/apache/shardingsphere/shardingjdbc/orchestration/spring/boot/util/EmbedTestingServer.java index d4995504f00c2e594ab08a1c3c347c928efc4dd5..0c672d9cb071c8334a576c8007151d569c44c0d3 100644 --- a/sharding-spring/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/test/java/org/apache/shardingsphere/shardingjdbc/orchestration/spring/boot/util/EmbedTestingServer.java +++ b/sharding-spring/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/test/java/org/apache/shardingsphere/shardingjdbc/orchestration/spring/boot/util/EmbedTestingServer.java @@ -43,7 +43,9 @@ public final class EmbedTestingServer { } try { testingServer = new TestingServer(PORT, new File(String.format("target/test_zk_data/%s/", System.nanoTime()))); + // CHECKSTYLE:OFF } catch (final Exception ex) { + // CHECKSTYLE:ON if (!isIgnoredException(ex)) { throw new RuntimeException(ex); } diff --git a/sharding-spring/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/java/org/apache/shardingsphere/shardingjdbc/orchestration/spring/util/EmbedTestingServer.java b/sharding-spring/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/java/org/apache/shardingsphere/shardingjdbc/orchestration/spring/util/EmbedTestingServer.java index 3129d43f0d7a953065f2aa9768655589d52da895..5c6c7e349770f71dbb5d8abe5ef050a174db4cb6 100644 --- a/sharding-spring/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/java/org/apache/shardingsphere/shardingjdbc/orchestration/spring/util/EmbedTestingServer.java +++ b/sharding-spring/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/java/org/apache/shardingsphere/shardingjdbc/orchestration/spring/util/EmbedTestingServer.java @@ -43,7 +43,9 @@ public final class EmbedTestingServer { } try { testingServer = new TestingServer(PORT, new File(String.format("target/test_zk_data/%s/", System.nanoTime()))); + // CHECKSTYLE:OFF } catch (final Exception ex) { + // CHECKSTYLE:ON if (!isIgnoredException(ex)) { throw new RuntimeException(ex); }