You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by du...@apache.org on 2022/05/02 14:47:51 UTC
[shardingsphere] branch master updated: Use guava's Strings (#17273)
This is an automated email from the ASF dual-hosted git repository.
duanzhengqiang 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 92571522cdd Use guava's Strings (#17273)
92571522cdd is described below
commit 92571522cdd64e3e3de14ccbfcb4ffb2fe9745b4
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Mon May 2 22:47:44 2022 +0800
Use guava's Strings (#17273)
---
.../sharding/cosid/CosIdModShardingAlgorithmTest.java | 2 +-
.../cases/postgresql/PostgreSQLManualScalingCase.java | 12 +++++-------
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/cosid/CosIdModShardingAlgorithmTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/cosid/CosIdModShardingAlgorithmTest.java
index ae59bef17dc..4c7afaa4d81 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/cosid/CosIdModShardingAlgorithmTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/cosid/CosIdModShardingAlgorithmTest.java
@@ -63,7 +63,7 @@ public final class CosIdModShardingAlgorithmTest {
public static class PreciseValueDoShardingTest {
private final long id;
-
+
private CosIdModShardingAlgorithm<Long> shardingAlgorithm;
@Before
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/cases/postgresql/PostgreSQLManualScalingCase.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/cases/postgresql/PostgreSQLManualScalingCase.java
index 13fbbf97e31..3e8c681a106 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/cases/postgresql/PostgreSQLManualScalingCase.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/cases/postgresql/PostgreSQLManualScalingCase.java
@@ -17,9 +17,8 @@
package org.apache.shardingsphere.integration.data.pipeline.cases.postgresql;
+import com.google.common.base.Strings;
import com.google.common.collect.Sets;
-import jdk.internal.joptsimple.internal.Strings;
-import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.integration.data.pipeline.env.IntegrationTestEnvironment;
import org.apache.shardingsphere.integration.data.pipeline.framework.param.ScalingParameterized;
import org.junit.Test;
@@ -37,7 +36,6 @@ import java.util.stream.Collectors;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
-@Slf4j
@RunWith(Parameterized.class)
public final class PostgreSQLManualScalingCase extends BasePostgreSQLITCase {
@@ -61,13 +59,13 @@ public final class PostgreSQLManualScalingCase extends BasePostgreSQLITCase {
@Test
public void assertManualScalingSuccess() throws InterruptedException {
- List<Map<String, Object>> previewResList = getJdbcTemplate().queryForList("PREVIEW SELECT COUNT(1) FROM t_order");
- Set<Object> originalSourceList = previewResList.stream().map(each -> each.get("data_source_name")).collect(Collectors.toSet());
- assertThat(originalSourceList, is(Sets.newHashSet("ds_0", "ds_1")));
+ List<Map<String, Object>> previewResults = getJdbcTemplate().queryForList("PREVIEW SELECT COUNT(1) FROM t_order");
+ Set<Object> originalSources = previewResults.stream().map(each -> each.get("data_source_name")).collect(Collectors.toSet());
+ assertThat(originalSources, is(Sets.newHashSet("ds_0", "ds_1")));
getJdbcTemplate().execute(getCommonSQLCommand().getAutoAlterTableRule());
Map<String, Object> showScalingResMap = getJdbcTemplate().queryForMap("SHOW SCALING LIST");
String jobId = String.valueOf(showScalingResMap.get("id"));
- getIncreaseTaskThread().join(60 * 1000);
+ getIncreaseTaskThread().join(60 * 1000L);
checkMatchConsistency(getJdbcTemplate(), jobId);
}
}