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 539b13ed144 Remove useless CircuitBreakerDataSource (#37513)
539b13ed144 is described below
commit 539b13ed144f5de366b06763efaecf2aefe3e237
Author: Liang Zhang <[email protected]>
AuthorDate: Thu Dec 25 16:19:59 2025 +0800
Remove useless CircuitBreakerDataSource (#37513)
---
.../datasource/CircuitBreakerDataSource.java | 48 ----------------------
.../datasource/CircuitBreakerDataSourceTest.java | 47 ---------------------
2 files changed, 95 deletions(-)
diff --git
a/jdbc/src/main/java/org/apache/shardingsphere/driver/state/circuit/datasource/CircuitBreakerDataSource.java
b/jdbc/src/main/java/org/apache/shardingsphere/driver/state/circuit/datasource/CircuitBreakerDataSource.java
deleted file mode 100644
index 0d93527ba6d..00000000000
---
a/jdbc/src/main/java/org/apache/shardingsphere/driver/state/circuit/datasource/CircuitBreakerDataSource.java
+++ /dev/null
@@ -1,48 +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.driver.state.circuit.datasource;
-
-import org.apache.shardingsphere.driver.jdbc.adapter.AbstractDataSourceAdapter;
-import
org.apache.shardingsphere.driver.state.circuit.connection.CircuitBreakerConnection;
-
-import java.sql.Connection;
-
-/**
- * Circuit breaker datasource.
- */
-public final class CircuitBreakerDataSource extends AbstractDataSourceAdapter {
-
- @Override
- public Connection getConnection() {
- return new CircuitBreakerConnection();
- }
-
- @Override
- public Connection getConnection(final String username, final String
password) {
- return new CircuitBreakerConnection();
- }
-
- @Override
- public int getLoginTimeout() {
- return 0;
- }
-
- @Override
- public void setLoginTimeout(final int seconds) {
- }
-}
diff --git
a/jdbc/src/test/java/org/apache/shardingsphere/driver/state/circuit/datasource/CircuitBreakerDataSourceTest.java
b/jdbc/src/test/java/org/apache/shardingsphere/driver/state/circuit/datasource/CircuitBreakerDataSourceTest.java
deleted file mode 100644
index 45b6bcfda68..00000000000
---
a/jdbc/src/test/java/org/apache/shardingsphere/driver/state/circuit/datasource/CircuitBreakerDataSourceTest.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.driver.state.circuit.datasource;
-
-import
org.apache.shardingsphere.driver.state.circuit.connection.CircuitBreakerConnection;
-import org.junit.jupiter.api.Test;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.isA;
-
-class CircuitBreakerDataSourceTest {
-
- private final CircuitBreakerDataSource dataSource = new
CircuitBreakerDataSource();
-
- @Test
- void assertGetConnection() {
- assertThat(dataSource.getConnection(),
isA(CircuitBreakerConnection.class));
- assertThat(dataSource.getConnection("", ""),
isA(CircuitBreakerConnection.class));
- }
-
- @Test
- void assertGetLoginTimeout() {
- assertThat(dataSource.getLoginTimeout(), is(0));
- }
-
- @Test
- void assertSetLoginTimeout() {
- dataSource.setLoginTimeout(10);
- assertThat(dataSource.getLoginTimeout(), is(0));
- }
-}