This is an automated email from the ASF dual-hosted git repository.
zhonghongsheng 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 00a1342 Remove unused method in JDBCBackendDataSource (#13926)
00a1342 is described below
commit 00a1342fb313c365b3ebcebc9013df857ac18b42
Author: 吴伟杰 <[email protected]>
AuthorDate: Fri Dec 3 23:01:23 2021 +0800
Remove unused method in JDBCBackendDataSource (#13926)
---
.../communication/jdbc/datasource/JDBCBackendDataSource.java | 12 ------------
.../jdbc/datasource/JDBCBackendDataSourceTest.java | 9 +--------
2 files changed, 1 insertion(+), 20 deletions(-)
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/datasource/JDBCBackendDataSource.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/datasource/JDBCBackendDataSource.java
index 706ab8b..40cce43 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/datasource/JDBCBackendDataSource.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/datasource/JDBCBackendDataSource.java
@@ -40,18 +40,6 @@ import java.util.Optional;
public final class JDBCBackendDataSource implements BackendDataSource {
/**
- * Get connection.
- *
- * @param schemaName scheme name
- * @param dataSourceName data source name
- * @return connection
- * @throws SQLException SQL exception
- */
- public Connection getConnection(final String schemaName, final String
dataSourceName) throws SQLException {
- return getConnections(schemaName, dataSourceName, 1,
ConnectionMode.MEMORY_STRICTLY).get(0);
- }
-
- /**
* Get connections.
*
* @param schemaName scheme name
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/datasource/JDBCBackendDataSourceTest.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/datasource/JDBCBackendDataSourceTest.java
index c27e67e..92f5215 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/datasource/JDBCBackendDataSourceTest.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/datasource/JDBCBackendDataSourceTest.java
@@ -22,9 +22,9 @@ import
org.apache.shardingsphere.infra.config.properties.ConfigurationProperties
import org.apache.shardingsphere.infra.database.type.dialect.H2DatabaseType;
import org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine;
import
org.apache.shardingsphere.infra.executor.sql.execute.engine.ConnectionMode;
+import
org.apache.shardingsphere.infra.federation.optimizer.context.OptimizerContext;
import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData;
import
org.apache.shardingsphere.infra.metadata.rule.ShardingSphereRuleMetaData;
-import
org.apache.shardingsphere.infra.federation.optimizer.context.OptimizerContext;
import org.apache.shardingsphere.mode.manager.ContextManager;
import org.apache.shardingsphere.mode.metadata.MetaDataContexts;
import org.apache.shardingsphere.mode.metadata.persist.MetaDataPersistService;
@@ -53,7 +53,6 @@ import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import static org.hamcrest.CoreMatchers.containsString;
-import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
@@ -102,12 +101,6 @@ public final class JDBCBackendDataSourceTest {
}
@Test
- public void assertGetConnectionFixedOne() throws SQLException {
- Connection actual =
ProxyContext.getInstance().getBackendDataSource().getConnection("schema",
String.format(DATA_SOURCE_PATTERN, 1));
- assertThat(actual, instanceOf(Connection.class));
- }
-
- @Test
public void assertGetConnectionsSucceed() throws SQLException {
List<Connection> actual =
ProxyContext.getInstance().getBackendDataSource().getConnections("schema",
String.format(DATA_SOURCE_PATTERN, 1), 5, ConnectionMode.MEMORY_STRICTLY);
assertThat(actual.size(), is(5));