You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by pa...@apache.org on 2022/10/10 00:58:23 UTC
[shardingsphere] branch master updated: fix ci error on windows machine (#21433)
This is an automated email from the ASF dual-hosted git repository.
panjuan 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 77aadc9ac4a fix ci error on windows machine (#21433)
77aadc9ac4a is described below
commit 77aadc9ac4ad1999a5ecc2ebe8ef42e960b2dfc6
Author: Zhengqiang Duan <du...@apache.org>
AuthorDate: Mon Oct 10 08:58:14 2022 +0800
fix ci error on windows machine (#21433)
---
.../shardingsphere/infra/util/yaml/YamlEngineTest.java | 6 ++++--
.../coordinator/fixture/ClusterPersistRepositoryFixture.java | 2 +-
.../mode/repository/cluster/consul/ConsulRepositoryTest.java | 6 ++++--
.../mode/repository/cluster/etcd/EtcdRepositoryTest.java | 9 ++++++---
.../cluster/zookeeper/CuratorZookeeperRepository.java | 12 ++++++------
.../proxy/fixture/ClusterPersistRepositoryFixture.java | 2 +-
6 files changed, 22 insertions(+), 15 deletions(-)
diff --git a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/yaml/YamlEngineTest.java b/infra/util/src/test/java/org/apache/shardingsphere/infra/util/yaml/YamlEngineTest.java
index 56711cbac89..79cbad24d56 100644
--- a/infra/util/src/test/java/org/apache/shardingsphere/infra/util/yaml/YamlEngineTest.java
+++ b/infra/util/src/test/java/org/apache/shardingsphere/infra/util/yaml/YamlEngineTest.java
@@ -30,11 +30,13 @@ import java.util.Arrays;
import java.util.Properties;
import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertNotNull;
import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.Assert.assertNotNull;
public final class YamlEngineTest {
+ private static final String LINE_SEPARATOR = System.lineSeparator();
+
@Test
public void assertUnmarshalWithFile() throws IOException {
URL url = getClass().getClassLoader().getResource("yaml/shortcuts-fixture.yaml");
@@ -68,7 +70,7 @@ public final class YamlEngineTest {
@Test
public void assertUnmarshalWithYamlContentClassTypeSkipMissingProperties() {
- YamlShortcutsConfigurationFixture actual = YamlEngine.unmarshal("name: test\nnotExistsField: test", YamlShortcutsConfigurationFixture.class, true);
+ YamlShortcutsConfigurationFixture actual = YamlEngine.unmarshal("name: test" + LINE_SEPARATOR + "notExistsField: test", YamlShortcutsConfigurationFixture.class, true);
assertThat(actual.getName(), is("test"));
}
diff --git a/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/fixture/ClusterPersistRepositoryFixture.java b/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/fixture/ClusterPersistRepositoryFixture.java
index 29ed57eb7e1..2f596738819 100644
--- a/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/fixture/ClusterPersistRepositoryFixture.java
+++ b/mode/type/cluster/core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/fixture/ClusterPersistRepositoryFixture.java
@@ -124,7 +124,7 @@ public final class ClusterPersistRepositoryFixture implements ClusterPersistRepo
@Override
public void watch(final String key, final DataChangedEventListener listener, final Executor executor) {
-
+
}
@Override
diff --git a/mode/type/cluster/repository/provider/consul/src/test/java/org/apache/shardingsphere/mode/repository/cluster/consul/ConsulRepositoryTest.java b/mode/type/cluster/repository/provider/consul/src/test/java/org/apache/shardingsphere/mode/repository/cluster/consul/ConsulRepositoryTest.java
index 4861462f513..b0856372c05 100644
--- a/mode/type/cluster/repository/provider/consul/src/test/java/org/apache/shardingsphere/mode/repository/cluster/consul/ConsulRepositoryTest.java
+++ b/mode/type/cluster/repository/provider/consul/src/test/java/org/apache/shardingsphere/mode/repository/cluster/consul/ConsulRepositoryTest.java
@@ -154,7 +154,8 @@ public final class ConsulRepositoryTest {
getValue1.setKey(k1);
getValue1.setValue(v1);
when(responseGetValueList.getValue()).thenReturn(Collections.singletonList(getValue1));
- repository.watch(key, event -> { }, null);
+ repository.watch(key, event -> {
+ }, null);
client.setKVValue(k1, "value1-1");
verify(client, atLeastOnce()).getKVValues(any(String.class), any(QueryParams.class));
Thread.sleep(10000L);
@@ -174,7 +175,8 @@ public final class ConsulRepositoryTest {
getValue1.setKey(k1);
getValue1.setValue(v1);
when(responseGetValueList.getValue()).thenReturn(Collections.singletonList(getValue1));
- repository.watch(key, event -> { }, null);
+ repository.watch(key, event -> {
+ }, null);
client.deleteKVValue(k2);
verify(client, atLeastOnce()).getKVValues(any(String.class), any(QueryParams.class));
Thread.sleep(10000L);
diff --git a/mode/type/cluster/repository/provider/etcd/src/test/java/org/apache/shardingsphere/mode/repository/cluster/etcd/EtcdRepositoryTest.java b/mode/type/cluster/repository/provider/etcd/src/test/java/org/apache/shardingsphere/mode/repository/cluster/etcd/EtcdRepositoryTest.java
index 1493eeb168f..46f7436e05f 100644
--- a/mode/type/cluster/repository/provider/etcd/src/test/java/org/apache/shardingsphere/mode/repository/cluster/etcd/EtcdRepositoryTest.java
+++ b/mode/type/cluster/repository/provider/etcd/src/test/java/org/apache/shardingsphere/mode/repository/cluster/etcd/EtcdRepositoryTest.java
@@ -172,7 +172,8 @@ public final class EtcdRepositoryTest {
listener.onNext(buildWatchResponse(WatchEvent.EventType.PUT));
return mock(Watch.Watcher.class);
}).when(watch).watch(any(ByteSequence.class), any(WatchOption.class), any(Watch.Listener.class));
- repository.watch("key1", event -> { }, null);
+ repository.watch("key1", event -> {
+ }, null);
verify(watch).watch(any(ByteSequence.class), any(WatchOption.class), any(Watch.Listener.class));
}
@@ -183,7 +184,8 @@ public final class EtcdRepositoryTest {
listener.onNext(buildWatchResponse(WatchEvent.EventType.DELETE));
return mock(Watch.Watcher.class);
}).when(watch).watch(any(ByteSequence.class), any(WatchOption.class), any(Watch.Listener.class));
- repository.watch("key1", event -> { }, null);
+ repository.watch("key1", event -> {
+ }, null);
verify(watch).watch(any(ByteSequence.class), any(WatchOption.class), any(Watch.Listener.class));
}
@@ -194,7 +196,8 @@ public final class EtcdRepositoryTest {
listener.onNext(buildWatchResponse(WatchEvent.EventType.UNRECOGNIZED));
return mock(Watch.Watcher.class);
}).when(watch).watch(any(ByteSequence.class), any(WatchOption.class), any(Watch.Listener.class));
- repository.watch("key1", event -> { }, null);
+ repository.watch("key1", event -> {
+ }, null);
verify(watch).watch(any(ByteSequence.class), any(WatchOption.class), any(Watch.Listener.class));
}
diff --git a/mode/type/cluster/repository/provider/zookeeper-curator/src/main/java/org/apache/shardingsphere/mode/repository/cluster/zookeeper/CuratorZookeeperRepository.java b/mode/type/cluster/repository/provider/zookeeper-curator/src/main/java/org/apache/shardingsphere/mode/repository/cluster/zookeeper/CuratorZookeeperRepository.java
index 0838922474a..671cc4f3ed0 100644
--- a/mode/type/cluster/repository/provider/zookeeper-curator/src/main/java/org/apache/shardingsphere/mode/repository/cluster/zookeeper/CuratorZookeeperRepository.java
+++ b/mode/type/cluster/repository/provider/zookeeper-curator/src/main/java/org/apache/shardingsphere/mode/repository/cluster/zookeeper/CuratorZookeeperRepository.java
@@ -152,9 +152,9 @@ public final class CuratorZookeeperRepository implements ClusterPersistRepositor
CuratorCache cache = CuratorCache.build(client, cachePath);
try {
cache.start();
- //CHECKSTYLE:OFF
+ // CHECKSTYLE:OFF
} catch (final Exception ex) {
- //CHECKSTYLE:ON
+ // CHECKSTYLE:ON
CuratorZookeeperExceptionHandler.handleException(ex);
}
caches.put(cachePath + "/", cache);
@@ -206,9 +206,9 @@ public final class CuratorZookeeperRepository implements ClusterPersistRepositor
default:
throw new UnsupportedOperationException(each.toString());
}
- //CHECKSTYLE:OFF
+ // CHECKSTYLE:OFF
} catch (final Exception ex) {
- //CHECKSTYLE:ON
+ // CHECKSTYLE:ON
throw new ClusterPersistRepositoryException(ex);
}
}
@@ -218,9 +218,9 @@ public final class CuratorZookeeperRepository implements ClusterPersistRepositor
try {
TransactionOp transactionOp = client.transactionOp();
client.transaction().forOperations(transactionOp.check().forPath(key), transactionOp.setData().forPath(key, value.getBytes(StandardCharsets.UTF_8)));
- //CHECKSTYLE:OFF
+ // CHECKSTYLE:OFF
} catch (final Exception ex) {
- //CHECKSTYLE:ON
+ // CHECKSTYLE:ON
CuratorZookeeperExceptionHandler.handleException(ex);
}
}
diff --git a/proxy/bootstrap/src/test/java/org/apache/shardingsphere/proxy/fixture/ClusterPersistRepositoryFixture.java b/proxy/bootstrap/src/test/java/org/apache/shardingsphere/proxy/fixture/ClusterPersistRepositoryFixture.java
index f71edcdff48..9df2694a136 100644
--- a/proxy/bootstrap/src/test/java/org/apache/shardingsphere/proxy/fixture/ClusterPersistRepositoryFixture.java
+++ b/proxy/bootstrap/src/test/java/org/apache/shardingsphere/proxy/fixture/ClusterPersistRepositoryFixture.java
@@ -65,7 +65,7 @@ public final class ClusterPersistRepositoryFixture implements ClusterPersistRepo
@Override
public void updateInTransaction(final String key, final String value) {
-
+
}
@Override