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

[shardingsphere] branch master updated: Rename H2ScalingEntryFixture (#17535)

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

zhaojinchao 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 ebd37a5e6d4 Rename H2ScalingEntryFixture (#17535)
ebd37a5e6d4 is described below

commit ebd37a5e6d46c6b9949d446b42f5e3db253fd0e1
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Tue May 10 23:54:42 2022 +0800

    Rename H2ScalingEntryFixture (#17535)
    
    * Rename H2ScalingEntryFixture
    
    * Move ScalingEntryFactoryTest
---
 .../scaling/core/spi/ScalingEntryFactoryTest.java          | 12 +++---------
 .../scaling/core/spi/fixture/ScalingEntryFixture.java      | 14 +++++++-------
 ...org.apache.shardingsphere.scaling.core.spi.ScalingEntry |  2 +-
 ...FixtureScalingEntry.java => H2ScalingEntryFixture.java} |  2 +-
 ...org.apache.shardingsphere.scaling.core.spi.ScalingEntry |  2 +-
 5 files changed, 13 insertions(+), 19 deletions(-)

diff --git a/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/scaling/core/spi/ScalingEntryFactoryTest.java b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/test/java/org/apache/shardingsphere/scaling/core/spi/ScalingEntryFactoryTest.java
similarity index 68%
rename from shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/scaling/core/spi/ScalingEntryFactoryTest.java
rename to shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/test/java/org/apache/shardingsphere/scaling/core/spi/ScalingEntryFactoryTest.java
index 93556a7ede0..2aceedfe2c2 100644
--- a/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/scaling/core/spi/ScalingEntryFactoryTest.java
+++ b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/test/java/org/apache/shardingsphere/scaling/core/spi/ScalingEntryFactoryTest.java
@@ -17,8 +17,7 @@
 
 package org.apache.shardingsphere.scaling.core.spi;
 
-import org.apache.shardingsphere.data.pipeline.core.fixture.FixtureScalingEntry;
-import org.apache.shardingsphere.spi.exception.ServiceProviderNotFoundException;
+import org.apache.shardingsphere.scaling.core.spi.fixture.ScalingEntryFixture;
 import org.junit.Test;
 
 import static org.junit.Assert.assertTrue;
@@ -26,12 +25,7 @@ import static org.junit.Assert.assertTrue;
 public final class ScalingEntryFactoryTest {
     
     @Test
-    public void assertGetFixtureInstance() {
-        assertTrue(ScalingEntryFactory.getInstance("H2") instanceof FixtureScalingEntry);
-    }
-    
-    @Test(expected = ServiceProviderNotFoundException.class)
-    public void assertGetInstanceFailure() {
-        ScalingEntryFactory.getInstance("None");
+    public void assertGetInstance() {
+        assertTrue(ScalingEntryFactory.getInstance("FIXTURE") instanceof ScalingEntryFixture);
     }
 }
diff --git a/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/fixture/FixtureScalingEntry.java b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/test/java/org/apache/shardingsphere/scaling/core/spi/fixture/ScalingEntryFixture.java
similarity index 83%
copy from shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/fixture/FixtureScalingEntry.java
copy to shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/test/java/org/apache/shardingsphere/scaling/core/spi/fixture/ScalingEntryFixture.java
index 50f588fe56d..005f759aa6a 100644
--- a/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/fixture/FixtureScalingEntry.java
+++ b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/test/java/org/apache/shardingsphere/scaling/core/spi/fixture/ScalingEntryFixture.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.data.pipeline.core.fixture;
+package org.apache.shardingsphere.scaling.core.spi.fixture;
 
 import org.apache.shardingsphere.data.pipeline.spi.importer.Importer;
 import org.apache.shardingsphere.data.pipeline.spi.ingest.dumper.IncrementalDumper;
@@ -23,30 +23,30 @@ import org.apache.shardingsphere.data.pipeline.spi.ingest.dumper.InventoryDumper
 import org.apache.shardingsphere.scaling.core.job.check.EnvironmentChecker;
 import org.apache.shardingsphere.scaling.core.spi.ScalingEntry;
 
-public final class FixtureScalingEntry implements ScalingEntry {
+public final class ScalingEntryFixture implements ScalingEntry {
     
     @Override
     public Class<? extends InventoryDumper> getInventoryDumperClass() {
-        return FixtureInventoryDumper.class;
+        return InventoryDumper.class;
     }
     
     @Override
     public Class<? extends IncrementalDumper> getIncrementalDumperClass() {
-        return FixtureIncrementalDumper.class;
+        return IncrementalDumper.class;
     }
     
     @Override
     public Class<? extends Importer> getImporterClass() {
-        return FixtureImporter.class;
+        return Importer.class;
     }
     
     @Override
     public Class<? extends EnvironmentChecker> getEnvironmentCheckerClass() {
-        return FixtureEnvironmentChecker.class;
+        return EnvironmentChecker.class;
     }
     
     @Override
     public String getType() {
-        return "H2";
+        return "FIXTURE";
     }
 }
diff --git a/shardingsphere-test/shardingsphere-pipeline-test/src/test/resources/META-INF/services/org.apache.shardingsphere.scaling.core.spi.ScalingEntry b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/test/resources/META-INF/services/org.apache.shardingsphere.scaling.core.spi.ScalingEntry
similarity index 91%
copy from shardingsphere-test/shardingsphere-pipeline-test/src/test/resources/META-INF/services/org.apache.shardingsphere.scaling.core.spi.ScalingEntry
copy to shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/test/resources/META-INF/services/org.apache.shardingsphere.scaling.core.spi.ScalingEntry
index f96ef6580a7..ca7560fc30b 100644
--- a/shardingsphere-test/shardingsphere-pipeline-test/src/test/resources/META-INF/services/org.apache.shardingsphere.scaling.core.spi.ScalingEntry
+++ b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/test/resources/META-INF/services/org.apache.shardingsphere.scaling.core.spi.ScalingEntry
@@ -15,4 +15,4 @@
 # limitations under the License.
 #
 
-org.apache.shardingsphere.data.pipeline.core.fixture.FixtureScalingEntry
+org.apache.shardingsphere.scaling.core.spi.fixture.ScalingEntryFixture
diff --git a/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/fixture/FixtureScalingEntry.java b/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/fixture/H2ScalingEntryFixture.java
similarity index 96%
rename from shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/fixture/FixtureScalingEntry.java
rename to shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/fixture/H2ScalingEntryFixture.java
index 50f588fe56d..02ef0dad62b 100644
--- a/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/fixture/FixtureScalingEntry.java
+++ b/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/fixture/H2ScalingEntryFixture.java
@@ -23,7 +23,7 @@ import org.apache.shardingsphere.data.pipeline.spi.ingest.dumper.InventoryDumper
 import org.apache.shardingsphere.scaling.core.job.check.EnvironmentChecker;
 import org.apache.shardingsphere.scaling.core.spi.ScalingEntry;
 
-public final class FixtureScalingEntry implements ScalingEntry {
+public final class H2ScalingEntryFixture implements ScalingEntry {
     
     @Override
     public Class<? extends InventoryDumper> getInventoryDumperClass() {
diff --git a/shardingsphere-test/shardingsphere-pipeline-test/src/test/resources/META-INF/services/org.apache.shardingsphere.scaling.core.spi.ScalingEntry b/shardingsphere-test/shardingsphere-pipeline-test/src/test/resources/META-INF/services/org.apache.shardingsphere.scaling.core.spi.ScalingEntry
index f96ef6580a7..38e504427ae 100644
--- a/shardingsphere-test/shardingsphere-pipeline-test/src/test/resources/META-INF/services/org.apache.shardingsphere.scaling.core.spi.ScalingEntry
+++ b/shardingsphere-test/shardingsphere-pipeline-test/src/test/resources/META-INF/services/org.apache.shardingsphere.scaling.core.spi.ScalingEntry
@@ -15,4 +15,4 @@
 # limitations under the License.
 #
 
-org.apache.shardingsphere.data.pipeline.core.fixture.FixtureScalingEntry
+org.apache.shardingsphere.data.pipeline.core.fixture.H2ScalingEntryFixture