You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by ji...@apache.org on 2022/07/29 15:46:10 UTC

[shardingsphere] branch master updated: Remove TestRuleConfigurationWithoutChecker (#19701)

This is an automated email from the ASF dual-hosted git repository.

jianglongtao 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 9c5a5d567fc Remove TestRuleConfigurationWithoutChecker (#19701)
9c5a5d567fc is described below

commit 9c5a5d567fc2f3cb3dbf8d6d3bdf23b0ef68d3af
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Fri Jul 29 23:46:04 2022 +0800

    Remove TestRuleConfigurationWithoutChecker (#19701)
    
    * Move ShardingSphereAlgorithmFixture
    
    * Remove TestRuleConfigurationWithoutChecker
    
    * Remove TestRuleConfigurationWithoutChecker
---
 .../ShardingSphereAlgorithmFactoryTest.java        |  2 +-
 .../fixture/ShardingSphereAlgorithmFixture.java    |  2 +-
 .../RuleConfigurationCheckerFactoryTest.java       |  7 +++----
 .../TestRuleConfigurationWithoutChecker.java       | 24 ----------------------
 ....infra.config.algorithm.ShardingSphereAlgorithm |  2 +-
 5 files changed, 6 insertions(+), 31 deletions(-)

diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/algorithm/ShardingSphereAlgorithmFactoryTest.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/algorithm/ShardingSphereAlgorithmFactoryTest.java
index a23f07a04a3..aa83c10db69 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/algorithm/ShardingSphereAlgorithmFactoryTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/algorithm/ShardingSphereAlgorithmFactoryTest.java
@@ -17,7 +17,7 @@
 
 package org.apache.shardingsphere.infra.config.algorithm;
 
-import org.apache.shardingsphere.infra.config.fixture.ShardingSphereAlgorithmFixture;
+import org.apache.shardingsphere.infra.config.algorithm.fixture.ShardingSphereAlgorithmFixture;
 import org.apache.shardingsphere.spi.ShardingSphereServiceLoader;
 import org.junit.BeforeClass;
 import org.junit.Test;
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/fixture/ShardingSphereAlgorithmFixture.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/algorithm/fixture/ShardingSphereAlgorithmFixture.java
similarity index 95%
rename from shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/fixture/ShardingSphereAlgorithmFixture.java
rename to shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/algorithm/fixture/ShardingSphereAlgorithmFixture.java
index 3d63a52ca8e..2cb79edf8be 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/fixture/ShardingSphereAlgorithmFixture.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/algorithm/fixture/ShardingSphereAlgorithmFixture.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.infra.config.fixture;
+package org.apache.shardingsphere.infra.config.algorithm.fixture;
 
 import lombok.Getter;
 import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithm;
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/checker/RuleConfigurationCheckerFactoryTest.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/checker/RuleConfigurationCheckerFactoryTest.java
index c7016035565..e163cb24a05 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/checker/RuleConfigurationCheckerFactoryTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/checker/RuleConfigurationCheckerFactoryTest.java
@@ -17,7 +17,7 @@
 
 package org.apache.shardingsphere.infra.config.checker;
 
-import org.apache.shardingsphere.infra.config.checker.fixture.TestRuleConfigurationWithoutChecker;
+import org.apache.shardingsphere.infra.config.RuleConfiguration;
 import org.apache.shardingsphere.infra.fixture.FixtureRuleConfiguration;
 import org.junit.Test;
 
@@ -27,6 +27,7 @@ import static org.hamcrest.CoreMatchers.instanceOf;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertThat;
 import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
 
 public final class RuleConfigurationCheckerFactoryTest {
     
@@ -38,10 +39,8 @@ public final class RuleConfigurationCheckerFactoryTest {
         assertThat(checker.get(), instanceOf(RuleConfigurationCheckerFixture.class));
     }
     
-    @SuppressWarnings("rawtypes")
     @Test
     public void assertFindInstanceWithoutChecker() {
-        Optional<RuleConfigurationChecker> checker = RuleConfigurationCheckerFactory.findInstance(new TestRuleConfigurationWithoutChecker());
-        assertFalse(checker.isPresent());
+        assertFalse(RuleConfigurationCheckerFactory.findInstance(mock(RuleConfiguration.class)).isPresent());
     }
 }
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/checker/fixture/TestRuleConfigurationWithoutChecker.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/checker/fixture/TestRuleConfigurationWithoutChecker.java
deleted file mode 100644
index 0868a5d56f8..00000000000
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/checker/fixture/TestRuleConfigurationWithoutChecker.java
+++ /dev/null
@@ -1,24 +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.config.checker.fixture;
-
-import org.apache.shardingsphere.infra.config.RuleConfiguration;
-import org.apache.shardingsphere.infra.config.function.EnhancedRuleConfiguration;
-
-public final class TestRuleConfigurationWithoutChecker implements RuleConfiguration, EnhancedRuleConfiguration {
-}
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithm b/shardingsphere-infra/shardingsphere-infra-common/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithm
index 336749aed5a..c13fae309c8 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithm
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithm
@@ -15,4 +15,4 @@
 # limitations under the License.
 #
 
-org.apache.shardingsphere.infra.config.fixture.ShardingSphereAlgorithmFixture
+org.apache.shardingsphere.infra.config.algorithm.fixture.ShardingSphereAlgorithmFixture