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

zhangliang 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 4cf50a34720 Remove useless DistSQLDatabaseRuleQueryExecutorTest 
(#37141)
4cf50a34720 is described below

commit 4cf50a34720d2d2dc4360c2c4e47afc423411275
Author: Liang Zhang <[email protected]>
AuthorDate: Wed Nov 19 19:58:40 2025 +0800

    Remove useless DistSQLDatabaseRuleQueryExecutorTest (#37141)
---
 .../DistSQLDatabaseRuleQueryExecutorTest.java      | 62 ----------------------
 1 file changed, 62 deletions(-)

diff --git 
a/test/it/distsql/src/main/java/org/apache/shardingsphere/test/it/distsql/handler/engine/query/DistSQLDatabaseRuleQueryExecutorTest.java
 
b/test/it/distsql/src/main/java/org/apache/shardingsphere/test/it/distsql/handler/engine/query/DistSQLDatabaseRuleQueryExecutorTest.java
deleted file mode 100644
index 193a47c1836..00000000000
--- 
a/test/it/distsql/src/main/java/org/apache/shardingsphere/test/it/distsql/handler/engine/query/DistSQLDatabaseRuleQueryExecutorTest.java
+++ /dev/null
@@ -1,62 +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.test.it.distsql.handler.engine.query;
-
-import lombok.RequiredArgsConstructor;
-import 
org.apache.shardingsphere.distsql.handler.engine.DistSQLConnectionContext;
-import 
org.apache.shardingsphere.distsql.handler.engine.query.DistSQLQueryExecuteEngine;
-import org.apache.shardingsphere.distsql.statement.DistSQLStatement;
-import 
org.apache.shardingsphere.infra.config.rule.scope.DatabaseRuleConfiguration;
-import 
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
-import 
org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
-import org.apache.shardingsphere.infra.metadata.database.rule.RuleMetaData;
-import org.apache.shardingsphere.infra.rule.scope.DatabaseRule;
-import org.apache.shardingsphere.mode.manager.ContextManager;
-
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-
-import static 
org.apache.shardingsphere.test.infra.framework.matcher.ShardingSphereAssertionMatchers.deepEqual;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-@RequiredArgsConstructor
-public abstract class DistSQLDatabaseRuleQueryExecutorTest {
-    
-    private final DatabaseRule mockedRule;
-    
-    protected void assertQueryResultRows(final DatabaseRuleConfiguration 
ruleConfig, final DistSQLStatement sqlStatement, final 
Collection<LocalDataQueryResultRow> expected) throws SQLException {
-        DistSQLQueryExecuteEngine engine = new 
DistSQLQueryExecuteEngine(sqlStatement, "foo_db", 
mockContextManager(ruleConfig), mock(DistSQLConnectionContext.class));
-        engine.executeQuery();
-        Collection<LocalDataQueryResultRow> actual = new 
ArrayList<>(engine.getRows());
-        assertThat(actual, deepEqual(new ArrayList<>(expected)));
-    }
-    
-    private ContextManager mockContextManager(final DatabaseRuleConfiguration 
ruleConfig) {
-        ContextManager result = mock(ContextManager.class, RETURNS_DEEP_STUBS);
-        when(mockedRule.getConfiguration()).thenReturn(ruleConfig);
-        ShardingSphereDatabase database = mock(ShardingSphereDatabase.class, 
RETURNS_DEEP_STUBS);
-        when(database.getRuleMetaData()).thenReturn(new 
RuleMetaData(Collections.singleton(mockedRule)));
-        when(result.getDatabase("foo_db")).thenReturn(database);
-        return result;
-    }
-}

Reply via email to