You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by su...@apache.org on 2024/03/18 11:29:11 UTC

(shardingsphere) branch master updated: Use MockedRule instead of FixtureRule (#30533)

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

sunnianjun 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 50fd94e0226 Use MockedRule instead of FixtureRule (#30533)
50fd94e0226 is described below

commit 50fd94e0226d8f443822056e134529ce45d2920d
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Mon Mar 18 19:29:03 2024 +0800

    Use MockedRule instead of FixtureRule (#30533)
---
 .../fixture/FixtureDatabaseRuleCreateExecutor.java | 16 +++++-----
 .../handler/distsql/fixture/FixtureRule.java       | 35 ----------------------
 .../distsql/fixture/FixtureRuleConfiguration.java  | 23 --------------
 3 files changed, 9 insertions(+), 65 deletions(-)

diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/fixture/FixtureDatabaseRuleCreateExecutor.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/fixture/FixtureDatabaseRuleCreateExecutor.java
index c643532a334..008b617ea86 100644
--- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/fixture/FixtureDatabaseRuleCreateExecutor.java
+++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/fixture/FixtureDatabaseRuleCreateExecutor.java
@@ -19,29 +19,31 @@ package org.apache.shardingsphere.proxy.backend.handler.distsql.fixture;
 
 import org.apache.shardingsphere.distsql.handler.engine.update.rdl.rule.spi.database.DatabaseRuleCreateExecutor;
 import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
+import org.apache.shardingsphere.test.fixture.infra.rule.MockedRule;
+import org.apache.shardingsphere.test.fixture.infra.rule.MockedRuleConfiguration;
 
-public final class FixtureDatabaseRuleCreateExecutor implements DatabaseRuleCreateExecutor<CreateFixtureRuleStatement, FixtureRule, FixtureRuleConfiguration> {
+public final class FixtureDatabaseRuleCreateExecutor implements DatabaseRuleCreateExecutor<CreateFixtureRuleStatement, MockedRule, MockedRuleConfiguration> {
     
     @Override
     public void checkBeforeUpdate(final CreateFixtureRuleStatement sqlStatement) {
     }
     
     @Override
-    public FixtureRuleConfiguration buildToBeCreatedRuleConfiguration(final CreateFixtureRuleStatement sqlStatement) {
-        return new FixtureRuleConfiguration();
+    public MockedRuleConfiguration buildToBeCreatedRuleConfiguration(final CreateFixtureRuleStatement sqlStatement) {
+        return new MockedRuleConfiguration("");
     }
     
     @Override
-    public void updateCurrentRuleConfiguration(final FixtureRuleConfiguration currentRuleConfig, final FixtureRuleConfiguration toBeCreatedRuleConfig) {
+    public void updateCurrentRuleConfiguration(final MockedRuleConfiguration currentRuleConfig, final MockedRuleConfiguration toBeCreatedRuleConfig) {
     }
     
     @Override
-    public void setRule(final FixtureRule rule) {
+    public void setRule(final MockedRule rule) {
     }
     
     @Override
-    public Class<FixtureRule> getRuleClass() {
-        return FixtureRule.class;
+    public Class<MockedRule> getRuleClass() {
+        return MockedRule.class;
     }
     
     @Override
diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/fixture/FixtureRule.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/fixture/FixtureRule.java
deleted file mode 100644
index 05cfa879277..00000000000
--- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/fixture/FixtureRule.java
+++ /dev/null
@@ -1,35 +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.handler.distsql.fixture;
-
-import org.apache.shardingsphere.infra.config.rule.RuleConfiguration;
-import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
-import org.apache.shardingsphere.infra.rule.attribute.RuleAttributes;
-
-public final class FixtureRule implements ShardingSphereRule {
-    
-    @Override
-    public RuleConfiguration getConfiguration() {
-        return new FixtureRuleConfiguration();
-    }
-    
-    @Override
-    public RuleAttributes getAttributes() {
-        return new RuleAttributes();
-    }
-}
diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/fixture/FixtureRuleConfiguration.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/fixture/FixtureRuleConfiguration.java
deleted file mode 100644
index 2bd51666d28..00000000000
--- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/fixture/FixtureRuleConfiguration.java
+++ /dev/null
@@ -1,23 +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.handler.distsql.fixture;
-
-import org.apache.shardingsphere.infra.config.rule.function.EnhancedRuleConfiguration;
-
-public final class FixtureRuleConfiguration implements EnhancedRuleConfiguration {
-}