You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by yx...@apache.org on 2022/05/07 02:39:45 UTC
[shardingsphere] branch master updated: Rename algorithm fixtures (#17399)
This is an automated email from the ASF dual-hosted git repository.
yx9o 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 f5593ca19ea Rename algorithm fixtures (#17399)
f5593ca19ea is described below
commit f5593ca19ea47e7b2c68668dda0afe473cf5a0a1
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Sat May 7 10:39:31 2022 +0800
Rename algorithm fixtures (#17399)
* Rename EncryptAlgorithmFixture of shardingsphere-jdbc-core module
* Refactor TestQueryAssistedEncryptAlgorithm
* Rename QueryAssistedEncryptAlgorithmFixture
* Rename TestEncryptAlgorithm
* Remove useless TestEncryptAlgorithm
* Remove useless TestReplicaLoadBalanceAlgorithm
* Rename fixture of DatabaseDiscoveryProviderAlgorithm
* Rename ShardingAlgorithmFixture
* Rename EncryptAlgorithmFixture
* Rename EncryptAlgorithmFixture
* Refactor CreateShadowAlgorithmStatementUpdaterTest
* Refactor CreateShadowAlgorithmStatementUpdaterTest
---
...0_The_Ideal_Database_Management_Ecosystem.en.md | 2 +-
...DatabaseDiscoveryProviderAlgorithmFixture.java} | 2 +-
...hmProvidedDatabaseDiscoveryRuleBuilderTest.java | 4 +-
...iscovery.spi.DatabaseDiscoveryProviderAlgorithm | 2 +-
...DatabaseDiscoveryProviderAlgorithmFixture.java} | 2 +-
...iscovery.spi.DatabaseDiscoveryProviderAlgorithm | 2 +-
...rithm.java => CoreEncryptAlgorithmFixture.java} | 12 +-----
... CoreQueryAssistedEncryptAlgorithmFixture.java} | 12 +-----
...chemaMetaDataAwareEncryptAlgorithmFixture.java} | 4 +-
.../encrypt/rule/EncryptRuleTest.java | 30 +++++++-------
...orithmProviderConfigurationYamlSwapperTest.java | 4 +-
.../EncryptRuleConfigurationYamlSwapperTest.java | 6 +--
...che.shardingsphere.encrypt.spi.EncryptAlgorithm | 6 +--
.../handler/fixture/TestEncryptAlgorithm.java | 47 ----------------------
...che.shardingsphere.encrypt.spi.EncryptAlgorithm | 18 ---------
.../fixture/HintShadowAlgorithmFixture.java | 36 -----------------
.../CreateShadowAlgorithmStatementUpdaterTest.java | 28 ++++++-------
...pache.shardingsphere.shadow.spi.ShadowAlgorithm | 18 ---------
...> CoreComplexKeysShardingAlgorithmFixture.java} | 4 +-
....java => CoreHintShardingAlgorithmFixture.java} | 4 +-
...a => CoreStandardShardingAlgorithmFixture.java} | 4 +-
.../engine/fixture/AbstractRoutingEngineTest.java | 14 +++----
.../strategy/ShardingStrategyFactoryTest.java | 12 +++---
.../route/strategy/ShardingStrategyTest.java | 8 ++--
.../type/complex/ComplexShardingStrategyTest.java | 4 +-
.../type/hint/HintShardingStrategyTest.java | 4 +-
.../standard/StandardShardingStrategyTest.java | 4 +-
.../sharding/rule/ShardingRuleTest.java | 16 ++++----
...ationsForYamlShardingRuleConfigurationTest.java | 12 +++---
...ardingStrategyConfigurationYamlSwapperTest.java | 2 +-
...e.shardingsphere.sharding.spi.ShardingAlgorithm | 6 +--
.../src/test/resources/yaml/sharding-rule.yaml | 22 +++++-----
...rithm.java => JDBCEncryptAlgorithmFixture.java} | 4 +-
... JDBCQueryAssistedEncryptAlgorithmFixture.java} | 4 +-
...che.shardingsphere.encrypt.spi.EncryptAlgorithm | 4 +-
.../config/config-encrypt-query-with-cipher.yaml | 16 ++++----
.../config/config-encrypt-query-with-plain.yaml | 16 ++++----
.../fixture/TestReplicaLoadBalanceAlgorithm.java | 42 -------------------
...dwritesplitting.spi.ReplicaLoadBalanceAlgorithm | 18 ---------
39 files changed, 130 insertions(+), 325 deletions(-)
diff --git a/docs/blog/content/material/Jan_28_Blog_X_Kernel_Optimizations_&_Upgrade_Guide_for_Apache_ShardingSphere_5.0.0_The_Ideal_Database_Management_Ecosystem.en.md b/docs/blog/content/material/Jan_28_Blog_X_Kernel_Optimizations_&_Upgrade_Guide_for_Apache_ShardingSphere_5.0.0_The_Ideal_Database_Management_Ecosystem.en.md
index 9a47251662b..6d251348259 100644
--- a/docs/blog/content/material/Jan_28_Blog_X_Kernel_Optimizations_&_Upgrade_Guide_for_Apache_ShardingSphere_5.0.0_The_Ideal_Database_Management_Ecosystem.en.md
+++ b/docs/blog/content/material/Jan_28_Blog_X_Kernel_Optimizations_&_Upgrade_Guide_for_Apache_ShardingSphere_5.0.0_The_Ideal_Database_Management_Ecosystem.en.md
@@ -368,7 +368,7 @@ The new API also supports a variety of matching algorithms, such as column value
column: user_id
regex: "[1]"
simple-hint-algorithm:
- type: SIMPLE_NOTE
+ type: SIMPLE_HINT
props:
shadow: true
foo: bar
diff --git a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/test/java/org/apache/shardingsphere/dbdiscovery/fixture/CoreFixtureDatabaseDiscoveryProviderAlgorithm.java b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/test/java/org/apache/shardingsphere/dbdiscovery/fixture/CoreDatabaseDiscoveryProviderAlgorithmFixture.java
similarity index 96%
rename from shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/test/java/org/apache/shardingsphere/dbdiscovery/fixture/CoreFixtureDatabaseDiscoveryProviderAlgorithm.java
rename to shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/test/java/org/apache/shardingsphere/dbdiscovery/fixture/CoreDatabaseDiscoveryProviderAlgorithmFixture.java
index 7fbc61e8460..aa8f52586f7 100644
--- a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/test/java/org/apache/shardingsphere/dbdiscovery/fixture/CoreFixtureDatabaseDiscoveryProviderAlgorithm.java
+++ b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/test/java/org/apache/shardingsphere/dbdiscovery/fixture/CoreDatabaseDiscoveryProviderAlgorithmFixture.java
@@ -22,7 +22,7 @@ import org.apache.shardingsphere.dbdiscovery.spi.ReplicaDataSourceStatus;
import javax.sql.DataSource;
-public final class CoreFixtureDatabaseDiscoveryProviderAlgorithm implements DatabaseDiscoveryProviderAlgorithm {
+public final class CoreDatabaseDiscoveryProviderAlgorithmFixture implements DatabaseDiscoveryProviderAlgorithm {
@Override
public void checkEnvironment(final String databaseName, final DataSource dataSource) {
diff --git a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/test/java/org/apache/shardingsphere/dbdiscovery/rule/builder/AlgorithmProvidedDatabaseDiscoveryRuleBuilderTest.java b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/test/java/org/apache/shardingsphere/dbdiscovery/rule/builder/AlgorithmProvidedDatabaseDiscoveryRuleBuilderTest.java
index a1758090663..784e55d3de9 100644
--- a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/test/java/org/apache/shardingsphere/dbdiscovery/rule/builder/AlgorithmProvidedDatabaseDiscoveryRuleBuilderTest.java
+++ b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/test/java/org/apache/shardingsphere/dbdiscovery/rule/builder/AlgorithmProvidedDatabaseDiscoveryRuleBuilderTest.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.dbdiscovery.rule.builder;
import org.apache.shardingsphere.dbdiscovery.algorithm.config.AlgorithmProvidedDatabaseDiscoveryRuleConfiguration;
import org.apache.shardingsphere.dbdiscovery.api.config.rule.DatabaseDiscoveryDataSourceRuleConfiguration;
import org.apache.shardingsphere.dbdiscovery.api.config.rule.DatabaseDiscoveryHeartBeatConfiguration;
-import org.apache.shardingsphere.dbdiscovery.fixture.CoreFixtureDatabaseDiscoveryProviderAlgorithm;
+import org.apache.shardingsphere.dbdiscovery.fixture.CoreDatabaseDiscoveryProviderAlgorithmFixture;
import org.apache.shardingsphere.dbdiscovery.rule.DatabaseDiscoveryRule;
import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.rule.builder.schema.SchemaRuleBuilder;
@@ -44,7 +44,7 @@ public final class AlgorithmProvidedDatabaseDiscoveryRuleBuilderTest {
Collections.singletonList(new DatabaseDiscoveryDataSourceRuleConfiguration("name", Collections.singletonList("name"), "", "discoveryTypeName")),
Collections.singletonMap("ha_heartbeat",
new DatabaseDiscoveryHeartBeatConfiguration(new Properties())),
- Collections.singletonMap("discoveryTypeName", new CoreFixtureDatabaseDiscoveryProviderAlgorithm()));
+ Collections.singletonMap("discoveryTypeName", new CoreDatabaseDiscoveryProviderAlgorithmFixture()));
SchemaRuleBuilder builder = SchemaRuleBuilderFactory.newInstance(Collections.singletonList(algorithmProvidedRuleConfig)).get(algorithmProvidedRuleConfig);
assertThat(builder.build(algorithmProvidedRuleConfig, "", Collections.singletonMap("name", mock(DataSource.class)), Collections.emptyList(), new ConfigurationProperties(new Properties())),
instanceOf(DatabaseDiscoveryRule.class));
diff --git a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/test/resources/META-INF/services/org.apache.shardingsphere.dbdiscovery.spi.DatabaseDiscoveryProviderAlgorithm b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/test/resources/META-INF/services/org.apache.shardingsphere.dbdiscovery.spi.DatabaseDiscoveryProviderAlgorithm
index 682f80b228b..750d604bf9c 100644
--- a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/test/resources/META-INF/services/org.apache.shardingsphere.dbdiscovery.spi.DatabaseDiscoveryProviderAlgorithm
+++ b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/test/resources/META-INF/services/org.apache.shardingsphere.dbdiscovery.spi.DatabaseDiscoveryProviderAlgorithm
@@ -15,4 +15,4 @@
# limitations under the License.
#
-org.apache.shardingsphere.dbdiscovery.fixture.CoreFixtureDatabaseDiscoveryProviderAlgorithm
+org.apache.shardingsphere.dbdiscovery.fixture.CoreDatabaseDiscoveryProviderAlgorithmFixture
diff --git a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-distsql/shardingsphere-db-discovery-distsql-handler/src/test/java/org/apache/shardingsphere/dbdiscovery/distsql/handler/fixture/DistSQLFixtureDatabaseDiscoveryProviderAlgorithm.java b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-distsql/shardingsphere-db-discovery-distsql-handler/src/test/java/org/apache/shardingsphere/dbdiscovery/distsql/handler/fixture/DistSQLD [...]
similarity index 93%
rename from shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-distsql/shardingsphere-db-discovery-distsql-handler/src/test/java/org/apache/shardingsphere/dbdiscovery/distsql/handler/fixture/DistSQLFixtureDatabaseDiscoveryProviderAlgorithm.java
rename to shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-distsql/shardingsphere-db-discovery-distsql-handler/src/test/java/org/apache/shardingsphere/dbdiscovery/distsql/handler/fixture/DistSQLDatabaseDiscoveryProviderAlgorithmFixture.java
index 4acef84741d..2baddcec59d 100644
--- a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-distsql/shardingsphere-db-discovery-distsql-handler/src/test/java/org/apache/shardingsphere/dbdiscovery/distsql/handler/fixture/DistSQLFixtureDatabaseDiscoveryProviderAlgorithm.java
+++ b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-distsql/shardingsphere-db-discovery-distsql-handler/src/test/java/org/apache/shardingsphere/dbdiscovery/distsql/handler/fixture/DistSQLDatabaseDiscoveryProviderAlgorithmFixture.java
@@ -22,7 +22,7 @@ import org.apache.shardingsphere.dbdiscovery.spi.ReplicaDataSourceStatus;
import javax.sql.DataSource;
-public final class DistSQLFixtureDatabaseDiscoveryProviderAlgorithm implements DatabaseDiscoveryProviderAlgorithm {
+public final class DistSQLDatabaseDiscoveryProviderAlgorithmFixture implements DatabaseDiscoveryProviderAlgorithm {
@Override
public void checkEnvironment(final String databaseName, final DataSource dataSource) {
diff --git a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-distsql/shardingsphere-db-discovery-distsql-handler/src/test/resources/META-INF/services/org.apache.shardingsphere.dbdiscovery.spi.DatabaseDiscoveryProviderAlgorithm b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-distsql/shardingsphere-db-discovery-distsql-handler/src/test/resources/META-INF/services/org.apache.shardingsphere.dbdiscovery.spi.DatabaseDiscoveryProv [...]
index 83d7e678c8e..5dc6757a8fc 100644
--- a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-distsql/shardingsphere-db-discovery-distsql-handler/src/test/resources/META-INF/services/org.apache.shardingsphere.dbdiscovery.spi.DatabaseDiscoveryProviderAlgorithm
+++ b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-distsql/shardingsphere-db-discovery-distsql-handler/src/test/resources/META-INF/services/org.apache.shardingsphere.dbdiscovery.spi.DatabaseDiscoveryProviderAlgorithm
@@ -15,4 +15,4 @@
# limitations under the License.
#
-org.apache.shardingsphere.dbdiscovery.distsql.handler.fixture.DistSQLFixtureDatabaseDiscoveryProviderAlgorithm
+org.apache.shardingsphere.dbdiscovery.distsql.handler.fixture.DistSQLDatabaseDiscoveryProviderAlgorithmFixture
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/fixture/TestEncryptAlgorithm.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/fixture/CoreEncryptAlgorithmFixture.java
similarity index 84%
rename from shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/fixture/TestEncryptAlgorithm.java
rename to shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/fixture/CoreEncryptAlgorithmFixture.java
index 736e7ecb272..8218d50a768 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/fixture/TestEncryptAlgorithm.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/fixture/CoreEncryptAlgorithmFixture.java
@@ -17,18 +17,10 @@
package org.apache.shardingsphere.encrypt.fixture;
-import lombok.Getter;
-import lombok.Setter;
import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm;
import org.apache.shardingsphere.encrypt.spi.context.EncryptContext;
-import java.util.Properties;
-
-public final class TestEncryptAlgorithm implements EncryptAlgorithm<Object, String> {
-
- @Getter
- @Setter
- private Properties props;
+public final class CoreEncryptAlgorithmFixture implements EncryptAlgorithm<Object, String> {
@Override
public String encrypt(final Object plainValue, final EncryptContext encryptContext) {
@@ -42,6 +34,6 @@ public final class TestEncryptAlgorithm implements EncryptAlgorithm<Object, Stri
@Override
public String getType() {
- return "TEST";
+ return "CORE.FIXTURE";
}
}
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/fixture/TestQueryAssistedEncryptAlgorithm.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/fixture/CoreQueryAssistedEncryptAlgorithmFixture.java
similarity index 84%
rename from shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/fixture/TestQueryAssistedEncryptAlgorithm.java
rename to shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/fixture/CoreQueryAssistedEncryptAlgorithmFixture.java
index fa6734778a1..087735f4cc3 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/fixture/TestQueryAssistedEncryptAlgorithm.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/fixture/CoreQueryAssistedEncryptAlgorithmFixture.java
@@ -17,18 +17,10 @@
package org.apache.shardingsphere.encrypt.fixture;
-import lombok.Getter;
-import lombok.Setter;
import org.apache.shardingsphere.encrypt.spi.QueryAssistedEncryptAlgorithm;
import org.apache.shardingsphere.encrypt.spi.context.EncryptContext;
-import java.util.Properties;
-
-public final class TestQueryAssistedEncryptAlgorithm implements QueryAssistedEncryptAlgorithm<Object, String> {
-
- @Getter
- @Setter
- private Properties props;
+public final class CoreQueryAssistedEncryptAlgorithmFixture implements QueryAssistedEncryptAlgorithm<Object, String> {
@Override
public String encrypt(final Object plainValue, final EncryptContext encryptContext) {
@@ -47,6 +39,6 @@ public final class TestQueryAssistedEncryptAlgorithm implements QueryAssistedEnc
@Override
public String getType() {
- return "QUERY_ASSISTED_TEST";
+ return "CORE.QUERY_ASSISTED.FIXTURE";
}
}
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/fixture/SchemaMetaDataAwareEncryptAlgorithmFixture.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/fixture/CoreSchemaMetaDataAwareEncryptAlgorithmFixture.java
similarity index 90%
rename from shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/fixture/SchemaMetaDataAwareEncryptAlgorithmFixture.java
rename to shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/fixture/CoreSchemaMetaDataAwareEncryptAlgorithmFixture.java
index 9874b687c87..37b8dd11315 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/fixture/SchemaMetaDataAwareEncryptAlgorithmFixture.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/fixture/CoreSchemaMetaDataAwareEncryptAlgorithmFixture.java
@@ -28,7 +28,7 @@ import java.util.Map;
@Getter
@Setter
-public final class SchemaMetaDataAwareEncryptAlgorithmFixture implements EncryptAlgorithm<Integer, Integer>, SchemaMetaDataAware {
+public final class CoreSchemaMetaDataAwareEncryptAlgorithmFixture implements EncryptAlgorithm<Integer, Integer>, SchemaMetaDataAware {
private String databaseName;
@@ -46,6 +46,6 @@ public final class SchemaMetaDataAwareEncryptAlgorithmFixture implements Encrypt
@Override
public String getType() {
- return "METADATA_AWARE.FIXTURE";
+ return "CORE.METADATA_AWARE.FIXTURE";
}
}
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/rule/EncryptRuleTest.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/rule/EncryptRuleTest.java
index 0602ba85122..e02539c46e9 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/rule/EncryptRuleTest.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/rule/EncryptRuleTest.java
@@ -22,8 +22,8 @@ import org.apache.shardingsphere.encrypt.algorithm.config.AlgorithmProvidedEncry
import org.apache.shardingsphere.encrypt.api.config.EncryptRuleConfiguration;
import org.apache.shardingsphere.encrypt.api.config.rule.EncryptColumnRuleConfiguration;
import org.apache.shardingsphere.encrypt.api.config.rule.EncryptTableRuleConfiguration;
-import org.apache.shardingsphere.encrypt.fixture.SchemaMetaDataAwareEncryptAlgorithmFixture;
-import org.apache.shardingsphere.encrypt.fixture.TestEncryptAlgorithm;
+import org.apache.shardingsphere.encrypt.fixture.CoreSchemaMetaDataAwareEncryptAlgorithmFixture;
+import org.apache.shardingsphere.encrypt.fixture.CoreEncryptAlgorithmFixture;
import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm;
import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.infra.database.DefaultSchema;
@@ -52,14 +52,14 @@ public final class EncryptRuleTest {
EncryptColumnRuleConfiguration encryptColumnConfig = new EncryptColumnRuleConfiguration("encrypt_column", "encrypt_cipher", "", "", "test_encryptor");
EncryptTableRuleConfiguration tableConfig = new EncryptTableRuleConfiguration("t_encrypt", Collections.singletonList(encryptColumnConfig), null);
AlgorithmProvidedEncryptRuleConfiguration ruleConfig = new AlgorithmProvidedEncryptRuleConfiguration(
- Collections.singleton(tableConfig), ImmutableMap.of("test_encryptor", new TestEncryptAlgorithm()), true);
+ Collections.singleton(tableConfig), ImmutableMap.of("test_encryptor", new CoreEncryptAlgorithmFixture()), true);
EncryptRule actual = new EncryptRule(ruleConfig, Collections.emptyMap());
assertTrue(actual.findEncryptTable("t_encrypt").isPresent());
}
@Test(expected = IllegalArgumentException.class)
public void assertNewInstanceWithInvalidConfiguration() {
- ShardingSphereAlgorithmConfiguration encryptAlgorithmConfig = new ShardingSphereAlgorithmConfiguration("TEST", new Properties());
+ ShardingSphereAlgorithmConfiguration encryptAlgorithmConfig = new ShardingSphereAlgorithmConfiguration("CORE.FIXTURE", new Properties());
EncryptColumnRuleConfiguration encryptColumnConfig = new EncryptColumnRuleConfiguration("encrypt_column", "encrypt_cipher", "", "", "test_encryptor");
EncryptTableRuleConfiguration tableConfig = new EncryptTableRuleConfiguration("t_encrypt", Collections.singletonList(encryptColumnConfig), null);
EncryptRuleConfiguration ruleConfig = new EncryptRuleConfiguration(Collections.singleton(tableConfig), ImmutableMap.of("invalid_encryptor", encryptAlgorithmConfig));
@@ -71,7 +71,7 @@ public final class EncryptRuleTest {
EncryptColumnRuleConfiguration encryptColumnConfig = new EncryptColumnRuleConfiguration("encrypt_column", "encrypt_cipher", "", "", "test_encryptor");
EncryptTableRuleConfiguration tableConfig = new EncryptTableRuleConfiguration("t_encrypt", Collections.singletonList(encryptColumnConfig), null);
AlgorithmProvidedEncryptRuleConfiguration ruleConfig = new AlgorithmProvidedEncryptRuleConfiguration(
- Collections.singleton(tableConfig), ImmutableMap.of("invalid_encryptor", new TestEncryptAlgorithm()), true);
+ Collections.singleton(tableConfig), ImmutableMap.of("invalid_encryptor", new CoreEncryptAlgorithmFixture()), true);
new EncryptRule(ruleConfig, Collections.emptyMap());
}
@@ -145,7 +145,7 @@ public final class EncryptRuleTest {
EncryptColumnRuleConfiguration encryptColumnConfig = new EncryptColumnRuleConfiguration("encrypt_column", "encrypt_cipher", "", "", "test_encryptor");
EncryptTableRuleConfiguration tableConfig = new EncryptTableRuleConfiguration("t_encrypt", Collections.singletonList(encryptColumnConfig), true);
AlgorithmProvidedEncryptRuleConfiguration ruleConfig = new AlgorithmProvidedEncryptRuleConfiguration(
- Collections.singleton(tableConfig), ImmutableMap.of("test_encryptor", new TestEncryptAlgorithm()), true);
+ Collections.singleton(tableConfig), ImmutableMap.of("test_encryptor", new CoreEncryptAlgorithmFixture()), true);
EncryptRule actual = new EncryptRule(ruleConfig, Collections.emptyMap());
assertTrue(actual.isQueryWithCipherColumn("t_encrypt"));
}
@@ -164,7 +164,7 @@ public final class EncryptRuleTest {
public void assertTheSameLogicTable() {
Collection<String> logicTables = new EncryptRule(createEncryptRuleConfiguration(), Collections.emptyMap()).getTables();
Collection<String> theSameLogicTables = new EncryptRule(createEncryptRuleConfigurationWithUpperCaseLogicTable(), Collections.emptyMap()).getTables();
- assertTrue(logicTables.equals(theSameLogicTables));
+ assertThat(logicTables, is(theSameLogicTables));
}
@SuppressWarnings("rawtypes")
@@ -175,15 +175,15 @@ public final class EncryptRuleTest {
encryptRule.setSchemaMetaData("foo_db", Collections.singletonMap("foo_schema", schema));
Optional<EncryptAlgorithm> actual = encryptRule.findEncryptor("t_encrypt", "name");
assertTrue(actual.isPresent());
- assertThat(actual.get(), instanceOf(SchemaMetaDataAwareEncryptAlgorithmFixture.class));
- assertThat(((SchemaMetaDataAwareEncryptAlgorithmFixture) actual.get()).getDatabaseName(), is("foo_db"));
- assertThat(((SchemaMetaDataAwareEncryptAlgorithmFixture) actual.get()).getSchemas(), is(Collections.singletonMap("foo_schema", schema)));
- assertFalse(((SchemaMetaDataAwareEncryptAlgorithmFixture) actual.get()).getSchemas().isEmpty());
+ assertThat(actual.get(), instanceOf(CoreSchemaMetaDataAwareEncryptAlgorithmFixture.class));
+ assertThat(((CoreSchemaMetaDataAwareEncryptAlgorithmFixture) actual.get()).getDatabaseName(), is("foo_db"));
+ assertThat(((CoreSchemaMetaDataAwareEncryptAlgorithmFixture) actual.get()).getSchemas(), is(Collections.singletonMap("foo_schema", schema)));
+ assertFalse(((CoreSchemaMetaDataAwareEncryptAlgorithmFixture) actual.get()).getSchemas().isEmpty());
}
private EncryptRuleConfiguration createEncryptRuleConfiguration() {
- ShardingSphereAlgorithmConfiguration queryAssistedEncryptConfig = new ShardingSphereAlgorithmConfiguration("QUERY_ASSISTED_TEST", new Properties());
- ShardingSphereAlgorithmConfiguration metaDataAwareEncryptConfig = new ShardingSphereAlgorithmConfiguration("METADATA_AWARE.FIXTURE", new Properties());
+ ShardingSphereAlgorithmConfiguration queryAssistedEncryptConfig = new ShardingSphereAlgorithmConfiguration("CORE.QUERY_ASSISTED.FIXTURE", new Properties());
+ ShardingSphereAlgorithmConfiguration metaDataAwareEncryptConfig = new ShardingSphereAlgorithmConfiguration("CORE.METADATA_AWARE.FIXTURE", new Properties());
EncryptColumnRuleConfiguration pwdColumnConfig = new EncryptColumnRuleConfiguration("pwd", "pwd_cipher", "", "pwd_plain", "test_encryptor");
EncryptColumnRuleConfiguration creditCardColumnConfig = new EncryptColumnRuleConfiguration("credit_card", "credit_card_cipher", "", "credit_card_plain", "test_encryptor");
EncryptColumnRuleConfiguration nameColumnConfig = new EncryptColumnRuleConfiguration("name", "name_cipher", "", "name_plain", "customized_encryptor");
@@ -192,8 +192,8 @@ public final class EncryptRuleTest {
}
private EncryptRuleConfiguration createEncryptRuleConfigurationWithUpperCaseLogicTable() {
- ShardingSphereAlgorithmConfiguration queryAssistedEncryptConfig = new ShardingSphereAlgorithmConfiguration("QUERY_ASSISTED_TEST", new Properties());
- ShardingSphereAlgorithmConfiguration metaDataAwareEncryptConfig = new ShardingSphereAlgorithmConfiguration("METADATA_AWARE.FIXTURE", new Properties());
+ ShardingSphereAlgorithmConfiguration queryAssistedEncryptConfig = new ShardingSphereAlgorithmConfiguration("CORE.QUERY_ASSISTED.FIXTURE", new Properties());
+ ShardingSphereAlgorithmConfiguration metaDataAwareEncryptConfig = new ShardingSphereAlgorithmConfiguration("CORE.METADATA_AWARE.FIXTURE", new Properties());
EncryptColumnRuleConfiguration pwdColumnConfig = new EncryptColumnRuleConfiguration("pwd", "pwd_cipher", "", "pwd_plain", "test_encryptor");
EncryptColumnRuleConfiguration creditCardColumnConfig = new EncryptColumnRuleConfiguration("credit_card", "credit_card_cipher", "", "credit_card_plain", "test_encryptor");
EncryptColumnRuleConfiguration nameColumnConfig = new EncryptColumnRuleConfiguration("name", "name_cipher", "", "name_plain", "customized_encryptor");
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/yaml/swapper/EncryptRuleAlgorithmProviderConfigurationYamlSwapperTest.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/yaml/swapper/EncryptRuleAlgorithmProviderConfigurationYamlSwapperTest.java
index bb4e22d2da2..a7bcd3cdcf7 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/yaml/swapper/EncryptRuleAlgorithmProviderConfigurationYamlSwapperTest.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/yaml/swapper/EncryptRuleAlgorithmProviderConfigurationYamlSwapperTest.java
@@ -70,8 +70,8 @@ public final class EncryptRuleAlgorithmProviderConfigurationYamlSwapperTest {
tableRuleConfig.setName("t_encrypt");
result.getTables().put("t_encrypt", tableRuleConfig);
YamlShardingSphereAlgorithmConfiguration algorithmConfig = new YamlShardingSphereAlgorithmConfiguration();
- algorithmConfig.setType("TEST");
- result.getEncryptors().put("test", algorithmConfig);
+ algorithmConfig.setType("CORE.FIXTURE");
+ result.getEncryptors().put("fixture_encryptor", algorithmConfig);
return result;
}
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/yaml/swapper/EncryptRuleConfigurationYamlSwapperTest.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/yaml/swapper/EncryptRuleConfigurationYamlSwapperTest.java
index 0698100f4ab..804ba0c814e 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/yaml/swapper/EncryptRuleConfigurationYamlSwapperTest.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/yaml/swapper/EncryptRuleConfigurationYamlSwapperTest.java
@@ -52,7 +52,7 @@ public final class EncryptRuleConfigurationYamlSwapperTest {
private EncryptRuleConfiguration createEncryptRuleConfiguration() {
Collection<EncryptTableRuleConfiguration> tables = Collections.singletonList(new EncryptTableRuleConfiguration("tbl", Collections.emptyList(), null));
- Map<String, ShardingSphereAlgorithmConfiguration> encryptors = ImmutableMap.of("myEncryptor", new ShardingSphereAlgorithmConfiguration("TEST", new Properties()));
+ Map<String, ShardingSphereAlgorithmConfiguration> encryptors = ImmutableMap.of("myEncryptor", new ShardingSphereAlgorithmConfiguration("FIXTURE", new Properties()));
return new EncryptRuleConfiguration(tables, encryptors);
}
@@ -69,8 +69,8 @@ public final class EncryptRuleConfigurationYamlSwapperTest {
tableRuleConfig.setName("t_encrypt");
result.getTables().put("t_encrypt", tableRuleConfig);
YamlShardingSphereAlgorithmConfiguration algorithmConfig = new YamlShardingSphereAlgorithmConfiguration();
- algorithmConfig.setType("TEST");
- result.getEncryptors().put("test", algorithmConfig);
+ algorithmConfig.setType("CORE.FIXTURE");
+ result.getEncryptors().put("fixture_encryptor", algorithmConfig);
return result;
}
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/resources/META-INF/services/org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/resources/META-INF/services/org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm
index e2a8e2b2f96..3835a84ab01 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/resources/META-INF/services/org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/resources/META-INF/services/org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm
@@ -15,6 +15,6 @@
# limitations under the License.
#
-org.apache.shardingsphere.encrypt.fixture.TestEncryptAlgorithm
-org.apache.shardingsphere.encrypt.fixture.TestQueryAssistedEncryptAlgorithm
-org.apache.shardingsphere.encrypt.fixture.SchemaMetaDataAwareEncryptAlgorithmFixture
+org.apache.shardingsphere.encrypt.fixture.CoreEncryptAlgorithmFixture
+org.apache.shardingsphere.encrypt.fixture.CoreQueryAssistedEncryptAlgorithmFixture
+org.apache.shardingsphere.encrypt.fixture.CoreSchemaMetaDataAwareEncryptAlgorithmFixture
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-distsql/shardingsphere-encrypt-distsql-handler/src/test/java/org/apache/shardingsphere/encrypt/distsql/handler/fixture/TestEncryptAlgorithm.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-distsql/shardingsphere-encrypt-distsql-handler/src/test/java/org/apache/shardingsphere/encrypt/distsql/handler/fixture/TestEncryptAlgorithm.java
deleted file mode 100644
index 1090d1c0fd0..00000000000
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-distsql/shardingsphere-encrypt-distsql-handler/src/test/java/org/apache/shardingsphere/encrypt/distsql/handler/fixture/TestEncryptAlgorithm.java
+++ /dev/null
@@ -1,47 +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.encrypt.distsql.handler.fixture;
-
-import lombok.Getter;
-import lombok.Setter;
-import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm;
-import org.apache.shardingsphere.encrypt.spi.context.EncryptContext;
-
-import java.util.Properties;
-
-public final class TestEncryptAlgorithm implements EncryptAlgorithm<Object, String> {
-
- @Getter
- @Setter
- private Properties props;
-
- @Override
- public String encrypt(final Object plainValue, final EncryptContext encryptContext) {
- return "encryptValue";
- }
-
- @Override
- public Object decrypt(final String cipherValue, final EncryptContext encryptContext) {
- return "decryptValue";
- }
-
- @Override
- public String getType() {
- return "test";
- }
-}
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-distsql/shardingsphere-encrypt-distsql-handler/src/test/resources/services/org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-distsql/shardingsphere-encrypt-distsql-handler/src/test/resources/services/org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm
deleted file mode 100644
index d7ff07c7218..00000000000
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-distsql/shardingsphere-encrypt-distsql-handler/src/test/resources/services/org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm
+++ /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.encrypt.distsql.handler.fixture.TestEncryptAlgorithm
diff --git a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-distsql/shardingsphere-shadow-distsql-handler/src/test/java/org/apache/shardingsphere/shadow/distsql/fixture/HintShadowAlgorithmFixture.java b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-distsql/shardingsphere-shadow-distsql-handler/src/test/java/org/apache/shardingsphere/shadow/distsql/fixture/HintShadowAlgorithmFixture.java
deleted file mode 100644
index 1340faa2129..00000000000
--- a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-distsql/shardingsphere-shadow-distsql-handler/src/test/java/org/apache/shardingsphere/shadow/distsql/fixture/HintShadowAlgorithmFixture.java
+++ /dev/null
@@ -1,36 +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.shadow.distsql.fixture;
-
-import lombok.Getter;
-import lombok.Setter;
-import org.apache.shardingsphere.shadow.spi.ShadowAlgorithm;
-
-import java.util.Properties;
-
-public final class HintShadowAlgorithmFixture implements ShadowAlgorithm {
-
- @Getter
- @Setter
- private Properties props;
-
- @Override
- public String getType() {
- return "HINT_TEST";
- }
-}
diff --git a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-distsql/shardingsphere-shadow-distsql-handler/src/test/java/org/apache/shardingsphere/shadow/distsql/update/CreateShadowAlgorithmStatementUpdaterTest.java b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-distsql/shardingsphere-shadow-distsql-handler/src/test/java/org/apache/shardingsphere/shadow/distsql/update/CreateShadowAlgorithmStatementUpdaterTest.java
index 8e39ff187c4..c1bb71e8a28 100644
--- a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-distsql/shardingsphere-shadow-distsql-handler/src/test/java/org/apache/shardingsphere/shadow/distsql/update/CreateShadowAlgorithmStatementUpdaterTest.java
+++ b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-distsql/shardingsphere-shadow-distsql-handler/src/test/java/org/apache/shardingsphere/shadow/distsql/update/CreateShadowAlgorithmStatementUpdaterTest.java
@@ -50,35 +50,35 @@ public final class CreateShadowAlgorithmStatementUpdaterTest {
@Test(expected = DuplicateRuleException.class)
public void assertExecuteWithDuplicateAlgorithm() throws DistSQLException {
- Properties prop = new Properties();
- prop.setProperty("type", "value");
- CreateShadowAlgorithmStatement sqlStatement = createSQLStatement(new ShadowAlgorithmSegment("simpleNoteAlgorithm", new AlgorithmSegment("SIMPLE_HINT", prop)),
- new ShadowAlgorithmSegment("simpleNoteAlgorithm", new AlgorithmSegment("SIMPLE_HINT", prop)));
+ Properties props = new Properties();
+ props.setProperty("type", "value");
+ CreateShadowAlgorithmStatement sqlStatement = createSQLStatement(new ShadowAlgorithmSegment("foo_algorithm", new AlgorithmSegment("SIMPLE_HINT", props)),
+ new ShadowAlgorithmSegment("foo_algorithm", new AlgorithmSegment("SIMPLE_HINT", props)));
updater.checkSQLStatement(shardingSphereMetaData, sqlStatement, currentConfig);
}
@Test(expected = DuplicateRuleException.class)
public void assertExecuteWithExistAlgorithm() throws DistSQLException {
- when(currentConfig.getShadowAlgorithms()).thenReturn(Collections.singletonMap("simpleNoteAlgorithm", null));
- Properties prop = new Properties();
- prop.setProperty("type", "value");
- CreateShadowAlgorithmStatement sqlStatement = createSQLStatement(new ShadowAlgorithmSegment("simpleNoteAlgorithm", new AlgorithmSegment("SIMPLE_HINT", prop)));
+ when(currentConfig.getShadowAlgorithms()).thenReturn(Collections.singletonMap("foo_algorithm", null));
+ Properties props = new Properties();
+ props.setProperty("type", "value");
+ CreateShadowAlgorithmStatement sqlStatement = createSQLStatement(new ShadowAlgorithmSegment("foo_algorithm", new AlgorithmSegment("SIMPLE_HINT", props)));
updater.checkSQLStatement(shardingSphereMetaData, sqlStatement, currentConfig);
}
@Test(expected = InvalidAlgorithmConfigurationException.class)
public void assertExecuteWithAlgorithmCompleteness() throws DistSQLException {
- Properties prop = new Properties();
- prop.setProperty("type", "value");
- CreateShadowAlgorithmStatement sqlStatement = createSQLStatement(new ShadowAlgorithmSegment("simpleNoteAlgorithm1", new AlgorithmSegment("", prop)));
+ Properties props = new Properties();
+ props.setProperty("type", "value");
+ CreateShadowAlgorithmStatement sqlStatement = createSQLStatement(new ShadowAlgorithmSegment("foo_algorithm", new AlgorithmSegment("", props)));
updater.checkSQLStatement(shardingSphereMetaData, sqlStatement, currentConfig);
}
@Test(expected = InvalidAlgorithmConfigurationException.class)
public void assertExecuteWithInvalidAlgorithmType() throws DistSQLException {
- Properties prop = new Properties();
- prop.setProperty("type", "value");
- CreateShadowAlgorithmStatement sqlStatement = createSQLStatement(new ShadowAlgorithmSegment("simpleNoteAlgorithm1", new AlgorithmSegment("HINT_TEST_1", prop)));
+ Properties props = new Properties();
+ props.setProperty("type", "value");
+ CreateShadowAlgorithmStatement sqlStatement = createSQLStatement(new ShadowAlgorithmSegment("foo_algorithm", new AlgorithmSegment("NOT_EXISTED_ALGORITHM", props)));
updater.checkSQLStatement(shardingSphereMetaData, sqlStatement, currentConfig);
}
diff --git a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-distsql/shardingsphere-shadow-distsql-handler/src/test/resources/META-INF/services/org.apache.shardingsphere.shadow.spi.ShadowAlgorithm b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-distsql/shardingsphere-shadow-distsql-handler/src/test/resources/META-INF/services/org.apache.shardingsphere.shadow.spi.ShadowAlgorithm
deleted file mode 100644
index e034626eb51..00000000000
--- a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-distsql/shardingsphere-shadow-distsql-handler/src/test/resources/META-INF/services/org.apache.shardingsphere.shadow.spi.ShadowAlgorithm
+++ /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.shadow.distsql.fixture.HintShadowAlgorithmFixture
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/fixture/ComplexKeysShardingAlgorithmFixture.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/fixture/CoreComplexKeysShardingAlgorithmFixture.java
similarity index 89%
rename from shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/fixture/ComplexKeysShardingAlgorithmFixture.java
rename to shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/fixture/CoreComplexKeysShardingAlgorithmFixture.java
index f350b501882..5e730ac0921 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/fixture/ComplexKeysShardingAlgorithmFixture.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/fixture/CoreComplexKeysShardingAlgorithmFixture.java
@@ -22,7 +22,7 @@ import org.apache.shardingsphere.sharding.api.sharding.complex.ComplexKeysShardi
import java.util.Collection;
-public final class ComplexKeysShardingAlgorithmFixture implements ComplexKeysShardingAlgorithm<Integer> {
+public final class CoreComplexKeysShardingAlgorithmFixture implements ComplexKeysShardingAlgorithm<Integer> {
@Override
public Collection<String> doSharding(final Collection<String> availableTargetNames, final ComplexKeysShardingValue<Integer> shardingValue) {
@@ -31,6 +31,6 @@ public final class ComplexKeysShardingAlgorithmFixture implements ComplexKeysSha
@Override
public String getType() {
- return "COMPLEX.FIXTURE";
+ return "CORE.COMPLEX.FIXTURE";
}
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/fixture/HintShardingAlgorithmFixture.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/fixture/CoreHintShardingAlgorithmFixture.java
similarity index 92%
rename from shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/fixture/HintShardingAlgorithmFixture.java
rename to shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/fixture/CoreHintShardingAlgorithmFixture.java
index 09ff119c64f..f959d19157c 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/fixture/HintShardingAlgorithmFixture.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/fixture/CoreHintShardingAlgorithmFixture.java
@@ -23,7 +23,7 @@ import org.apache.shardingsphere.sharding.api.sharding.hint.HintShardingValue;
import java.util.Collection;
import java.util.Collections;
-public final class HintShardingAlgorithmFixture implements HintShardingAlgorithm<Integer> {
+public final class CoreHintShardingAlgorithmFixture implements HintShardingAlgorithm<Integer> {
@Override
public Collection<String> doSharding(final Collection<String> availableTargetNames, final HintShardingValue<Integer> shardingValue) {
@@ -37,6 +37,6 @@ public final class HintShardingAlgorithmFixture implements HintShardingAlgorithm
@Override
public String getType() {
- return "HINT.FIXTURE";
+ return "CORE.HINT.FIXTURE";
}
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/fixture/StandardShardingAlgorithmFixture.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/fixture/CoreStandardShardingAlgorithmFixture.java
similarity index 93%
rename from shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/fixture/StandardShardingAlgorithmFixture.java
rename to shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/fixture/CoreStandardShardingAlgorithmFixture.java
index a1f4c4cd0be..44228b8c2eb 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/fixture/StandardShardingAlgorithmFixture.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/fixture/CoreStandardShardingAlgorithmFixture.java
@@ -24,7 +24,7 @@ import org.apache.shardingsphere.sharding.api.sharding.standard.StandardSharding
import java.util.Collection;
import java.util.HashSet;
-public final class StandardShardingAlgorithmFixture implements StandardShardingAlgorithm<Integer> {
+public final class CoreStandardShardingAlgorithmFixture implements StandardShardingAlgorithm<Integer> {
@Override
public String doSharding(final Collection<String> availableTargetNames, final PreciseShardingValue<Integer> shardingValue) {
@@ -51,6 +51,6 @@ public final class StandardShardingAlgorithmFixture implements StandardShardingA
@Override
public String getType() {
- return "STANDARD.FIXTURE";
+ return "CORE.STANDARD.FIXTURE";
}
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/fixture/AbstractRoutingEngineTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/fixture/AbstractRoutingEngineTest.java
index 00ced65eae9..de4435046e2 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/fixture/AbstractRoutingEngineTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/fixture/AbstractRoutingEngineTest.java
@@ -112,17 +112,17 @@ public abstract class AbstractRoutingEngineTest {
protected final ShardingRule createHintShardingRule() {
ShardingRuleConfiguration shardingRuleConfig = new ShardingRuleConfiguration();
shardingRuleConfig.getTables().add(createTableRuleWithHintConfig());
- shardingRuleConfig.getShardingAlgorithms().put("hint_fixture", new ShardingSphereAlgorithmConfiguration("HINT.FIXTURE", new Properties()));
+ shardingRuleConfig.getShardingAlgorithms().put("core_hint_fixture", new ShardingSphereAlgorithmConfiguration("CORE.HINT.FIXTURE", new Properties()));
return new ShardingRule(shardingRuleConfig, createDataSourceNames());
}
protected final ShardingRule createMixedShardingRule() {
ShardingRuleConfiguration shardingRuleConfig = new ShardingRuleConfiguration();
shardingRuleConfig.getTables().add(createTableRuleConfig("t_hint_ds_test", "ds_${0..1}.t_hint_ds_test_${0..1}",
- new HintShardingStrategyConfiguration("hint_fixture"), createStandardShardingStrategyConfiguration("t_hint_ds_test_inline", "t_hint_ds_test_${order_id % 2}")));
+ new HintShardingStrategyConfiguration("core_hint_fixture"), createStandardShardingStrategyConfiguration("t_hint_ds_test_inline", "t_hint_ds_test_${order_id % 2}")));
shardingRuleConfig.getTables().add(createTableRuleConfig("t_hint_table_test", "ds_${0..1}.t_hint_table_test_${0..1}",
- createStandardShardingStrategyConfiguration("ds_inline", "ds_${user_id % 2}"), new HintShardingStrategyConfiguration("hint_fixture")));
- shardingRuleConfig.getShardingAlgorithms().put("hint_fixture", new ShardingSphereAlgorithmConfiguration("HINT.FIXTURE", new Properties()));
+ createStandardShardingStrategyConfiguration("ds_inline", "ds_${user_id % 2}"), new HintShardingStrategyConfiguration("core_hint_fixture")));
+ shardingRuleConfig.getShardingAlgorithms().put("core_hint_fixture", new ShardingSphereAlgorithmConfiguration("CORE.HINT.FIXTURE", new Properties()));
Properties props0 = new Properties();
props0.setProperty("algorithm-expression", "ds_${user_id % 2}");
shardingRuleConfig.getShardingAlgorithms().put("ds_inline", new ShardingSphereAlgorithmConfiguration("INLINE", props0));
@@ -153,7 +153,7 @@ public abstract class AbstractRoutingEngineTest {
Properties props3 = new Properties();
props3.setProperty("algorithm-expression", "t_user_${user_id % 2}");
shardingRuleConfig.getShardingAlgorithms().put("t_user_inline", new ShardingSphereAlgorithmConfiguration("INLINE", props3));
- shardingRuleConfig.getShardingAlgorithms().put("hint_fixture", new ShardingSphereAlgorithmConfiguration("HINT.FIXTURE", new Properties()));
+ shardingRuleConfig.getShardingAlgorithms().put("core_hint_fixture", new ShardingSphereAlgorithmConfiguration("CORE.HINT.FIXTURE", new Properties()));
return new ShardingRule(shardingRuleConfig, Arrays.asList("ds_0", "ds_1", "main"));
}
@@ -186,8 +186,8 @@ public abstract class AbstractRoutingEngineTest {
private ShardingTableRuleConfiguration createTableRuleWithHintConfig() {
ShardingTableRuleConfiguration result = new ShardingTableRuleConfiguration("t_hint_test", "ds_${0..1}.t_hint_test_${0..1}");
- result.setTableShardingStrategy(new HintShardingStrategyConfiguration("hint_fixture"));
- result.setDatabaseShardingStrategy(new HintShardingStrategyConfiguration("hint_fixture"));
+ result.setTableShardingStrategy(new HintShardingStrategyConfiguration("core_hint_fixture"));
+ result.setDatabaseShardingStrategy(new HintShardingStrategyConfiguration("core_hint_fixture"));
return result;
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/strategy/ShardingStrategyFactoryTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/strategy/ShardingStrategyFactoryTest.java
index 98834487e9a..4217f7cb018 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/strategy/ShardingStrategyFactoryTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/strategy/ShardingStrategyFactoryTest.java
@@ -20,9 +20,9 @@ package org.apache.shardingsphere.sharding.route.strategy;
import org.apache.shardingsphere.sharding.api.config.strategy.sharding.ComplexShardingStrategyConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.sharding.HintShardingStrategyConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.sharding.StandardShardingStrategyConfiguration;
-import org.apache.shardingsphere.sharding.fixture.ComplexKeysShardingAlgorithmFixture;
-import org.apache.shardingsphere.sharding.fixture.HintShardingAlgorithmFixture;
-import org.apache.shardingsphere.sharding.fixture.StandardShardingAlgorithmFixture;
+import org.apache.shardingsphere.sharding.fixture.CoreComplexKeysShardingAlgorithmFixture;
+import org.apache.shardingsphere.sharding.fixture.CoreHintShardingAlgorithmFixture;
+import org.apache.shardingsphere.sharding.fixture.CoreStandardShardingAlgorithmFixture;
import org.apache.shardingsphere.sharding.route.strategy.type.complex.ComplexShardingStrategy;
import org.apache.shardingsphere.sharding.route.strategy.type.hint.HintShardingStrategy;
import org.apache.shardingsphere.sharding.route.strategy.type.none.NoneShardingStrategy;
@@ -43,19 +43,19 @@ public final class ShardingStrategyFactoryTest {
private StandardShardingStrategyConfiguration standardShardingStrategyConfig;
@Mock
- private StandardShardingAlgorithmFixture standardShardingAlgorithmFixture;
+ private CoreStandardShardingAlgorithmFixture standardShardingAlgorithmFixture;
@Mock
private ComplexShardingStrategyConfiguration complexShardingStrategyConfig;
@Mock
- private ComplexKeysShardingAlgorithmFixture complexKeysShardingAlgorithmFixture;
+ private CoreComplexKeysShardingAlgorithmFixture complexKeysShardingAlgorithmFixture;
@Mock
private HintShardingStrategyConfiguration hintShardingStrategyConfig;
@Mock
- private HintShardingAlgorithmFixture hintShardingAlgorithmFixture;
+ private CoreHintShardingAlgorithmFixture hintShardingAlgorithmFixture;
@Test
public void assertNewInstance() {
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/strategy/ShardingStrategyTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/strategy/ShardingStrategyTest.java
index 099ec0d1ca1..5c1c9d2de92 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/strategy/ShardingStrategyTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/strategy/ShardingStrategyTest.java
@@ -20,8 +20,8 @@ package org.apache.shardingsphere.sharding.route.strategy;
import com.google.common.collect.Range;
import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.datanode.DataNodeInfo;
-import org.apache.shardingsphere.sharding.fixture.ComplexKeysShardingAlgorithmFixture;
-import org.apache.shardingsphere.sharding.fixture.StandardShardingAlgorithmFixture;
+import org.apache.shardingsphere.sharding.fixture.CoreComplexKeysShardingAlgorithmFixture;
+import org.apache.shardingsphere.sharding.fixture.CoreStandardShardingAlgorithmFixture;
import org.apache.shardingsphere.sharding.route.engine.condition.value.ListShardingConditionValue;
import org.apache.shardingsphere.sharding.route.engine.condition.value.RangeShardingConditionValue;
import org.apache.shardingsphere.sharding.route.engine.condition.value.ShardingConditionValue;
@@ -53,7 +53,7 @@ public final class ShardingStrategyTest {
@Test
public void assertDoShardingForBetweenSingleKey() {
- StandardShardingStrategy strategy = new StandardShardingStrategy("column", new StandardShardingAlgorithmFixture());
+ StandardShardingStrategy strategy = new StandardShardingStrategy("column", new CoreStandardShardingAlgorithmFixture());
Collection<ShardingConditionValue> shardingConditionValues = Collections.singleton(new RangeShardingConditionValue<>("column", "logicTable", Range.open(1, 3)));
assertThat(strategy.doSharding(targets, shardingConditionValues, DATA_NODE_INFO, new ConfigurationProperties(new Properties())), is(Collections.singleton("1")));
}
@@ -64,7 +64,7 @@ public final class ShardingStrategyTest {
expected.add("1");
expected.add("2");
expected.add("3");
- ComplexShardingStrategy strategy = new ComplexShardingStrategy("column1, column2", new ComplexKeysShardingAlgorithmFixture());
+ ComplexShardingStrategy strategy = new ComplexShardingStrategy("column1, column2", new CoreComplexKeysShardingAlgorithmFixture());
Collection<ShardingConditionValue> shardingConditionValues = Arrays.asList(
new ListShardingConditionValue<>("column1", "logicTable", Collections.singletonList(1)),
new RangeShardingConditionValue<>("column2", "logicTable", Range.open(1, 3)));
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/strategy/type/complex/ComplexShardingStrategyTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/strategy/type/complex/ComplexShardingStrategyTest.java
index 5a9e1499dda..ca8252f9bff 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/strategy/type/complex/ComplexShardingStrategyTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/strategy/type/complex/ComplexShardingStrategyTest.java
@@ -21,7 +21,7 @@ import com.google.common.collect.Range;
import com.google.common.collect.Sets;
import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.datanode.DataNodeInfo;
-import org.apache.shardingsphere.sharding.fixture.ComplexKeysShardingAlgorithmFixture;
+import org.apache.shardingsphere.sharding.fixture.CoreComplexKeysShardingAlgorithmFixture;
import org.apache.shardingsphere.sharding.route.engine.condition.value.ListShardingConditionValue;
import org.apache.shardingsphere.sharding.route.engine.condition.value.RangeShardingConditionValue;
import org.apache.shardingsphere.sharding.route.engine.condition.value.ShardingConditionValue;
@@ -43,7 +43,7 @@ public final class ComplexShardingStrategyTest {
@Test
public void assertDoSharding() {
Collection<String> targets = Sets.newHashSet("1", "2", "3");
- ComplexShardingStrategy complexShardingStrategy = new ComplexShardingStrategy("column1, column2", new ComplexKeysShardingAlgorithmFixture());
+ ComplexShardingStrategy complexShardingStrategy = new ComplexShardingStrategy("column1, column2", new CoreComplexKeysShardingAlgorithmFixture());
List<ShardingConditionValue> shardingConditionValues =
Arrays.asList(new ListShardingConditionValue<>("column1", "logicTable", Collections.singletonList(1)), new RangeShardingConditionValue<>("column2", "logicTable", Range.open(1, 3)));
Collection<String> actualSharding = complexShardingStrategy.doSharding(targets, shardingConditionValues, DATA_NODE_INFO, new ConfigurationProperties(new Properties()));
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/strategy/type/hint/HintShardingStrategyTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/strategy/type/hint/HintShardingStrategyTest.java
index afc29859299..f60635483c5 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/strategy/type/hint/HintShardingStrategyTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/strategy/type/hint/HintShardingStrategyTest.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.sharding.route.strategy.type.hint;
import com.google.common.collect.Sets;
import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.datanode.DataNodeInfo;
-import org.apache.shardingsphere.sharding.fixture.HintShardingAlgorithmFixture;
+import org.apache.shardingsphere.sharding.fixture.CoreHintShardingAlgorithmFixture;
import org.apache.shardingsphere.sharding.route.engine.condition.value.ListShardingConditionValue;
import org.junit.Test;
@@ -36,7 +36,7 @@ public final class HintShardingStrategyTest {
@Test
public void assertDoSharding() {
Collection<String> targets = Sets.newHashSet("1", "2", "3");
- HintShardingStrategy hintShardingStrategy = new HintShardingStrategy(new HintShardingAlgorithmFixture());
+ HintShardingStrategy hintShardingStrategy = new HintShardingStrategy(new CoreHintShardingAlgorithmFixture());
DataNodeInfo dataNodeInfo = new DataNodeInfo("logicTable_", 1, '0');
Collection<String> actualSharding = hintShardingStrategy.doSharding(targets, Collections.singletonList(
new ListShardingConditionValue<>("column", "logicTable", Collections.singletonList(1))), dataNodeInfo, new ConfigurationProperties(new Properties()));
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/strategy/type/standard/StandardShardingStrategyTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/strategy/type/standard/StandardShardingStrategyTest.java
index df391062125..d13fa16de9f 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/strategy/type/standard/StandardShardingStrategyTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/strategy/type/standard/StandardShardingStrategyTest.java
@@ -21,7 +21,7 @@ import com.google.common.collect.Range;
import com.google.common.collect.Sets;
import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.datanode.DataNodeInfo;
-import org.apache.shardingsphere.sharding.fixture.StandardShardingAlgorithmFixture;
+import org.apache.shardingsphere.sharding.fixture.CoreStandardShardingAlgorithmFixture;
import org.apache.shardingsphere.sharding.route.engine.condition.value.ListShardingConditionValue;
import org.apache.shardingsphere.sharding.route.engine.condition.value.RangeShardingConditionValue;
import org.junit.Before;
@@ -44,7 +44,7 @@ public final class StandardShardingStrategyTest {
@Before
public void setUp() {
- standardShardingStrategy = new StandardShardingStrategy("column", new StandardShardingAlgorithmFixture());
+ standardShardingStrategy = new StandardShardingStrategy("column", new CoreStandardShardingAlgorithmFixture());
dataNodeSegment = new DataNodeInfo("logicTable_", 1, '0');
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rule/ShardingRuleTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rule/ShardingRuleTest.java
index da21023332f..ea419716ce3 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rule/ShardingRuleTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rule/ShardingRuleTest.java
@@ -229,8 +229,8 @@ public final class ShardingRuleTest {
public void assertFindShardingColumnForDefaultDatabaseShardingStrategy() {
ShardingRuleConfiguration shardingRuleConfig = new ShardingRuleConfiguration();
shardingRuleConfig.getTables().add(createTableRuleConfigWithAllStrategies());
- shardingRuleConfig.setDefaultDatabaseShardingStrategy(new StandardShardingStrategyConfiguration("column", "STANDARD.FIXTURE"));
- shardingRuleConfig.getShardingAlgorithms().put("standard", new ShardingSphereAlgorithmConfiguration("STANDARD.FIXTURE", new Properties()));
+ shardingRuleConfig.setDefaultDatabaseShardingStrategy(new StandardShardingStrategyConfiguration("column", "CORE.STANDARD.FIXTURE"));
+ shardingRuleConfig.getShardingAlgorithms().put("core_standard_fixture", new ShardingSphereAlgorithmConfiguration("CORE.STANDARD.FIXTURE", new Properties()));
Optional<String> actual = new ShardingRule(shardingRuleConfig, createDataSourceNames()).findShardingColumn("column", "LOGIC_TABLE");
assertTrue(actual.isPresent());
assertThat(actual.get(), is("column"));
@@ -240,8 +240,8 @@ public final class ShardingRuleTest {
public void assertFindShardingColumnForDefaultTableShardingStrategy() {
ShardingRuleConfiguration shardingRuleConfig = new ShardingRuleConfiguration();
shardingRuleConfig.getTables().add(createTableRuleConfigWithAllStrategies());
- shardingRuleConfig.setDefaultTableShardingStrategy(new StandardShardingStrategyConfiguration("column", "standard_fixture"));
- shardingRuleConfig.getShardingAlgorithms().put("standard", new ShardingSphereAlgorithmConfiguration("STANDARD.FIXTURE", new Properties()));
+ shardingRuleConfig.setDefaultTableShardingStrategy(new StandardShardingStrategyConfiguration("column", "core_standard_fixture"));
+ shardingRuleConfig.getShardingAlgorithms().put("core_standard_fixture", new ShardingSphereAlgorithmConfiguration("CORE.STANDARD.FIXTURE", new Properties()));
Optional<String> actual = new ShardingRule(shardingRuleConfig, createDataSourceNames()).findShardingColumn("column", "LOGIC_TABLE");
assertTrue(actual.isPresent());
assertThat(actual.get(), is("column"));
@@ -251,7 +251,7 @@ public final class ShardingRuleTest {
public void assertFindShardingColumnForDatabaseShardingStrategy() {
ShardingRuleConfiguration shardingRuleConfig = new ShardingRuleConfiguration();
shardingRuleConfig.getTables().add(createTableRuleConfigWithAllStrategies());
- shardingRuleConfig.getShardingAlgorithms().put("standard", new ShardingSphereAlgorithmConfiguration("STANDARD.FIXTURE", new Properties()));
+ shardingRuleConfig.getShardingAlgorithms().put("core_standard_fixture", new ShardingSphereAlgorithmConfiguration("CORE.STANDARD.FIXTURE", new Properties()));
Optional<String> actual = new ShardingRule(shardingRuleConfig, createDataSourceNames()).findShardingColumn("column", "logic_Table");
assertTrue(actual.isPresent());
assertThat(actual.get(), is("column"));
@@ -261,7 +261,7 @@ public final class ShardingRuleTest {
public void assertFindShardingColumnForTableShardingStrategy() {
ShardingRuleConfiguration shardingRuleConfig = new ShardingRuleConfiguration();
shardingRuleConfig.getTables().add(createTableRuleConfigWithTableStrategies());
- shardingRuleConfig.getShardingAlgorithms().put("standard", new ShardingSphereAlgorithmConfiguration("STANDARD.FIXTURE", new Properties()));
+ shardingRuleConfig.getShardingAlgorithms().put("core_standard_fixture", new ShardingSphereAlgorithmConfiguration("CORE.STANDARD.FIXTURE", new Properties()));
Optional<String> actual = new ShardingRule(shardingRuleConfig, createDataSourceNames()).findShardingColumn("column", "logic_Table");
assertTrue(actual.isPresent());
assertThat(actual.get(), is("column"));
@@ -490,7 +490,7 @@ public final class ShardingRuleTest {
shardingRuleConfig.setDefaultTableShardingStrategy(new StandardShardingStrategyConfiguration("table_id", "standard"));
shardingRuleConfig.setDefaultShardingColumn("table_id");
shardingRuleConfig.setDefaultKeyGenerateStrategy(new KeyGenerateStrategyConfiguration("id", "default"));
- shardingRuleConfig.getShardingAlgorithms().put("standard", new ShardingSphereAlgorithmConfiguration("STANDARD.FIXTURE", new Properties()));
+ shardingRuleConfig.getShardingAlgorithms().put("core_standard_fixture", new ShardingSphereAlgorithmConfiguration("CORE.STANDARD.FIXTURE", new Properties()));
shardingRuleConfig.getKeyGenerators().put("uuid", new ShardingSphereAlgorithmConfiguration("UUID", new Properties()));
shardingRuleConfig.getKeyGenerators().put("default", new ShardingSphereAlgorithmConfiguration("UUID", new Properties()));
return new ShardingRule(shardingRuleConfig, createDataSourceNames());
@@ -538,7 +538,7 @@ public final class ShardingRuleTest {
private ShardingTableRuleConfiguration createTableRuleConfigWithComplexStrategies() {
ShardingTableRuleConfiguration result = new ShardingTableRuleConfiguration("LOGIC_TABLE", "ds_${0..1}.table_${0..2}");
- result.setDatabaseShardingStrategy(new ComplexShardingStrategyConfiguration("COLUMN1,COLUMN2", "COMPLEX.FIXTURE"));
+ result.setDatabaseShardingStrategy(new ComplexShardingStrategyConfiguration("COLUMN1,COLUMN2", "CORE.COMPLEX.FIXTURE"));
result.setTableShardingStrategy(new NoneShardingStrategyConfiguration());
return result;
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/swapper/YamlRootRuleConfigurationsForYamlShardingRuleConfigurationTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/swapper/YamlRootRuleConfigurationsForYamlShardingRuleConfigurationTest.java
index f04043bd0fb..d311c40376f 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/swapper/YamlRootRuleConfigurationsForYamlShardingRuleConfigurationTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/swapper/YamlRootRuleConfigurationsForYamlShardingRuleConfigurationTest.java
@@ -86,15 +86,15 @@ public final class YamlRootRuleConfigurationsForYamlShardingRuleConfigurationTes
private void assertTUser(final YamlShardingRuleConfiguration actual) {
assertThat(actual.getTables().get("t_user").getActualDataNodes(), is("ds_${0..1}.t_user_${0..15}"));
assertThat(actual.getTables().get("t_user").getDatabaseStrategy().getComplex().getShardingColumns(), is("region_id, user_id"));
- assertThat(actual.getTables().get("t_user").getDatabaseStrategy().getComplex().getShardingAlgorithmName(), is("complex_fixture"));
+ assertThat(actual.getTables().get("t_user").getDatabaseStrategy().getComplex().getShardingAlgorithmName(), is("core_complex_fixture"));
assertThat(actual.getTables().get("t_user").getTableStrategy().getComplex().getShardingColumns(), is("region_id, user_id"));
- assertThat(actual.getTables().get("t_user").getTableStrategy().getComplex().getShardingAlgorithmName(), is("complex_fixture"));
+ assertThat(actual.getTables().get("t_user").getTableStrategy().getComplex().getShardingAlgorithmName(), is("core_complex_fixture"));
}
private void assertTStock(final YamlShardingRuleConfiguration actual) {
assertThat(actual.getTables().get("t_stock").getActualDataNodes(), is("ds_${0..1}.t_stock{0..8}"));
- assertThat(actual.getTables().get("t_stock").getDatabaseStrategy().getHint().getShardingAlgorithmName(), is("hint_fixture"));
- assertThat(actual.getTables().get("t_stock").getTableStrategy().getHint().getShardingAlgorithmName(), is("hint_fixture"));
+ assertThat(actual.getTables().get("t_stock").getDatabaseStrategy().getHint().getShardingAlgorithmName(), is("core_hint_fixture"));
+ assertThat(actual.getTables().get("t_stock").getTableStrategy().getHint().getShardingAlgorithmName(), is("core_hint_fixture"));
}
private void assertTOrder(final YamlShardingRuleConfiguration actual) {
@@ -108,8 +108,8 @@ public final class YamlRootRuleConfigurationsForYamlShardingRuleConfigurationTes
private void assertTOrderItem(final YamlShardingRuleConfiguration actual) {
assertThat(actual.getTables().get("t_order_item").getActualDataNodes(), is("ds_${0..1}.t_order_item_${0..1}"));
assertThat(actual.getTables().get("t_order_item").getTableStrategy().getStandard().getShardingColumn(), is("order_id"));
- assertThat(actual.getTables().get("t_order_item").getTableStrategy().getStandard().getShardingAlgorithmName(), is("standard_fixture"));
- assertThat(actual.getTables().get("t_order_item").getTableStrategy().getStandard().getShardingAlgorithmName(), is("standard_fixture"));
+ assertThat(actual.getTables().get("t_order_item").getTableStrategy().getStandard().getShardingAlgorithmName(), is("core_standard_fixture"));
+ assertThat(actual.getTables().get("t_order_item").getTableStrategy().getStandard().getShardingAlgorithmName(), is("core_standard_fixture"));
}
private void assertBindingTable(final YamlShardingRuleConfiguration actual) {
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/swapper/strategy/ShardingStrategyConfigurationYamlSwapperTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/swapper/strategy/ShardingStrategyConfigurationYamlSwapperTest.java
index 24d148653a3..02060774b3b 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/swapper/strategy/ShardingStrategyConfigurationYamlSwapperTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/swapper/strategy/ShardingStrategyConfigurationYamlSwapperTest.java
@@ -63,7 +63,7 @@ public final class ShardingStrategyConfigurationYamlSwapperTest {
@Test
public void assertSwapToYamlWithHint() {
HintShardingAlgorithm hintShardingAlgorithm = mock(HintShardingAlgorithm.class);
- when(hintShardingAlgorithm.getType()).thenReturn("HINT.FIXTURE");
+ when(hintShardingAlgorithm.getType()).thenReturn("CORE.HINT.FIXTURE");
YamlShardingStrategyConfiguration actual = new ShardingStrategyConfigurationYamlSwapper().swapToYamlConfiguration(new HintShardingStrategyConfiguration("hint"));
assertThat(actual.getHint().getShardingAlgorithmName(), is("hint"));
assertNull(actual.getStandard());
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/resources/META-INF/services/org.apache.shardingsphere.sharding.spi.ShardingAlgorithm b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/resources/META-INF/services/org.apache.shardingsphere.sharding.spi.ShardingAlgorithm
index 083e71df007..fb7e2336ab6 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/resources/META-INF/services/org.apache.shardingsphere.sharding.spi.ShardingAlgorithm
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/resources/META-INF/services/org.apache.shardingsphere.sharding.spi.ShardingAlgorithm
@@ -15,6 +15,6 @@
# limitations under the License.
#
-org.apache.shardingsphere.sharding.fixture.ComplexKeysShardingAlgorithmFixture
-org.apache.shardingsphere.sharding.fixture.HintShardingAlgorithmFixture
-org.apache.shardingsphere.sharding.fixture.StandardShardingAlgorithmFixture
+org.apache.shardingsphere.sharding.fixture.CoreComplexKeysShardingAlgorithmFixture
+org.apache.shardingsphere.sharding.fixture.CoreHintShardingAlgorithmFixture
+org.apache.shardingsphere.sharding.fixture.CoreStandardShardingAlgorithmFixture
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/resources/yaml/sharding-rule.yaml b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/resources/yaml/sharding-rule.yaml
index 647c276534b..4c53423fef3 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/resources/yaml/sharding-rule.yaml
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/resources/yaml/sharding-rule.yaml
@@ -31,19 +31,19 @@ rules:
databaseStrategy:
complex:
shardingColumns: region_id, user_id
- shardingAlgorithmName: complex_fixture
+ shardingAlgorithmName: core_complex_fixture
tableStrategy:
complex:
shardingColumns: region_id, user_id
- shardingAlgorithmName: complex_fixture
+ shardingAlgorithmName: core_complex_fixture
t_stock:
actualDataNodes: ds_${0..1}.t_stock{0..8}
databaseStrategy:
hint:
- shardingAlgorithmName: hint_fixture
+ shardingAlgorithmName: core_hint_fixture
tableStrategy:
hint:
- shardingAlgorithmName: hint_fixture
+ shardingAlgorithmName: core_hint_fixture
t_order:
actualDataNodes: ds_${0..1}.t_order_${0..1}
tableStrategy:
@@ -58,7 +58,7 @@ rules:
tableStrategy:
standard:
shardingColumn: order_id
- shardingAlgorithmName: standard_fixture
+ shardingAlgorithmName: core_standard_fixture
bindingTables:
- t_order, t_order_item
broadcastTables:
@@ -72,12 +72,12 @@ rules:
defaultShardingColumn: order_id
shardingAlgorithms:
- standard_fixture:
- type: STANDARD.FIXTURE
- complex_fixture:
- type: COMPLEX.FIXTURE
- hint_fixture:
- type: HINT.FIXTURE
+ core_standard_fixture:
+ type: CORE.STANDARD.FIXTURE
+ core_complex_fixture:
+ type: CORE.COMPLEX.FIXTURE
+ core_hint_fixture:
+ type: CORE.HINT.FIXTURE
database_inline:
type: INLINE
props:
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/fixture/encrypt/TestEncryptAlgorithm.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/fixture/encrypt/JDBCEncryptAlgorithmFixture.java
similarity index 91%
rename from shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/fixture/encrypt/TestEncryptAlgorithm.java
rename to shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/fixture/encrypt/JDBCEncryptAlgorithmFixture.java
index ad0e029a2f2..930f30b8f06 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/fixture/encrypt/TestEncryptAlgorithm.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/fixture/encrypt/JDBCEncryptAlgorithmFixture.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.driver.fixture.encrypt;
import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm;
import org.apache.shardingsphere.encrypt.spi.context.EncryptContext;
-public final class TestEncryptAlgorithm implements EncryptAlgorithm<Object, String> {
+public final class JDBCEncryptAlgorithmFixture implements EncryptAlgorithm<Object, String> {
@Override
public String encrypt(final Object plainValue, final EncryptContext encryptContext) {
@@ -34,6 +34,6 @@ public final class TestEncryptAlgorithm implements EncryptAlgorithm<Object, Stri
@Override
public String getType() {
- return "test";
+ return "JDBC.FIXTURE";
}
}
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/fixture/encrypt/TestQueryAssistedEncryptAlgorithm.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/fixture/encrypt/JDBCQueryAssistedEncryptAlgorithmFixture.java
similarity index 90%
rename from shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/fixture/encrypt/TestQueryAssistedEncryptAlgorithm.java
rename to shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/fixture/encrypt/JDBCQueryAssistedEncryptAlgorithmFixture.java
index df0ec7d8c9d..d4f907724f4 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/fixture/encrypt/TestQueryAssistedEncryptAlgorithm.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/fixture/encrypt/JDBCQueryAssistedEncryptAlgorithmFixture.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.driver.fixture.encrypt;
import org.apache.shardingsphere.encrypt.spi.QueryAssistedEncryptAlgorithm;
import org.apache.shardingsphere.encrypt.spi.context.EncryptContext;
-public final class TestQueryAssistedEncryptAlgorithm implements QueryAssistedEncryptAlgorithm<Object, String> {
+public final class JDBCQueryAssistedEncryptAlgorithmFixture implements QueryAssistedEncryptAlgorithm<Object, String> {
@Override
public String encrypt(final Object plainValue, final EncryptContext encryptContext) {
@@ -39,6 +39,6 @@ public final class TestQueryAssistedEncryptAlgorithm implements QueryAssistedEnc
@Override
public String getType() {
- return "assistedTest";
+ return "JDBC.QUERY_ASSISTED.FIXTURE";
}
}
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/resources/META-INF/services/org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/resources/META-INF/services/org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm
index 8709ba80712..839125dc2b0 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/resources/META-INF/services/org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/resources/META-INF/services/org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm
@@ -15,5 +15,5 @@
# limitations under the License.
#
-org.apache.shardingsphere.driver.fixture.encrypt.TestEncryptAlgorithm
-org.apache.shardingsphere.driver.fixture.encrypt.TestQueryAssistedEncryptAlgorithm
+org.apache.shardingsphere.driver.fixture.encrypt.JDBCEncryptAlgorithmFixture
+org.apache.shardingsphere.driver.fixture.encrypt.JDBCQueryAssistedEncryptAlgorithmFixture
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/resources/config/config-encrypt-query-with-cipher.yaml b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/resources/config/config-encrypt-query-with-cipher.yaml
index 5c700c1c180..a9dc1483b3e 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/resources/config/config-encrypt-query-with-cipher.yaml
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/resources/config/config-encrypt-query-with-cipher.yaml
@@ -25,28 +25,28 @@ rules:
pwd:
plainColumn: plain_pwd
cipherColumn: cipher_pwd
- encryptorName: test
+ encryptorName: jdbc_encryptor_fixture
t_query_encrypt:
columns:
pwd:
cipherColumn: cipher_pwd
assistedQueryColumn: assist_pwd
- encryptorName: assistedTest
+ encryptorName: jdbc_query_assisted_encryptor_fixture
t_encrypt_contains_column:
columns:
plain_pwd:
plainColumn: plain_pwd
cipherColumn: cipher_pwd
- encryptorName: test
+ encryptorName: jdbc_encryptor_fixture
plain_pwd2:
plainColumn: plain_pwd2
cipherColumn: cipher_pwd2
- encryptorName: test
+ encryptorName: jdbc_encryptor_fixture
encryptors:
- test:
- type: test
- assistedTest:
- type: assistedTest
+ jdbc_encryptor_fixture:
+ type: JDBC.FIXTURE
+ jdbc_query_assisted_encryptor_fixture:
+ type: JDBC.QUERY_ASSISTED.FIXTURE
props:
sql-show: true
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/resources/config/config-encrypt-query-with-plain.yaml b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/resources/config/config-encrypt-query-with-plain.yaml
index 179f75a52fc..689a8e38934 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/resources/config/config-encrypt-query-with-plain.yaml
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/resources/config/config-encrypt-query-with-plain.yaml
@@ -25,28 +25,28 @@ rules:
pwd:
plainColumn: plain_pwd
cipherColumn: cipher_pwd
- encryptorName: test
+ encryptorName: jdbc_encryptor_fixture
t_query_encrypt:
columns:
pwd:
cipherColumn: cipher_pwd
assistedQueryColumn: assist_pwd
- encryptorName: assistedTest
+ encryptorName: jdbc_query_assisted_encryptor_fixture
t_encrypt_contains_column:
columns:
plain_pwd:
plainColumn: plain_pwd
cipherColumn: cipher_pwd
- encryptorName: test
+ encryptorName: jdbc_encryptor_fixture
plain_pwd2:
plainColumn: plain_pwd2
cipherColumn: cipher_pwd2
- encryptorName: test
+ encryptorName: jdbc_encryptor_fixture
encryptors:
- test:
- type: test
- assistedTest:
- type: assistedTest
+ jdbc_encryptor_fixture:
+ type: JDBC.FIXTURE
+ jdbc_query_assisted_encryptor_fixture:
+ type: JDBC.QUERY_ASSISTED.FIXTURE
queryWithCipherColumn: false
props:
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/distsql/fixture/TestReplicaLoadBalanceAlgorithm.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/distsql/fixture/TestReplicaLoadBalanceAlgorithm.java
deleted file mode 100644
index c33724a08da..00000000000
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/distsql/fixture/TestReplicaLoadBalanceAlgorithm.java
+++ /dev/null
@@ -1,42 +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.proxy.backend.text.distsql.fixture;
-
-import lombok.Getter;
-import lombok.Setter;
-import org.apache.shardingsphere.readwritesplitting.spi.ReplicaLoadBalanceAlgorithm;
-
-import java.util.List;
-import java.util.Properties;
-
-@Getter
-@Setter
-public final class TestReplicaLoadBalanceAlgorithm implements ReplicaLoadBalanceAlgorithm {
-
- private Properties props = new Properties();
-
- @Override
- public String getDataSource(final String name, final String writeDataSourceName, final List<String> readDataSourceNames) {
- return null;
- }
-
- @Override
- public String getType() {
- return "TEST";
- }
-}
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/resources/META-INF/services/org.apache.shardingsphere.readwritesplitting.spi.ReplicaLoadBalanceAlgorithm b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/resources/META-INF/services/org.apache.shardingsphere.readwritesplitting.spi.ReplicaLoadBalanceAlgorithm
deleted file mode 100644
index 83a536f647d..00000000000
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/resources/META-INF/services/org.apache.shardingsphere.readwritesplitting.spi.ReplicaLoadBalanceAlgorithm
+++ /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.proxy.backend.text.distsql.fixture.TestReplicaLoadBalanceAlgorithm