You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by yx...@apache.org on 2022/05/02 16:08:36 UTC
[shardingsphere] branch master updated: Refactor "true" and "false" to Boolean.TRUE.toString() and Boolean.FALSE.toString() (#17277)
This is an automated email from the ASF dual-hosted git repository.
yx9o 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 49ac3869f69 Refactor "true" and "false" to Boolean.TRUE.toString() and Boolean.FALSE.toString() (#17277)
49ac3869f69 is described below
commit 49ac3869f693a6efec0072c291489e5e32d200b3
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Tue May 3 00:08:27 2022 +0800
Refactor "true" and "false" to Boolean.TRUE.toString() and Boolean.FALSE.toString() (#17277)
* Refactor CosIdSnowflakeIntervalShardingAlgorithmTest
* Refactor "true" to Boolean.TRUE.toString()
* Refactor "true" to Boolean.TRUE.toString()
* Refactor "true" to Boolean.TRUE.toString()
* Refactor "true" to Boolean.TRUE.toString()
* Refactor "true" to Boolean.TRUE.toString()
* Refactor "true" to Boolean.TRUE.toString()
* Refactor "true" to Boolean.TRUE.toString()
* Refactor "true" to Boolean.TRUE.toString()
* Refactor "true" to Boolean.TRUE.toString()
* Refactor "true" to Boolean.TRUE.toString()
* Refactor "false" to Boolean.FALSE.toString()
* Refactor "false" to Boolean.FALSE.toString()
* Refactor "false" to Boolean.FALSE.toString()
---
.../mysql/format/MySQLParserFormatExample.java | 2 +-
.../raw/jdbc/config/BaseShadowConfiguration.java | 4 +--
.../agent/core/plugin/PluginContext.java | 2 +-
.../JaegerTracingPluginBootServiceTest.java | 2 +-
.../shadow/hint/SimpleHintShadowAlgorithmTest.java | 2 +-
.../ShadowNonDMLStatementRoutingEngineTest.java | 2 +-
.../PropertiesShadowSpringBootStarterTest.java | 2 +-
.../ShadowAlgorithmSpringNamespaceTest.java | 2 +-
.../ShadowDefaultAlgorithmSpringNamespaceTest.java | 2 +-
.../ComplexInlineShardingAlgorithmTest.java | 2 +-
...osIdSnowflakeIntervalShardingAlgorithmTest.java | 32 ++++++++++++----------
.../sharding/cosid/PropertiesUtilTest.java | 4 +--
.../inline/InlineShardingAlgorithmTest.java | 2 +-
.../query/ShowScalingJobStatusQueryResultSet.java | 2 +-
.../query/ShowScalingListQueryResultSet.java | 2 +-
.../postgres/PostgresTablePropertiesLoader.java | 8 +++---
.../dialect/MariaDBDataSourceMetaDataTest.java | 2 +-
.../dialect/MySQLDataSourceMetaDataTest.java | 2 +-
.../metadata/url/StandardJdbcUrlParserTest.java | 4 +--
.../ShardingSpherePipelineDataSourceCreator.java | 5 ++--
.../resultset/DatabaseMetaDataResultSetTest.java | 10 +++----
.../dialect/PostgreSQLPrivilegeHandler.java | 2 +-
.../ingest/wal/decode/MppdbDecodingPluginTest.java | 4 +--
.../datanode/SingleTableDataNodeLoaderTest.java | 4 +--
.../traffic/hint/SQLHintTrafficAlgorithmTest.java | 4 +--
.../config/NarayanaConfigurationFileGenerator.java | 6 ++--
.../NarayanaConfigurationFileGeneratorTest.java | 6 ++--
.../ClusterContextManagerCoordinatorTest.java | 4 +--
.../text/distsql/ral/advanced/FormatHandler.java | 2 +-
.../queryable/ShowInstanceModeHandlerTest.java | 2 +-
.../queryable/ShowSQLParserRuleHandlerTest.java | 2 +-
.../queryable/ShowVariableBackendHandlerTest.java | 2 +-
.../updatable/SetVariableBackendHandlerTest.java | 2 +-
.../common/updatable/SetVariableExecutorTest.java | 4 +--
34 files changed, 71 insertions(+), 68 deletions(-)
diff --git a/examples/other-example/shardingsphere-parser-example/src/main/java/org/apache/shardingsphere/example/parser/mysql/format/MySQLParserFormatExample.java b/examples/other-example/shardingsphere-parser-example/src/main/java/org/apache/shardingsphere/example/parser/mysql/format/MySQLParserFormatExample.java
index bbebe3bccdb..c8d12888c73 100644
--- a/examples/other-example/shardingsphere-parser-example/src/main/java/org/apache/shardingsphere/example/parser/mysql/format/MySQLParserFormatExample.java
+++ b/examples/other-example/shardingsphere-parser-example/src/main/java/org/apache/shardingsphere/example/parser/mysql/format/MySQLParserFormatExample.java
@@ -54,7 +54,7 @@ public final class MySQLParserFormatExample {
public static void main(String[] args) {
MYSQL_FORMAT_SQL_LIST.forEach(each -> {
Properties props = new Properties();
- props.setProperty("parameterized", "false");
+ props.setProperty("parameterized", Boolean.FALSE.toString());
CacheOption cacheOption = new CacheOption(128, 1024L, 4);
SQLParserEngine parserEngine = new SQLParserEngine("MySQL", cacheOption);
ParseASTNode parseASTNode = parserEngine.parse(each, false);
diff --git a/examples/shardingsphere-jdbc-example/single-feature-example/shadow-example/shadow-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/shadow/raw/jdbc/config/BaseShadowConfiguration.java b/examples/shardingsphere-jdbc-example/single-feature-example/shadow-example/shadow-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/shadow/raw/jdbc/config/BaseShadowConfiguration.java
index 8da39db01b5..2596d8b2d8e 100644
--- a/examples/shardingsphere-jdbc-example/single-feature-example/shadow-example/shadow-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/shadow/raw/jdbc/config/BaseShadowConfiguration.java
+++ b/examples/shardingsphere-jdbc-example/single-feature-example/shadow-example/shadow-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/shadow/raw/jdbc/config/BaseShadowConfiguration.java
@@ -42,7 +42,7 @@ public abstract class BaseShadowConfiguration implements ExampleConfiguration {
protected Properties createShardingSphereProps() {
Properties result = new Properties();
- result.setProperty(ConfigurationPropertyKey.SQL_SHOW.getKey(), "true");
+ result.setProperty(ConfigurationPropertyKey.SQL_SHOW.getKey(), Boolean.TRUE.toString());
return result;
}
@@ -79,7 +79,7 @@ public abstract class BaseShadowConfiguration implements ExampleConfiguration {
userIdSelectProps.setProperty("value", "1");
result.put("user-id-select-match-algorithm", new ShardingSphereAlgorithmConfiguration("VALUE_MATCH", userIdSelectProps));
Properties noteAlgorithmProps = new Properties();
- noteAlgorithmProps.setProperty("shadow", "true");
+ noteAlgorithmProps.setProperty("shadow", Boolean.TRUE.toString());
noteAlgorithmProps.setProperty("foo", "bar");
result.put("simple-hint-algorithm", new ShardingSphereAlgorithmConfiguration("SIMPLE_HINT", noteAlgorithmProps));
return result;
diff --git a/shardingsphere-agent/shardingsphere-agent-core/src/main/java/org/apache/shardingsphere/agent/core/plugin/PluginContext.java b/shardingsphere-agent/shardingsphere-agent-core/src/main/java/org/apache/shardingsphere/agent/core/plugin/PluginContext.java
index d2c69d98ed9..c6c62a0595f 100644
--- a/shardingsphere-agent/shardingsphere-agent-core/src/main/java/org/apache/shardingsphere/agent/core/plugin/PluginContext.java
+++ b/shardingsphere-agent/shardingsphere-agent-core/src/main/java/org/apache/shardingsphere/agent/core/plugin/PluginContext.java
@@ -30,6 +30,6 @@ public final class PluginContext {
* @return the plugin enable value
*/
public static boolean isPluginEnabled() {
- return !"false".equalsIgnoreCase(System.getProperty(PLUGIN_ENABLED_KEY)) && !"0".equalsIgnoreCase(System.getProperty(PLUGIN_ENABLED_KEY));
+ return !Boolean.FALSE.toString().equalsIgnoreCase(System.getProperty(PLUGIN_ENABLED_KEY)) && !"0".equalsIgnoreCase(System.getProperty(PLUGIN_ENABLED_KEY));
}
}
diff --git a/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-jaeger/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/jaeger/service/JaegerTracingPluginBootServiceTest.java b/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-jaeger/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/jaeger/service/JaegerTracingPluginBootServiceTest.java
index 007d729eea7..5330d44462d 100644
--- a/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-jaeger/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/jaeger/service/JaegerTracingPluginBootServiceTest.java
+++ b/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-jaeger/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/jaeger/service/JaegerTracingPluginBootServiceTest.java
@@ -38,7 +38,7 @@ public final class JaegerTracingPluginBootServiceTest {
Properties props = new Properties();
props.setProperty("JAEGER_SAMPLER_TYPE", "const");
props.setProperty("JAEGER_SAMPLER_PARAM", "1");
- props.setProperty("JAEGER_REPORTER_LOG_SPANS", "true");
+ props.setProperty("JAEGER_REPORTER_LOG_SPANS", Boolean.TRUE.toString());
props.setProperty("JAEGER_REPORTER_FLUSH_INTERVAL", "1");
jaegerTracingPluginBootService.start(new PluginConfiguration("localhost", 5775, "", props));
assertTrue(GlobalTracer.isRegistered());
diff --git a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/algorithm/shadow/hint/SimpleHintShadowAlgorithmTest.java b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/algorithm/shadow/hint/SimpleHintShadowAlgorithmTest.java
index 7181ac95af2..72c4e72fb86 100644
--- a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/algorithm/shadow/hint/SimpleHintShadowAlgorithmTest.java
+++ b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/algorithm/shadow/hint/SimpleHintShadowAlgorithmTest.java
@@ -36,7 +36,7 @@ public final class SimpleHintShadowAlgorithmTest {
public void init() {
shadowAlgorithm = new SimpleHintShadowAlgorithm();
Properties props = new Properties();
- props.setProperty("shadow", "true");
+ props.setProperty("shadow", Boolean.TRUE.toString());
shadowAlgorithm.setProps(props);
shadowAlgorithm.init();
}
diff --git a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/route/engine/impl/ShadowNonDMLStatementRoutingEngineTest.java b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/route/engine/impl/ShadowNonDMLStatementRoutingEngineTest.java
index c97fbffd3f2..72f07338b3f 100644
--- a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/route/engine/impl/ShadowNonDMLStatementRoutingEngineTest.java
+++ b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/route/engine/impl/ShadowNonDMLStatementRoutingEngineTest.java
@@ -81,7 +81,7 @@ public final class ShadowNonDMLStatementRoutingEngineTest {
private Map<String, ShadowAlgorithm> createShadowAlgorithms() {
SimpleHintShadowAlgorithm simpleHintShadowAlgorithm = new SimpleHintShadowAlgorithm();
Properties props = new Properties();
- props.setProperty("shadow", "true");
+ props.setProperty("shadow", Boolean.TRUE.toString());
simpleHintShadowAlgorithm.setProps(props);
simpleHintShadowAlgorithm.init();
return Collections.singletonMap("simple-hint-algorithm", simpleHintShadowAlgorithm);
diff --git a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-spring/shardingsphere-shadow-spring-boot-starter/src/test/java/org/apache/shardingsphere/shadow/spring/boot/PropertiesShadowSpringBootStarterTest.java b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-spring/shardingsphere-shadow-spring-boot-starter/src/test/java/org/apache/shardingsphere/shadow/spring/boot/PropertiesShadowSpringBootStarterTest.java
index ee2c362dfa1..6429609f8a6 100644
--- a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-spring/shardingsphere-shadow-spring-boot-starter/src/test/java/org/apache/shardingsphere/shadow/spring/boot/PropertiesShadowSpringBootStarterTest.java
+++ b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-spring/shardingsphere-shadow-spring-boot-starter/src/test/java/org/apache/shardingsphere/shadow/spring/boot/PropertiesShadowSpringBootStarterTest.java
@@ -65,7 +65,7 @@ public class PropertiesShadowSpringBootStarterTest {
ShadowAlgorithm simpleHintAlgorithm = shadowAlgorithms.get("simple-hint-algorithm");
assertThat(simpleHintAlgorithm, instanceOf(SimpleHintShadowAlgorithm.class));
assertThat(simpleHintAlgorithm.getType(), is("SIMPLE_HINT"));
- assertThat(simpleHintAlgorithm.getProps().get("shadow"), is("true"));
+ assertThat(simpleHintAlgorithm.getProps().get("shadow"), is(Boolean.TRUE.toString()));
assertThat(simpleHintAlgorithm.getProps().get("foo"), is("bar"));
}
diff --git a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-spring/shardingsphere-shadow-spring-namespace/src/test/java/org/apache/shardingsphere/shadow/spring/namespace/ShadowAlgorithmSpringNamespaceTest.java b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-spring/shardingsphere-shadow-spring-namespace/src/test/java/org/apache/shardingsphere/shadow/spring/namespace/ShadowAlgorithmSpringNamespaceTest.java
index 29cd6fbf60e..cc402114cd0 100644
--- a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-spring/shardingsphere-shadow-spring-namespace/src/test/java/org/apache/shardingsphere/shadow/spring/namespace/ShadowAlgorithmSpringNamespaceTest.java
+++ b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-spring/shardingsphere-shadow-spring-namespace/src/test/java/org/apache/shardingsphere/shadow/spring/namespace/ShadowAlgorithmSpringNamespaceTest.java
@@ -65,7 +65,7 @@ public final class ShadowAlgorithmSpringNamespaceTest extends AbstractJUnit4Spri
ShadowAlgorithm simpleHintAlgorithm = shadowAlgorithms.get("simple-hint-algorithm");
assertThat(simpleHintAlgorithm, instanceOf(SimpleHintShadowAlgorithm.class));
assertThat(simpleHintAlgorithm.getType(), is("SIMPLE_HINT"));
- assertThat(simpleHintAlgorithm.getProps().get("shadow"), is("true"));
+ assertThat(simpleHintAlgorithm.getProps().get("shadow"), is(Boolean.TRUE.toString()));
assertThat(simpleHintAlgorithm.getProps().get("foo"), is("bar"));
}
diff --git a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-spring/shardingsphere-shadow-spring-namespace/src/test/java/org/apache/shardingsphere/shadow/spring/namespace/ShadowDefaultAlgorithmSpringNamespaceTest.java b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-spring/shardingsphere-shadow-spring-namespace/src/test/java/org/apache/shardingsphere/shadow/spring/namespace/ShadowDefaultAlgorithmSpringNamespaceTest.java
index 774aeaa4ca7..f9569984caf 100644
--- a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-spring/shardingsphere-shadow-spring-namespace/src/test/java/org/apache/shardingsphere/shadow/spring/namespace/ShadowDefaultAlgorithmSpringNamespaceTest.java
+++ b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-spring/shardingsphere-shadow-spring-namespace/src/test/java/org/apache/shardingsphere/shadow/spring/namespace/ShadowDefaultAlgorithmSpringNamespaceTest.java
@@ -51,7 +51,7 @@ public final class ShadowDefaultAlgorithmSpringNamespaceTest extends AbstractJUn
ShadowAlgorithm simpleHintAlgorithm = shadowAlgorithms.get("simple-hint-algorithm");
assertThat(simpleHintAlgorithm, instanceOf(SimpleHintShadowAlgorithm.class));
assertThat(simpleHintAlgorithm.getType(), is("SIMPLE_HINT"));
- assertThat(simpleHintAlgorithm.getProps().get("shadow"), is("true"));
+ assertThat(simpleHintAlgorithm.getProps().get("shadow"), is(Boolean.TRUE.toString()));
assertThat(simpleHintAlgorithm.getProps().get("foo"), is("bar"));
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/complex/ComplexInlineShardingAlgorithmTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/complex/ComplexInlineShardingAlgorithmTest.java
index edf2309b731..ed24ad1aff0 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/complex/ComplexInlineShardingAlgorithmTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/complex/ComplexInlineShardingAlgorithmTest.java
@@ -54,7 +54,7 @@ public final class ComplexInlineShardingAlgorithmTest {
complexInlineShardingAlgorithmAllowRangeQuery = new ComplexInlineShardingAlgorithm();
complexInlineShardingAlgorithmAllowRangeQuery.getProps().setProperty("algorithm-expression", "t_order_${type % 2}_${order_id % 2}");
complexInlineShardingAlgorithmAllowRangeQuery.getProps().setProperty("sharding-columns", "type,order_id");
- complexInlineShardingAlgorithmAllowRangeQuery.getProps().setProperty("allow-range-query-with-inline-sharding", "true");
+ complexInlineShardingAlgorithmAllowRangeQuery.getProps().setProperty("allow-range-query-with-inline-sharding", Boolean.TRUE.toString());
complexInlineShardingAlgorithmAllowRangeQuery.init();
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/cosid/CosIdSnowflakeIntervalShardingAlgorithmTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/cosid/CosIdSnowflakeIntervalShardingAlgorithmTest.java
index 915182172a6..2e0d6a3c623 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/cosid/CosIdSnowflakeIntervalShardingAlgorithmTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/cosid/CosIdSnowflakeIntervalShardingAlgorithmTest.java
@@ -40,23 +40,27 @@ import static org.junit.Assert.assertThat;
public final class CosIdSnowflakeIntervalShardingAlgorithmTest {
- static CosIdSnowflakeIntervalShardingAlgorithm createShardingAlg() {
- Properties props = new Properties();
- props.setProperty(CosIdIntervalShardingAlgorithm.ZONE_ID_KEY, "Asia/Shanghai");
- props.setProperty(CosIdAlgorithmConstants.LOGIC_NAME_PREFIX_KEY, CosIdIntervalShardingAlgorithmTest.LOGIC_NAME_PREFIX);
- props.setProperty(CosIdIntervalShardingAlgorithm.DATE_TIME_LOWER_KEY,
- CosIdIntervalShardingAlgorithmTest.LOWER_DATE_TIME.format(CosIdIntervalShardingAlgorithm.DEFAULT_DATE_TIME_FORMATTER));
- props.setProperty(CosIdIntervalShardingAlgorithm.DATE_TIME_UPPER_KEY,
- CosIdIntervalShardingAlgorithmTest.UPPER_DATE_TIME.format(CosIdIntervalShardingAlgorithm.DEFAULT_DATE_TIME_FORMATTER));
- props.setProperty(CosIdIntervalShardingAlgorithm.SHARDING_SUFFIX_FORMAT_KEY, CosIdIntervalShardingAlgorithmTest.SUFFIX_FORMATTER_STRING);
- props.setProperty(CosIdIntervalShardingAlgorithm.INTERVAL_UNIT_KEY, "MONTHS");
- props.put(CosIdIntervalShardingAlgorithm.INTERVAL_AMOUNT_KEY, 1);
+ static CosIdSnowflakeIntervalShardingAlgorithm createShardingAlgorithm() {
CosIdSnowflakeIntervalShardingAlgorithm result = new CosIdSnowflakeIntervalShardingAlgorithm();
- result.setProps(props);
+ result.setProps(createAlgorithmProperties());
result.init();
return result;
}
+ private static Properties createAlgorithmProperties() {
+ Properties result = new Properties();
+ result.setProperty(CosIdIntervalShardingAlgorithm.ZONE_ID_KEY, "Asia/Shanghai");
+ result.setProperty(CosIdAlgorithmConstants.LOGIC_NAME_PREFIX_KEY, CosIdIntervalShardingAlgorithmTest.LOGIC_NAME_PREFIX);
+ result.setProperty(CosIdIntervalShardingAlgorithm.DATE_TIME_LOWER_KEY,
+ CosIdIntervalShardingAlgorithmTest.LOWER_DATE_TIME.format(CosIdIntervalShardingAlgorithm.DEFAULT_DATE_TIME_FORMATTER));
+ result.setProperty(CosIdIntervalShardingAlgorithm.DATE_TIME_UPPER_KEY,
+ CosIdIntervalShardingAlgorithmTest.UPPER_DATE_TIME.format(CosIdIntervalShardingAlgorithm.DEFAULT_DATE_TIME_FORMATTER));
+ result.setProperty(CosIdIntervalShardingAlgorithm.SHARDING_SUFFIX_FORMAT_KEY, CosIdIntervalShardingAlgorithmTest.SUFFIX_FORMATTER_STRING);
+ result.setProperty(CosIdIntervalShardingAlgorithm.INTERVAL_UNIT_KEY, "MONTHS");
+ result.put(CosIdIntervalShardingAlgorithm.INTERVAL_AMOUNT_KEY, 1);
+ return result;
+ }
+
static long convertToSnowflakeId(final LocalDateTime dateTime) {
long epochMilliseconds = dateTime.toInstant(CosIdIntervalShardingAlgorithmTest.ZONE_OFFSET_SHANGHAI).toEpochMilli();
long timeDiff = epochMilliseconds - CosIdSnowflakeKeyGenerateAlgorithm.DEFAULT_EPOCH;
@@ -83,7 +87,7 @@ public final class CosIdSnowflakeIntervalShardingAlgorithmTest {
@Before
public void init() {
- shardingAlgorithm = createShardingAlg();
+ shardingAlgorithm = createShardingAlgorithm();
}
@Parameters
@@ -112,7 +116,7 @@ public final class CosIdSnowflakeIntervalShardingAlgorithmTest {
@Before
public void init() {
- shardingAlgorithm = createShardingAlg();
+ shardingAlgorithm = createShardingAlgorithm();
}
@Parameters
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/cosid/PropertiesUtilTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/cosid/PropertiesUtilTest.java
index 1a4f983d44c..9b01819e3bd 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/cosid/PropertiesUtilTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/cosid/PropertiesUtilTest.java
@@ -29,8 +29,8 @@ public final class PropertiesUtilTest {
@Test
public void assertGetRequiredValue() {
Properties props = new Properties();
- props.setProperty("sql-show", "true");
- assertThat(PropertiesUtil.getRequiredValue(props, "sql-show"), is("true"));
+ props.setProperty("sql-show", Boolean.TRUE.toString());
+ assertThat(PropertiesUtil.getRequiredValue(props, "sql-show"), is(Boolean.TRUE.toString()));
}
@Test(expected = IllegalArgumentException.class)
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/inline/InlineShardingAlgorithmTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/inline/InlineShardingAlgorithmTest.java
index a4fd29b1807..c40befb0a88 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/inline/InlineShardingAlgorithmTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/inline/InlineShardingAlgorithmTest.java
@@ -51,7 +51,7 @@ public final class InlineShardingAlgorithmTest {
private void initInlineShardingAlgorithm() {
inlineShardingAlgorithm = new InlineShardingAlgorithm();
inlineShardingAlgorithm.getProps().setProperty("algorithm-expression", "t_order_$->{order_id % 4}");
- inlineShardingAlgorithm.getProps().setProperty("allow-range-query-with-inline-sharding", "true");
+ inlineShardingAlgorithm.getProps().setProperty("allow-range-query-with-inline-sharding", Boolean.TRUE.toString());
inlineShardingAlgorithm.init();
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/scaling/distsql/handler/query/ShowScalingJobStatusQueryResultSet.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/scaling/distsql/handler/query/ShowScalingJobStatusQueryResultSet.java
index 24b7af8a5ce..4e3df000fef 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/scaling/distsql/handler/query/ShowScalingJobStatusQueryResultSet.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/scaling/distsql/handler/query/ShowScalingJobStatusQueryResultSet.java
@@ -50,7 +50,7 @@ public final class ShowScalingJobStatusQueryResultSet implements DistSQLResultSe
if (null != entry.getValue()) {
list.add(entry.getValue().getDataSource());
list.add(entry.getValue().getStatus());
- list.add(entry.getValue().isActive() ? "true" : "false");
+ list.add(entry.getValue().isActive() ? Boolean.TRUE.toString() : Boolean.FALSE.toString());
list.add(entry.getValue().getInventoryFinishedPercentage());
long latestActiveTimeMillis = entry.getValue().getIncrementalLatestActiveTimeMillis();
list.add(latestActiveTimeMillis > 0 ? TimeUnit.MILLISECONDS.toSeconds(currentTimeMillis - latestActiveTimeMillis) : 0);
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/scaling/distsql/handler/query/ShowScalingListQueryResultSet.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/scaling/distsql/handler/query/ShowScalingListQueryResultSet.java
index a96bb5bca51..7ca161d9621 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/scaling/distsql/handler/query/ShowScalingListQueryResultSet.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/main/java/org/apache/shardingsphere/scaling/distsql/handler/query/ShowScalingListQueryResultSet.java
@@ -47,7 +47,7 @@ public final class ShowScalingListQueryResultSet implements DistSQLResultSet {
list.add(each.getJobId());
list.add(each.getTables());
list.add(each.getShardingTotalCount());
- list.add(each.isActive() ? "true" : "false");
+ list.add(each.isActive() ? Boolean.TRUE.toString() : Boolean.FALSE.toString());
list.add(each.getCreateTime());
list.add(each.getStopTime());
return list;
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/metadata/ddlgenerator/dialect/postgres/PostgresTablePropertiesLoader.java b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/metadata/ddlgenerator/dialect/postgres/PostgresTablePropertiesLoader.java
index 631d6204e0a..b1d7474f3c5 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/metadata/ddlgenerator/dialect/postgres/PostgresTablePropertiesLoader.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/metadata/ddlgenerator/dialect/postgres/PostgresTablePropertiesLoader.java
@@ -84,14 +84,14 @@ public final class PostgresTablePropertiesLoader extends PostgresAbstractLoader
private void updateAutovacuumProperties(final Map<String, Object> context) {
if (null == context.get("autovacuum_enabled")) {
context.put("autovacuum_enabled", "x");
- } else if ("true".equalsIgnoreCase(context.get("autovacuum_enabled").toString())) {
+ } else if (Boolean.TRUE.toString().equalsIgnoreCase(context.get("autovacuum_enabled").toString())) {
context.put("autovacuum_enabled", "t");
} else {
context.put("autovacuum_enabled", "f");
}
if (null == context.get("toast_autovacuum_enabled")) {
context.put("toast_autovacuum_enabled", "x");
- } else if ("true".equalsIgnoreCase(context.get("toast_autovacuum_enabled").toString())) {
+ } else if (Boolean.TRUE.toString().equalsIgnoreCase(context.get("toast_autovacuum_enabled").toString())) {
context.put("toast_autovacuum_enabled", "t");
} else {
context.put("toast_autovacuum_enabled", "f");
@@ -120,10 +120,10 @@ public final class PostgresTablePropertiesLoader extends PostgresAbstractLoader
private void checkRlspolicySupport(final Map<String, Object> context) {
if (context.containsKey("rlspolicy")) {
- if (context.get("rlspolicy") instanceof String && "true".equals(context.get("rlspolicy"))) {
+ if (context.get("rlspolicy") instanceof String && Boolean.TRUE.toString().equals(context.get("rlspolicy"))) {
context.put("rlspolicy", true);
}
- if (context.get("forcerlspolicy") instanceof String && "true".equals(context.get("forcerlspolicy"))) {
+ if (context.get("forcerlspolicy") instanceof String && Boolean.TRUE.toString().equals(context.get("forcerlspolicy"))) {
context.put("forcerlspolicy", true);
}
}
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/metadata/dialect/MariaDBDataSourceMetaDataTest.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/metadata/dialect/MariaDBDataSourceMetaDataTest.java
index 0fc3167959f..b0bd27f1c14 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/metadata/dialect/MariaDBDataSourceMetaDataTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/metadata/dialect/MariaDBDataSourceMetaDataTest.java
@@ -46,7 +46,7 @@ public final class MariaDBDataSourceMetaDataTest {
assertNull(actual.getSchema());
assertThat(actual.getQueryProperties().size(), is(2));
assertThat(actual.getQueryProperties().getProperty("serverTimezone"), is("UTC"));
- assertThat(actual.getQueryProperties().getProperty("useSSL"), is("false"));
+ assertThat(actual.getQueryProperties().getProperty("useSSL"), is(Boolean.FALSE.toString()));
}
@Test(expected = UnrecognizedDatabaseURLException.class)
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/metadata/dialect/MySQLDataSourceMetaDataTest.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/metadata/dialect/MySQLDataSourceMetaDataTest.java
index a6feadb0101..c24b8387b5c 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/metadata/dialect/MySQLDataSourceMetaDataTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/metadata/dialect/MySQLDataSourceMetaDataTest.java
@@ -46,7 +46,7 @@ public final class MySQLDataSourceMetaDataTest {
assertNull(actual.getSchema());
assertThat(actual.getQueryProperties().size(), is(2));
assertThat(actual.getQueryProperties().getProperty("serverTimezone"), is("UTC"));
- assertThat(actual.getQueryProperties().getProperty("useSSL"), is("false"));
+ assertThat(actual.getQueryProperties().getProperty("useSSL"), is(Boolean.FALSE.toString()));
}
@Test(expected = UnrecognizedDatabaseURLException.class)
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/metadata/url/StandardJdbcUrlParserTest.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/metadata/url/StandardJdbcUrlParserTest.java
index f79315cc9ab..c60fc8f8e64 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/metadata/url/StandardJdbcUrlParserTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/metadata/url/StandardJdbcUrlParserTest.java
@@ -43,7 +43,7 @@ public final class StandardJdbcUrlParserTest {
assertThat(actual.getDatabase(), is("demo_ds"));
assertThat(actual.getQueryProperties().size(), is(2));
assertThat(actual.getQueryProperties().get("serverTimezone"), is("UTC"));
- assertThat(actual.getQueryProperties().get("useSSL"), is("false"));
+ assertThat(actual.getQueryProperties().get("useSSL"), is(Boolean.FALSE.toString()));
}
@Test
@@ -53,7 +53,7 @@ public final class StandardJdbcUrlParserTest {
assertThat(actual.getPort(), is(3306));
assertThat(actual.getDatabase(), is("demo_ds"));
assertThat(actual.getQueryProperties().size(), is(1));
- assertThat(actual.getQueryProperties().get("useUnicode"), is("true"));
+ assertThat(actual.getQueryProperties().get("useUnicode"), is(Boolean.TRUE.toString()));
}
@Test
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/config/datasource/ShardingSpherePipelineDataSourceCreator.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/config/datasource/ShardingSpherePipelineDataSourceCreator.java
index f56646af077..2a55ac9936b 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/config/datasource/ShardingSpherePipelineDataSourceCreator.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/config/datasource/ShardingSpherePipelineDataSourceCreator.java
@@ -46,10 +46,9 @@ public final class ShardingSpherePipelineDataSourceCreator implements PipelineDa
private void enableRangeQueryForInline(final ShardingRuleConfiguration shardingRuleConfig) {
for (ShardingSphereAlgorithmConfiguration each : shardingRuleConfig.getShardingAlgorithms().values()) {
- if (!"INLINE".equalsIgnoreCase(each.getType())) {
- continue;
+ if ("INLINE".equalsIgnoreCase(each.getType())) {
+ each.getProps().put("allow-range-query-with-inline-sharding", Boolean.TRUE.toString());
}
- each.getProps().put("allow-range-query-with-inline-sharding", "true");
}
}
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/resultset/DatabaseMetaDataResultSetTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/resultset/DatabaseMetaDataResultSetTest.java
index 4e8f5158c85..4c2bd58f9c5 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/resultset/DatabaseMetaDataResultSetTest.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/resultset/DatabaseMetaDataResultSetTest.java
@@ -156,7 +156,7 @@ public final class DatabaseMetaDataResultSetTest {
public void assertGetStringWithIndex() throws SQLException {
databaseMetaDataResultSet.next();
assertThat(databaseMetaDataResultSet.getString(1), is(LOGIC_TABLE_NAME));
- assertThat(databaseMetaDataResultSet.getString(2), is("true"));
+ assertThat(databaseMetaDataResultSet.getString(2), is(Boolean.TRUE.toString()));
assertThat(databaseMetaDataResultSet.getString(3), is("100"));
assertThat(databaseMetaDataResultSet.getString(6), is(LOGIC_INDEX_NAME));
}
@@ -165,7 +165,7 @@ public final class DatabaseMetaDataResultSetTest {
public void assertGetStringWithLabel() throws SQLException {
databaseMetaDataResultSet.next();
assertThat(databaseMetaDataResultSet.getString(TABLE_NAME_COLUMN_LABEL), is(LOGIC_TABLE_NAME));
- assertThat(databaseMetaDataResultSet.getString(NON_TABLE_NAME_COLUMN_LABEL), is("true"));
+ assertThat(databaseMetaDataResultSet.getString(NON_TABLE_NAME_COLUMN_LABEL), is(Boolean.TRUE.toString()));
assertThat(databaseMetaDataResultSet.getString(NUMBER_COLUMN_LABEL), is("100"));
assertThat(databaseMetaDataResultSet.getString(INDEX_NAME_COLUMN_LABEL), is(LOGIC_INDEX_NAME));
}
@@ -174,7 +174,7 @@ public final class DatabaseMetaDataResultSetTest {
public void assertGetStringWithLabelCaseInsensitive() throws SQLException {
databaseMetaDataResultSet.next();
assertThat(databaseMetaDataResultSet.getString(TABLE_NAME_COLUMN_LABEL.toLowerCase()), is(LOGIC_TABLE_NAME));
- assertThat(databaseMetaDataResultSet.getString(NON_TABLE_NAME_COLUMN_LABEL.toLowerCase()), is("true"));
+ assertThat(databaseMetaDataResultSet.getString(NON_TABLE_NAME_COLUMN_LABEL.toLowerCase()), is(Boolean.TRUE.toString()));
assertThat(databaseMetaDataResultSet.getString(NUMBER_COLUMN_LABEL.toLowerCase()), is("100"));
assertThat(databaseMetaDataResultSet.getString(INDEX_NAME_COLUMN_LABEL.toLowerCase()), is(LOGIC_INDEX_NAME));
}
@@ -183,7 +183,7 @@ public final class DatabaseMetaDataResultSetTest {
public void assertGetNStringWithIndex() throws SQLException {
databaseMetaDataResultSet.next();
assertThat(databaseMetaDataResultSet.getNString(1), is(LOGIC_TABLE_NAME));
- assertThat(databaseMetaDataResultSet.getNString(2), is("true"));
+ assertThat(databaseMetaDataResultSet.getNString(2), is(Boolean.TRUE.toString()));
assertThat(databaseMetaDataResultSet.getNString(3), is("100"));
assertThat(databaseMetaDataResultSet.getNString(6), is(LOGIC_INDEX_NAME));
}
@@ -192,7 +192,7 @@ public final class DatabaseMetaDataResultSetTest {
public void assertGetNStringWithLabel() throws SQLException {
databaseMetaDataResultSet.next();
assertThat(databaseMetaDataResultSet.getNString(TABLE_NAME_COLUMN_LABEL), is(LOGIC_TABLE_NAME));
- assertThat(databaseMetaDataResultSet.getNString(NON_TABLE_NAME_COLUMN_LABEL), is("true"));
+ assertThat(databaseMetaDataResultSet.getNString(NON_TABLE_NAME_COLUMN_LABEL), is(Boolean.TRUE.toString()));
assertThat(databaseMetaDataResultSet.getNString(NUMBER_COLUMN_LABEL), is("100"));
assertThat(databaseMetaDataResultSet.getNString(INDEX_NAME_COLUMN_LABEL), is(LOGIC_INDEX_NAME));
}
diff --git a/shardingsphere-kernel/shardingsphere-authority/shardingsphere-authority-core/src/main/java/org/apache/shardingsphere/authority/provider/natived/builder/dialect/PostgreSQLPrivilegeHandler.java b/shardingsphere-kernel/shardingsphere-authority/shardingsphere-authority-core/src/main/java/org/apache/shardingsphere/authority/provider/natived/builder/dialect/PostgreSQLPrivilegeHandler.java
index ba15925510f..781a597a407 100644
--- a/shardingsphere-kernel/shardingsphere-authority/shardingsphere-authority-core/src/main/java/org/apache/shardingsphere/authority/provider/natived/builder/dialect/PostgreSQLPrivilegeHandler.java
+++ b/shardingsphere-kernel/shardingsphere-authority/shardingsphere-authority-core/src/main/java/org/apache/shardingsphere/authority/provider/natived/builder/dialect/PostgreSQLPrivilegeHandler.java
@@ -137,7 +137,7 @@ public final class PostgreSQLPrivilegeHandler implements StoragePrivilegeHandler
String db = resultSet.getString("table_catalog");
String tableName = resultSet.getString("table_name");
String privilegeType = resultSet.getString("privilege_type");
- boolean hasPrivilege = "TRUE".equalsIgnoreCase(resultSet.getString("is_grantable"));
+ boolean hasPrivilege = Boolean.TRUE.toString().equalsIgnoreCase(resultSet.getString("is_grantable"));
String grantee = resultSet.getString("grantee");
if (hasPrivilege) {
privilegeCache
diff --git a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-opengauss/src/test/java/org/apache/shardingsphere/data/pipeline/opengauss/ingest/wal/decode/MppdbDecodingPluginTest.java b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-opengauss/src/test/java/org/apache/shardingsphere/data/pipeline/opengauss/ingest/wal/decode/MppdbDecodingPluginTest.java
index 035a90bf1ff..5b426c24829 100644
--- a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-opengauss/src/test/java/org/apache/shardingsphere/data/pipeline/opengauss/ingest/wal/decode/MppdbDecodingPluginTest.java
+++ b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-opengauss/src/test/java/org/apache/shardingsphere/data/pipeline/opengauss/ingest/wal/decode/MppdbDecodingPluginTest.java
@@ -119,13 +119,13 @@ public final class MppdbDecodingPluginTest {
tableData.setOpType("INSERT");
tableData.setColumnsName(new String[]{"data"});
tableData.setColumnsType(new String[]{"boolean"});
- tableData.setColumnsVal(new String[]{"true"});
+ tableData.setColumnsVal(new String[]{Boolean.TRUE.toString()});
ByteBuffer data = ByteBuffer.wrap(new Gson().toJson(tableData).getBytes());
WriteRowEvent actual = (WriteRowEvent) new MppdbDecodingPlugin(null).decode(data, logSequenceNumber);
assertThat(actual.getLogSequenceNumber(), is(logSequenceNumber));
assertThat(actual.getTableName(), is("test"));
Object byteaObj = actual.getAfterRow().get(0);
- assertThat(byteaObj.toString(), is("true"));
+ assertThat(byteaObj.toString(), is(Boolean.TRUE.toString()));
}
@Test
diff --git a/shardingsphere-kernel/shardingsphere-single-table/shardingsphere-single-table-core/src/test/java/org/apache/shardingsphere/singletable/datanode/SingleTableDataNodeLoaderTest.java b/shardingsphere-kernel/shardingsphere-single-table/shardingsphere-single-table-core/src/test/java/org/apache/shardingsphere/singletable/datanode/SingleTableDataNodeLoaderTest.java
index b94c30f9f2a..681c98c1b68 100644
--- a/shardingsphere-kernel/shardingsphere-single-table/shardingsphere-single-table-core/src/test/java/org/apache/shardingsphere/singletable/datanode/SingleTableDataNodeLoaderTest.java
+++ b/shardingsphere-kernel/shardingsphere-single-table/shardingsphere-single-table-core/src/test/java/org/apache/shardingsphere/singletable/datanode/SingleTableDataNodeLoaderTest.java
@@ -120,14 +120,14 @@ public final class SingleTableDataNodeLoaderTest {
@Test(expected = IllegalStateException.class)
public void assertLoadWithCheckOption() {
Properties props = new Properties();
- props.setProperty(ConfigurationPropertyKey.CHECK_DUPLICATE_TABLE_ENABLED.getKey(), "true");
+ props.setProperty(ConfigurationPropertyKey.CHECK_DUPLICATE_TABLE_ENABLED.getKey(), Boolean.TRUE.toString());
SingleTableDataNodeLoader.load(mock(DatabaseType.class), dataSourceMap, Collections.emptyList(), new ConfigurationProperties(props));
}
@Test
public void assertLoadWithExcludeTablesCheckOption() {
Properties props = new Properties();
- props.setProperty(ConfigurationPropertyKey.CHECK_DUPLICATE_TABLE_ENABLED.getKey(), "true");
+ props.setProperty(ConfigurationPropertyKey.CHECK_DUPLICATE_TABLE_ENABLED.getKey(), Boolean.TRUE.toString());
Collection<String> excludedTables = Arrays.asList("salary", "employee", "student");
Map<String, Collection<DataNode>> dataNodeMap = SingleTableDataNodeLoader.load(mock(DatabaseType.class), dataSourceMap, excludedTables, new ConfigurationProperties(props));
assertFalse(dataNodeMap.containsKey("employee"));
diff --git a/shardingsphere-kernel/shardingsphere-traffic/shardingsphere-traffic-core/src/test/java/org/apache/shardingsphere/traffic/algorithm/traffic/hint/SQLHintTrafficAlgorithmTest.java b/shardingsphere-kernel/shardingsphere-traffic/shardingsphere-traffic-core/src/test/java/org/apache/shardingsphere/traffic/algorithm/traffic/hint/SQLHintTrafficAlgorithmTest.java
index 88578ae45cb..8a13e26f16c 100644
--- a/shardingsphere-kernel/shardingsphere-traffic/shardingsphere-traffic-core/src/test/java/org/apache/shardingsphere/traffic/algorithm/traffic/hint/SQLHintTrafficAlgorithmTest.java
+++ b/shardingsphere-kernel/shardingsphere-traffic/shardingsphere-traffic-core/src/test/java/org/apache/shardingsphere/traffic/algorithm/traffic/hint/SQLHintTrafficAlgorithmTest.java
@@ -40,14 +40,14 @@ public final class SQLHintTrafficAlgorithmTest {
@Test
public void assertMatchWhenSQLHintAllMatch() {
Properties props = new Properties();
- props.put("useTraffic", "true");
+ props.put("useTraffic", Boolean.TRUE.toString());
assertTrue(sqlHintAlgorithm.match(new HintTrafficValue(new SQLHintProperties(props))));
}
@Test
public void assertMatchWhenSQLHintOneMatch() {
Properties props = new Properties();
- props.put("useTraffic", "false");
+ props.put("useTraffic", Boolean.FALSE.toString());
assertFalse(sqlHintAlgorithm.match(new HintTrafficValue(new SQLHintProperties(props))));
}
}
diff --git a/shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-type/shardingsphere-transaction-xa/shardingsphere-transaction-xa-provider/shardingsphere-transaction-xa-narayana/src/main/java/org/apache/shardingsphere/transaction/xa/narayana/config/NarayanaConfigurationFileGenerator.java b/shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-type/shardingsphere-transaction-xa/shardingsphere-transaction-xa-provider/shardingsphere-transaction-x [...]
index a2fceaf4a14..6deba10ac2c 100644
--- a/shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-type/shardingsphere-transaction-xa/shardingsphere-transaction-xa-provider/shardingsphere-transaction-xa-narayana/src/main/java/org/apache/shardingsphere/transaction/xa/narayana/config/NarayanaConfigurationFileGenerator.java
+++ b/shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-type/shardingsphere-transaction-xa/shardingsphere-transaction-xa-provider/shardingsphere-transaction-xa-narayana/src/main/java/org/apache/shardingsphere/transaction/xa/narayana/config/NarayanaConfigurationFileGenerator.java
@@ -128,15 +128,15 @@ public final class NarayanaConfigurationFileGenerator implements TransactionConf
config.getEntries().add(createEntry("ObjectStoreEnvironmentBean.objectStoreType", JDBCStore.class.getName()));
config.getEntries().add(createEntry("ObjectStoreEnvironmentBean.jdbcAccess", jdbcAccess));
config.getEntries().add(createEntry("ObjectStoreEnvironmentBean.tablePrefix", "Action"));
- config.getEntries().add(createEntry("ObjectStoreEnvironmentBean.dropTable", "true"));
+ config.getEntries().add(createEntry("ObjectStoreEnvironmentBean.dropTable", Boolean.TRUE.toString()));
config.getEntries().add(createEntry("ObjectStoreEnvironmentBean.stateStore.objectStoreType", JDBCStore.class.getName()));
config.getEntries().add(createEntry("ObjectStoreEnvironmentBean.stateStore.jdbcAccess", jdbcAccess));
config.getEntries().add(createEntry("ObjectStoreEnvironmentBean.stateStore.tablePrefix", "stateStore"));
- config.getEntries().add(createEntry("ObjectStoreEnvironmentBean.stateStore.dropTable", "true"));
+ config.getEntries().add(createEntry("ObjectStoreEnvironmentBean.stateStore.dropTable", Boolean.TRUE.toString()));
config.getEntries().add(createEntry("ObjectStoreEnvironmentBean.communicationStore.objectStoreType", JDBCStore.class.getName()));
config.getEntries().add(createEntry("ObjectStoreEnvironmentBean.communicationStore.jdbcAccess", jdbcAccess));
config.getEntries().add(createEntry("ObjectStoreEnvironmentBean.communicationStore.tablePrefix", "Communication"));
- config.getEntries().add(createEntry("ObjectStoreEnvironmentBean.communicationStore.dropTable", "true"));
+ config.getEntries().add(createEntry("ObjectStoreEnvironmentBean.communicationStore.dropTable", Boolean.TRUE.toString()));
}
@Override
diff --git a/shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-type/shardingsphere-transaction-xa/shardingsphere-transaction-xa-provider/shardingsphere-transaction-xa-narayana/src/test/java/org/apache/shardingsphere/transaction/xa/narayana/config/NarayanaConfigurationFileGeneratorTest.java b/shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-type/shardingsphere-transaction-xa/shardingsphere-transaction-xa-provider/shardingsphere-transacti [...]
index 4a33526ba90..7efb76aa5b7 100644
--- a/shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-type/shardingsphere-transaction-xa/shardingsphere-transaction-xa-provider/shardingsphere-transaction-xa-narayana/src/test/java/org/apache/shardingsphere/transaction/xa/narayana/config/NarayanaConfigurationFileGeneratorTest.java
+++ b/shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-type/shardingsphere-transaction-xa/shardingsphere-transaction-xa-provider/shardingsphere-transaction-xa-narayana/src/test/java/org/apache/shardingsphere/transaction/xa/narayana/config/NarayanaConfigurationFileGeneratorTest.java
@@ -225,7 +225,7 @@ public final class NarayanaConfigurationFileGeneratorTest {
Optional<NarayanaConfigEntry> entry = narayanaConfig.getEntries().stream().filter(each -> "ObjectStoreEnvironmentBean.dropTable".equals(each.getKey())).findFirst();
assertTrue(entry.isPresent());
assertThat(entry.get().getValue().size(), is(1));
- assertTrue(entry.get().getValue().contains("true"));
+ assertTrue(entry.get().getValue().contains(Boolean.TRUE.toString()));
}
private void assertStateStoreJdbcAccess(final NarayanaConfiguration narayanaConfig) {
@@ -253,7 +253,7 @@ public final class NarayanaConfigurationFileGeneratorTest {
Optional<NarayanaConfigEntry> entry = narayanaConfig.getEntries().stream().filter(each -> "ObjectStoreEnvironmentBean.stateStore.dropTable".equals(each.getKey())).findFirst();
assertTrue(entry.isPresent());
assertThat(entry.get().getValue().size(), is(1));
- assertTrue(entry.get().getValue().contains("true"));
+ assertTrue(entry.get().getValue().contains(Boolean.TRUE.toString()));
}
private void assertCommunicationStoreObjectStoreType(final NarayanaConfiguration narayanaConfig) {
@@ -281,6 +281,6 @@ public final class NarayanaConfigurationFileGeneratorTest {
Optional<NarayanaConfigEntry> entry = narayanaConfig.getEntries().stream().filter(each -> "ObjectStoreEnvironmentBean.communicationStore.dropTable".equals(each.getKey())).findFirst();
assertTrue(entry.isPresent());
assertThat(entry.get().getValue().size(), is(1));
- assertTrue(entry.get().getValue().contains("true"));
+ assertTrue(entry.get().getValue().contains(Boolean.TRUE.toString()));
}
}
diff --git a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/ClusterContextManagerCoordinatorTest.java b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/ClusterContextManagerCoordinatorTest.java
index f3dc013ce0e..3f7fda6cc0d 100644
--- a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/ClusterContextManagerCoordinatorTest.java
+++ b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/ClusterContextManagerCoordinatorTest.java
@@ -184,9 +184,9 @@ public final class ClusterContextManagerCoordinatorTest {
@Test
public void assertPropertiesChanged() {
Properties props = new Properties();
- props.setProperty(ConfigurationPropertyKey.SQL_SHOW.getKey(), "true");
+ props.setProperty(ConfigurationPropertyKey.SQL_SHOW.getKey(), Boolean.TRUE.toString());
coordinator.renew(new PropertiesChangedEvent(props));
- assertThat(contextManager.getMetaDataContexts().getProps().getProps().getProperty(ConfigurationPropertyKey.SQL_SHOW.getKey()), is("true"));
+ assertThat(contextManager.getMetaDataContexts().getProps().getProps().getProperty(ConfigurationPropertyKey.SQL_SHOW.getKey()), is(Boolean.TRUE.toString()));
}
@Test
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/advanced/FormatHandler.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/advanced/FormatHandler.java
index bfd066710b2..f1d7968b976 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/advanced/FormatHandler.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/advanced/FormatHandler.java
@@ -55,7 +55,7 @@ public final class FormatHandler extends QueryableRALBackendHandler<FormatStatem
throw new SQLParsingException("You have a syntax error in your formatted statement");
}
Properties props = new Properties();
- props.setProperty("parameterized", "false");
+ props.setProperty("parameterized", Boolean.FALSE.toString());
SQLVisitorEngine visitorEngine = new SQLVisitorEngine("MySQL", "FORMAT", false, props);
return Collections.singleton(Collections.singletonList(visitorEngine.visit(parseASTNode)));
}
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/queryable/ShowInstanceModeHandlerTest.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/queryable/ShowInstanceModeHandlerTest.java
index 984436d8970..1c06990bcde 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/queryable/ShowInstanceModeHandlerTest.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/queryable/ShowInstanceModeHandlerTest.java
@@ -53,7 +53,7 @@ public final class ShowInstanceModeHandlerTest {
assertThat(data.get(1), is("Cluster"));
assertThat(data.get(2), is("ZooKeeper"));
assertThat(data.get(3), is("{\"key\":\"value1,value2\"}"));
- assertThat(data.get(4), is("false"));
+ assertThat(data.get(4), is(Boolean.FALSE.toString()));
}
private InstanceContext createInstanceContext() {
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/queryable/ShowSQLParserRuleHandlerTest.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/queryable/ShowSQLParserRuleHandlerTest.java
index 6370530fdf0..ab830d7f6f2 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/queryable/ShowSQLParserRuleHandlerTest.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/queryable/ShowSQLParserRuleHandlerTest.java
@@ -49,7 +49,7 @@ public final class ShowSQLParserRuleHandlerTest {
handler.next();
List<Object> data = new ArrayList<>(handler.getRowData());
assertThat(data.size(), is(3));
- assertThat(data.get(0), is("true"));
+ assertThat(data.get(0), is(Boolean.TRUE.toString()));
String parseTreeCache = String.valueOf(data.get(1));
assertThat(parseTreeCache, containsString("\"initialCapacity\":128"));
assertThat(parseTreeCache, containsString("\"maximumSize\":1024"));
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/queryable/ShowVariableBackendHandlerTest.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/queryable/ShowVariableBackendHandlerTest.java
index 6e6a9d2848b..805ce7c5c60 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/queryable/ShowVariableBackendHandlerTest.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/queryable/ShowVariableBackendHandlerTest.java
@@ -122,7 +122,7 @@ public final class ShowVariableBackendHandlerTest {
MetaDataContexts metaDataContexts = mock(MetaDataContexts.class);
when(contextManager.getMetaDataContexts()).thenReturn(metaDataContexts);
Properties props = new Properties();
- props.put("sql-show", "true");
+ props.put("sql-show", Boolean.TRUE.toString());
when(metaDataContexts.getProps()).thenReturn(new ConfigurationProperties(props));
ShowVariableHandler backendHandler = new ShowVariableHandler()
.init(new HandlerParameter<ShowVariableStatement>().setStatement(new ShowVariableStatement("SQL_SHOW")).setConnectionSession(connectionSession));
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/updatable/SetVariableBackendHandlerTest.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/updatable/SetVariableBackendHandlerTest.java
index 69240cb7a9e..5f3e63c7abf 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/updatable/SetVariableBackendHandlerTest.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/updatable/SetVariableBackendHandlerTest.java
@@ -142,7 +142,7 @@ public final class SetVariableBackendHandlerTest {
@Test
public void assertSetAgentPluginsEnabledFalse() throws SQLException {
connectionSession.setCurrentDatabase(String.format(DATABASE_PATTERN, 0));
- SetVariableHandler handler = new SetVariableHandler().init(getParameter(new SetVariableStatement(VariableEnum.AGENT_PLUGINS_ENABLED.name(), "FALSE"), null));
+ SetVariableHandler handler = new SetVariableHandler().init(getParameter(new SetVariableStatement(VariableEnum.AGENT_PLUGINS_ENABLED.name(), Boolean.FALSE.toString()), null));
ResponseHeader actual = handler.execute();
assertThat(actual, instanceOf(UpdateResponseHeader.class));
assertThat(SystemPropertyUtil.getSystemProperty(VariableEnum.AGENT_PLUGINS_ENABLED.name(), Boolean.FALSE.toString()), is(Boolean.FALSE.toString()));
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/updatable/SetVariableExecutorTest.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/updatable/SetVariableExecutorTest.java
index 3e8b23fd53b..ce9b5de9a89 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/updatable/SetVariableExecutorTest.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/updatable/SetVariableExecutorTest.java
@@ -57,10 +57,10 @@ public final class SetVariableExecutorTest {
@Test
public void assertExecuteWithAgent() throws SQLException {
- SetVariableStatement statement = new SetVariableStatement("AGENT_PLUGINS_ENABLED", "false");
+ SetVariableStatement statement = new SetVariableStatement("AGENT_PLUGINS_ENABLED", Boolean.FALSE.toString());
new SetVariableHandler().init(getParameter(statement, connectionSession)).execute();
String actualValue = SystemPropertyUtil.getSystemProperty(VariableEnum.AGENT_PLUGINS_ENABLED.name(), "default");
- assertThat(actualValue, is("false"));
+ assertThat(actualValue, is(Boolean.FALSE.toString()));
}
@Test