diff --git a/features/encrypt/distsql/handler/src/test/java/org/apache/shardingsphere/encrypt/distsql/handler/query/EncryptAlgorithmTypeAndClassMapperTest.java b/features/encrypt/distsql/handler/src/test/java/org/apache/shardingsphere/encrypt/distsql/handler/query/EncryptAlgorithmTypeAndClassMapperTest.java new file mode 100644 index 0000000000000..d37218f8a24fc --- /dev/null +++ b/features/encrypt/distsql/handler/src/test/java/org/apache/shardingsphere/encrypt/distsql/handler/query/EncryptAlgorithmTypeAndClassMapperTest.java @@ -0,0 +1,34 @@ +/* + * 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.query; + +import org.apache.shardingsphere.distsql.handler.executor.ral.plugin.PluginTypeAndClassMapper; +import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; +import org.junit.jupiter.api.Test; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; + +class EncryptAlgorithmTypeAndClassMapperTest { + + @Test + void assertGetPluginClass() { + assertThat(TypedSPILoader.getService(PluginTypeAndClassMapper.class, "ENCRYPT_ALGORITHM").getPluginClass(), is(EncryptAlgorithm.class)); + } +} diff --git a/features/mask/distsql/handler/src/test/java/org/apache/shardingsphere/mask/distsql/handler/query/MaskAlgorithmTypeAndClassMapperTest.java b/features/mask/distsql/handler/src/test/java/org/apache/shardingsphere/mask/distsql/handler/query/MaskAlgorithmTypeAndClassMapperTest.java new file mode 100644 index 0000000000000..ed127e1536dcf --- /dev/null +++ b/features/mask/distsql/handler/src/test/java/org/apache/shardingsphere/mask/distsql/handler/query/MaskAlgorithmTypeAndClassMapperTest.java @@ -0,0 +1,34 @@ +/* + * 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.mask.distsql.handler.query; + +import org.apache.shardingsphere.distsql.handler.executor.ral.plugin.PluginTypeAndClassMapper; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; +import org.apache.shardingsphere.mask.spi.MaskAlgorithm; +import org.junit.jupiter.api.Test; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; + +class MaskAlgorithmTypeAndClassMapperTest { + + @Test + void assertGetPluginClass() { + assertThat(TypedSPILoader.getService(PluginTypeAndClassMapper.class, "MASK_ALGORITHM").getPluginClass(), is(MaskAlgorithm.class)); + } +} diff --git a/features/shadow/distsql/handler/src/test/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShadowAlgorithmTypeAndClassMapperTest.java b/features/shadow/distsql/handler/src/test/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShadowAlgorithmTypeAndClassMapperTest.java new file mode 100644 index 0000000000000..ba02a608d89e6 --- /dev/null +++ b/features/shadow/distsql/handler/src/test/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShadowAlgorithmTypeAndClassMapperTest.java @@ -0,0 +1,34 @@ +/* + * 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.handler.query; + +import org.apache.shardingsphere.distsql.handler.executor.ral.plugin.PluginTypeAndClassMapper; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; +import org.apache.shardingsphere.shadow.spi.ShadowAlgorithm; +import org.junit.jupiter.api.Test; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; + +class ShadowAlgorithmTypeAndClassMapperTest { + + @Test + void assertGetPluginClass() { + assertThat(TypedSPILoader.getService(PluginTypeAndClassMapper.class, "SHADOW_ALGORITHM").getPluginClass(), is(ShadowAlgorithm.class)); + } +} diff --git a/features/sharding/distsql/handler/src/test/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShardingAlgorithmTypeAndClassMapperTest.java b/features/sharding/distsql/handler/src/test/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShardingAlgorithmTypeAndClassMapperTest.java new file mode 100644 index 0000000000000..0e48348f6ef19 --- /dev/null +++ b/features/sharding/distsql/handler/src/test/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShardingAlgorithmTypeAndClassMapperTest.java @@ -0,0 +1,34 @@ +/* + * 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.sharding.distsql.handler.query; + +import org.apache.shardingsphere.distsql.handler.executor.ral.plugin.PluginTypeAndClassMapper; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; +import org.apache.shardingsphere.sharding.spi.ShardingAlgorithm; +import org.junit.jupiter.api.Test; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; + +class ShardingAlgorithmTypeAndClassMapperTest { + + @Test + void assertGetPluginClass() { + assertThat(TypedSPILoader.getService(PluginTypeAndClassMapper.class, "SHARDING_ALGORITHM").getPluginClass(), is(ShardingAlgorithm.class)); + } +} diff --git a/infra/distsql-handler/src/test/java/org/apache/shardingsphere/distsql/handler/executor/ral/plugin/type/KeyGenerateAlgorithmTypeAndClassMapperTest.java b/infra/distsql-handler/src/test/java/org/apache/shardingsphere/distsql/handler/executor/ral/plugin/type/KeyGenerateAlgorithmTypeAndClassMapperTest.java new file mode 100644 index 0000000000000..dcc0482f2cefb --- /dev/null +++ b/infra/distsql-handler/src/test/java/org/apache/shardingsphere/distsql/handler/executor/ral/plugin/type/KeyGenerateAlgorithmTypeAndClassMapperTest.java @@ -0,0 +1,34 @@ +/* + * 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.distsql.handler.executor.ral.plugin.type; + +import org.apache.shardingsphere.distsql.handler.executor.ral.plugin.PluginTypeAndClassMapper; +import org.apache.shardingsphere.infra.algorithm.keygen.core.KeyGenerateAlgorithm; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; +import org.junit.jupiter.api.Test; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; + +class KeyGenerateAlgorithmTypeAndClassMapperTest { + + @Test + void assertGetPluginClass() { + assertThat(TypedSPILoader.getService(PluginTypeAndClassMapper.class, "KEY_GENERATE_ALGORITHM").getPluginClass(), is(KeyGenerateAlgorithm.class)); + } +} diff --git a/infra/distsql-handler/src/test/java/org/apache/shardingsphere/distsql/handler/executor/ral/plugin/type/LoadBalanceAlgorithmTypeAndClassMapperTest.java b/infra/distsql-handler/src/test/java/org/apache/shardingsphere/distsql/handler/executor/ral/plugin/type/LoadBalanceAlgorithmTypeAndClassMapperTest.java new file mode 100644 index 0000000000000..81c04396bd817 --- /dev/null +++ b/infra/distsql-handler/src/test/java/org/apache/shardingsphere/distsql/handler/executor/ral/plugin/type/LoadBalanceAlgorithmTypeAndClassMapperTest.java @@ -0,0 +1,34 @@ +/* + * 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.distsql.handler.executor.ral.plugin.type; + +import org.apache.shardingsphere.distsql.handler.executor.ral.plugin.PluginTypeAndClassMapper; +import org.apache.shardingsphere.infra.algorithm.loadbalancer.core.LoadBalanceAlgorithm; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; +import org.junit.jupiter.api.Test; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; + +class LoadBalanceAlgorithmTypeAndClassMapperTest { + + @Test + void assertGetPluginClass() { + assertThat(TypedSPILoader.getService(PluginTypeAndClassMapper.class, "LOAD_BALANCE_ALGORITHM").getPluginClass(), is(LoadBalanceAlgorithm.class)); + } +} diff --git a/kernel/data-pipeline/distsql/handler/src/test/java/org/apache/shardingsphere/data/pipeline/distsql/handler/migration/query/MigrationCheckAlgorithmTypeAndClassMapperTest.java b/kernel/data-pipeline/distsql/handler/src/test/java/org/apache/shardingsphere/data/pipeline/distsql/handler/migration/query/MigrationCheckAlgorithmTypeAndClassMapperTest.java new file mode 100644 index 0000000000000..012166e30630b --- /dev/null +++ b/kernel/data-pipeline/distsql/handler/src/test/java/org/apache/shardingsphere/data/pipeline/distsql/handler/migration/query/MigrationCheckAlgorithmTypeAndClassMapperTest.java @@ -0,0 +1,34 @@ +/* + * 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.data.pipeline.distsql.handler.migration.query; + +import org.apache.shardingsphere.data.pipeline.core.consistencycheck.table.TableDataConsistencyChecker; +import org.apache.shardingsphere.distsql.handler.executor.ral.plugin.PluginTypeAndClassMapper; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; +import org.junit.jupiter.api.Test; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; + +class MigrationCheckAlgorithmTypeAndClassMapperTest { + + @Test + void assertGetPluginClass() { + assertThat(TypedSPILoader.getService(PluginTypeAndClassMapper.class, "MIGRATION_CHECK").getPluginClass(), is(TableDataConsistencyChecker.class)); + } +}