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 183f3b8 Remove DistMetaDataPersistRule (#11840)
183f3b8 is described below
commit 183f3b85e3ccea9fc410c91f7f4488ed8cc85b3b
Author: Liang Zhang <[email protected]>
AuthorDate: Mon Aug 16 12:30:03 2021 +0800
Remove DistMetaDataPersistRule (#11840)
* Remove YamlDistMetaDataPersistRuleConfiguration
* Remove DistMetaDataPersistRule
---
.../infra/constant/DistMetaDataPersistOrder.java | 33 ---------
.../DistMetaDataPersistRuleConfiguration.java | 39 -----------
.../infra/persist/constant/PersistOrder.java | 38 ----------
.../DistMetaDataPersistRepositoryFactory.java | 43 ------------
.../persist/rule/DistMetaDataPersistRule.java | 38 ----------
.../infra/persist/rule/PersistRule.java | 33 ---------
.../builder/DistMetaDataPersistRuleBuilder.java | 48 -------------
.../YamlDistMetaDataPersistRuleConfiguration.java | 44 ------------
...etaDataPersistRuleConfigurationYamlSwapper.java | 59 ----------------
...here.infra.rule.builder.scope.GlobalRuleBuilder | 18 -----
...aml.config.swapper.YamlRuleConfigurationSwapper | 18 -----
.../YamlRuleConfigurationSwapperEngineTest.java | 2 +-
...ataPersistRuleConfigurationYamlSwapperTest.java | 81 ----------------------
13 files changed, 1 insertion(+), 493 deletions(-)
diff --git
a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/constant/DistMetaDataPersistOrder.java
b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/constant/DistMetaDataPersistOrder.java
deleted file mode 100644
index ba3f5d6..0000000
---
a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/constant/DistMetaDataPersistOrder.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.infra.constant;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-
-/**
- * Dist meta data persist order.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class DistMetaDataPersistOrder {
-
- /**
- * Dist meta data persist order.
- */
- public static final int ORDER = 70;
-}
diff --git
a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/persist/config/DistMetaDataPersistRuleConfiguration.java
b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/persist/config/DistMetaDataPersistRuleConfiguration.java
deleted file mode 100644
index deccc5c..0000000
---
a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/persist/config/DistMetaDataPersistRuleConfiguration.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.infra.persist.config;
-
-import lombok.Getter;
-import lombok.RequiredArgsConstructor;
-import
org.apache.shardingsphere.infra.config.condition.PreConditionRuleConfiguration;
-import org.apache.shardingsphere.infra.config.scope.GlobalRuleConfiguration;
-
-import java.util.Properties;
-
-/**
- * Dist meta data persist rule configuration.
- */
-@RequiredArgsConstructor
-@Getter
-public final class DistMetaDataPersistRuleConfiguration implements
GlobalRuleConfiguration, PreConditionRuleConfiguration {
-
- private final String type;
-
- private final boolean overwrite;
-
- private final Properties props;
-}
diff --git
a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/persist/constant/PersistOrder.java
b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/persist/constant/PersistOrder.java
deleted file mode 100644
index d588af1..0000000
---
a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/persist/constant/PersistOrder.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.infra.persist.constant;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-
-/**
- * Persist order.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class PersistOrder {
-
- /**
- * Persist order.
- */
- public static final int ORDER = -800;
-
- /**
- * Algorithm provider persist order.
- */
- public static final int ALGORITHM_PROVIDER_ORDER = ORDER + 1;
-}
diff --git
a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/persist/repository/DistMetaDataPersistRepositoryFactory.java
b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/persist/repository/DistMetaDataPersistRepositoryFactory.java
deleted file mode 100644
index 9e4742e..0000000
---
a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/persist/repository/DistMetaDataPersistRepositoryFactory.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.infra.persist.repository;
-
-import org.apache.shardingsphere.infra.mode.repository.PersistRepository;
-import
org.apache.shardingsphere.infra.persist.config.DistMetaDataPersistRuleConfiguration;
-import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader;
-import org.apache.shardingsphere.infra.spi.typed.TypedSPIRegistry;
-
-/**
- * Dist meta data persist repository factory.
- */
-public final class DistMetaDataPersistRepositoryFactory {
-
- static {
- ShardingSphereServiceLoader.register(PersistRepository.class);
- }
-
- /**
- * Create new instance of dist meta data persist repository.
- *
- * @param ruleConfig dist meta data persist rule configuration
- * @return new instance of dist meta data persist repository
- */
- public static PersistRepository newInstance(final
DistMetaDataPersistRuleConfiguration ruleConfig) {
- return TypedSPIRegistry.getRegisteredService(PersistRepository.class,
ruleConfig.getType(), ruleConfig.getProps());
- }
-}
diff --git
a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/persist/rule/DistMetaDataPersistRule.java
b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/persist/rule/DistMetaDataPersistRule.java
deleted file mode 100644
index 33d1c27..0000000
---
a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/persist/rule/DistMetaDataPersistRule.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.infra.persist.rule;
-
-import lombok.Getter;
-import org.apache.shardingsphere.infra.persist.DistMetaDataPersistService;
-import
org.apache.shardingsphere.infra.persist.config.DistMetaDataPersistRuleConfiguration;
-import
org.apache.shardingsphere.infra.persist.repository.DistMetaDataPersistRepositoryFactory;
-import org.apache.shardingsphere.infra.rule.identifier.level.KernelRule;
-import org.apache.shardingsphere.infra.rule.identifier.scope.GlobalRule;
-
-/**
- * Dist meta data persist rule.
- */
-@Getter
-public final class DistMetaDataPersistRule implements PersistRule, KernelRule,
GlobalRule {
-
- private final DistMetaDataPersistService distMetaDataPersistService;
-
- public DistMetaDataPersistRule(final DistMetaDataPersistRuleConfiguration
config) {
- distMetaDataPersistService = new
DistMetaDataPersistService(DistMetaDataPersistRepositoryFactory.newInstance(config));
- }
-}
diff --git
a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/persist/rule/PersistRule.java
b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/persist/rule/PersistRule.java
deleted file mode 100644
index 7fb6cb6..0000000
---
a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/persist/rule/PersistRule.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.infra.persist.rule;
-
-import org.apache.shardingsphere.infra.persist.DistMetaDataPersistService;
-
-/**
- * Persist rule.
- */
-public interface PersistRule {
-
- /**
- * Get dist meta data persist service.
- *
- * @return dist meta data persist service
- */
- DistMetaDataPersistService getDistMetaDataPersistService();
-}
diff --git
a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/persist/rule/builder/DistMetaDataPersistRuleBuilder.java
b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/persist/rule/builder/DistMetaDataPersistRuleBuilder.java
deleted file mode 100644
index 7b05a4e..0000000
---
a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/persist/rule/builder/DistMetaDataPersistRuleBuilder.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.infra.persist.rule.builder;
-
-import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData;
-import
org.apache.shardingsphere.infra.persist.config.DistMetaDataPersistRuleConfiguration;
-import org.apache.shardingsphere.infra.persist.constant.PersistOrder;
-import org.apache.shardingsphere.infra.persist.rule.DistMetaDataPersistRule;
-import org.apache.shardingsphere.infra.rule.builder.level.KernelRuleBuilder;
-import org.apache.shardingsphere.infra.rule.builder.scope.GlobalRuleBuilder;
-
-import java.util.Map;
-
-/**
- * Dist meta data persist rule builder.
- */
-public final class DistMetaDataPersistRuleBuilder implements
KernelRuleBuilder, GlobalRuleBuilder<DistMetaDataPersistRuleConfiguration> {
-
- @Override
- public DistMetaDataPersistRule build(final
DistMetaDataPersistRuleConfiguration ruleConfig, final Map<String,
ShardingSphereMetaData> mataDataMap) {
- return new DistMetaDataPersistRule(ruleConfig);
- }
-
- @Override
- public int getOrder() {
- return PersistOrder.ORDER;
- }
-
- @Override
- public Class<DistMetaDataPersistRuleConfiguration> getTypeClass() {
- return DistMetaDataPersistRuleConfiguration.class;
- }
-}
diff --git
a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/pojo/persist/YamlDistMetaDataPersistRuleConfiguration.java
b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/pojo/persist/YamlDistMetaDataPersistRuleConfiguration.java
deleted file mode 100644
index bbde75e..0000000
---
a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/pojo/persist/YamlDistMetaDataPersistRuleConfiguration.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.infra.yaml.config.pojo.persist;
-
-import lombok.Getter;
-import lombok.Setter;
-import
org.apache.shardingsphere.infra.persist.config.DistMetaDataPersistRuleConfiguration;
-import org.apache.shardingsphere.infra.yaml.config.pojo.YamlRuleConfiguration;
-
-import java.util.Properties;
-
-/**
- * Yaml dist meta data persist rule configuration.
- */
-@Getter
-@Setter
-public final class YamlDistMetaDataPersistRuleConfiguration implements
YamlRuleConfiguration {
-
- private String type;
-
- private boolean overwrite;
-
- private Properties props = new Properties();
-
- @Override
- public Class<DistMetaDataPersistRuleConfiguration>
getRuleConfigurationType() {
- return DistMetaDataPersistRuleConfiguration.class;
- }
-}
diff --git
a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/persist/DistMetaDataPersistRuleConfigurationYamlSwapper.java
b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/persist/DistMetaDataPersistRuleConfigurationYamlSwapper.java
deleted file mode 100644
index dd5bad1..0000000
---
a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/persist/DistMetaDataPersistRuleConfigurationYamlSwapper.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.infra.yaml.config.swapper.persist;
-
-import org.apache.shardingsphere.infra.constant.DistMetaDataPersistOrder;
-import
org.apache.shardingsphere.infra.persist.config.DistMetaDataPersistRuleConfiguration;
-import
org.apache.shardingsphere.infra.yaml.config.pojo.persist.YamlDistMetaDataPersistRuleConfiguration;
-import
org.apache.shardingsphere.infra.yaml.config.swapper.YamlRuleConfigurationSwapper;
-
-/**
- * Dist meta data persist rule configuration YAML swapper.
- */
-public final class DistMetaDataPersistRuleConfigurationYamlSwapper implements
- YamlRuleConfigurationSwapper<YamlDistMetaDataPersistRuleConfiguration,
DistMetaDataPersistRuleConfiguration> {
-
- @Override
- public int getOrder() {
- return DistMetaDataPersistOrder.ORDER;
- }
-
- @Override
- public Class<DistMetaDataPersistRuleConfiguration> getTypeClass() {
- return DistMetaDataPersistRuleConfiguration.class;
- }
-
- @Override
- public YamlDistMetaDataPersistRuleConfiguration
swapToYamlConfiguration(final DistMetaDataPersistRuleConfiguration data) {
- YamlDistMetaDataPersistRuleConfiguration result = new
YamlDistMetaDataPersistRuleConfiguration();
- result.setType(data.getType());
- result.setOverwrite(data.isOverwrite());
- result.setProps(data.getProps());
- return result;
- }
-
- @Override
- public DistMetaDataPersistRuleConfiguration swapToObject(final
YamlDistMetaDataPersistRuleConfiguration yamlConfig) {
- return new DistMetaDataPersistRuleConfiguration(yamlConfig.getType(),
yamlConfig.isOverwrite(), yamlConfig.getProps());
- }
-
- @Override
- public String getRuleTagName() {
- return "DIST_METADATA_PERSIST";
- }
-}
diff --git
a/shardingsphere-infra/shardingsphere-infra-common/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.rule.builder.scope.GlobalRuleBuilder
b/shardingsphere-infra/shardingsphere-infra-common/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.rule.builder.scope.GlobalRuleBuilder
deleted file mode 100644
index fcaf11a..0000000
---
a/shardingsphere-infra/shardingsphere-infra-common/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.rule.builder.scope.GlobalRuleBuilder
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-org.apache.shardingsphere.infra.persist.rule.builder.DistMetaDataPersistRuleBuilder
diff --git
a/shardingsphere-infra/shardingsphere-infra-common/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.YamlRuleConfigurationSwapper
b/shardingsphere-infra/shardingsphere-infra-common/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.YamlRuleConfigurationSwapper
deleted file mode 100644
index 5327f7d..0000000
---
a/shardingsphere-infra/shardingsphere-infra-common/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.YamlRuleConfigurationSwapper
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-org.apache.shardingsphere.infra.yaml.config.swapper.persist.DistMetaDataPersistRuleConfigurationYamlSwapper
diff --git
a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/YamlRuleConfigurationSwapperEngineTest.java
b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/YamlRuleConfigurationSwapperEngineTest.java
index 5abdbf0..8d1a596 100644
---
a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/YamlRuleConfigurationSwapperEngineTest.java
+++
b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/YamlRuleConfigurationSwapperEngineTest.java
@@ -54,7 +54,7 @@ public final class YamlRuleConfigurationSwapperEngineTest {
@Test
public void assertGetYamlShortcuts() {
Map<String, Class<?>> actual =
YamlRuleConfigurationSwapperEngine.getYamlShortcuts();
- assertThat(actual.size(), is(2));
+ assertThat(actual.size(), is(1));
assertTrue(actual.containsKey("!FIXTURE"));
}
}
diff --git
a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/persist/DistMetaDataPersistRuleConfigurationYamlSwapperTest.java
b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/persist/DistMetaDataPersistRuleConfigurationYamlSwapperTest.java
deleted file mode 100644
index 2703d78..0000000
---
a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/persist/DistMetaDataPersistRuleConfigurationYamlSwapperTest.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.infra.yaml.config.swapper.persist;
-
-import org.apache.shardingsphere.infra.constant.DistMetaDataPersistOrder;
-import
org.apache.shardingsphere.infra.persist.config.DistMetaDataPersistRuleConfiguration;
-import
org.apache.shardingsphere.infra.yaml.config.pojo.persist.YamlDistMetaDataPersistRuleConfiguration;
-import org.junit.Test;
-
-import java.util.Properties;
-
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
-
-public final class DistMetaDataPersistRuleConfigurationYamlSwapperTest {
-
- private final DistMetaDataPersistRuleConfigurationYamlSwapper swapper =
new DistMetaDataPersistRuleConfigurationYamlSwapper();
-
- @Test
- public void assertGetOrder() {
- assertThat(swapper.getOrder(), is(DistMetaDataPersistOrder.ORDER));
- }
-
- @Test
- public void assertGetTypeClass() {
- assertThat(swapper.getTypeClass(),
equalTo(DistMetaDataPersistRuleConfiguration.class));
- }
-
- @Test
- public void assertSwapToYamlConfiguration() {
- DistMetaDataPersistRuleConfiguration
distMetaDataPersistRuleConfiguration =
- new DistMetaDataPersistRuleConfiguration("Local", true,
buildProperties());
- YamlDistMetaDataPersistRuleConfiguration actual =
swapper.swapToYamlConfiguration(distMetaDataPersistRuleConfiguration);
- assertNotNull(actual);
- assertThat(actual.getType(), is("Local"));
- assertThat(actual.getProps().get("path"), is("test"));
- assertTrue(actual.isOverwrite());
- }
-
- @Test
- public void assertSwapToObject() {
- YamlDistMetaDataPersistRuleConfiguration yamlConfig = new
YamlDistMetaDataPersistRuleConfiguration();
- yamlConfig.setType("Local");
- yamlConfig.setOverwrite(true);
- yamlConfig.setProps(buildProperties());
- DistMetaDataPersistRuleConfiguration actual =
swapper.swapToObject(yamlConfig);
- assertNotNull(actual);
- assertThat(actual.getType(), is("Local"));
- assertThat(actual.getProps().get("path"), is("test"));
- assertTrue(actual.isOverwrite());
- }
-
- @Test
- public void assertGetRuleTagName() {
- assertThat(swapper.getRuleTagName(), is("DIST_METADATA_PERSIST"));
- }
-
- private Properties buildProperties() {
- Properties result = new Properties();
- result.setProperty("path", "test");
- return result;
- }
-}