From 8b5a751fe01133caf3c34ff5b8223743d7a53daf Mon Sep 17 00:00:00 2001 From: Qiheng He Date: Tue, 16 Dec 2025 22:53:58 +0800 Subject: [PATCH] Refactor Firebird's nativeTest --- .../optional-plugins/clickhouse/_index.cn.md | 2 +- .../optional-plugins/clickhouse/_index.en.md | 2 +- .../reachability-metadata.json | 24 +++++ pom.xml | 1 + test/native/pom.xml | 6 ++ .../TcFirebirdConnectionPropertiesParser.java | 40 ++++++++ .../{ => type}/TcClickhouseDatabaseType.java | 2 +- .../type/TcFirebirdDatabaseType.java | 46 +++++++++ .../{ => type}/TcPostgreSQLDatabaseType.java | 2 +- .../{ => type}/TcSQLServerDatabaseType.java | 2 +- .../TestcontainersDatabaseType.java | 2 +- .../jdbc/databases/ClickHouseTest.java | 2 - .../natived/jdbc/databases/FirebirdTest.java | 96 ++----------------- ....jdbcurl.parser.ConnectionPropertiesParser | 18 ++++ ....database.connector.core.type.DatabaseType | 7 +- .../yaml/jdbc/databases/clickhouse.yaml | 6 +- .../yaml/jdbc/databases/firebird.yaml | 19 ++-- 17 files changed, 161 insertions(+), 116 deletions(-) create mode 100644 test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/jdbcurl/TcFirebirdConnectionPropertiesParser.java rename test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/{ => type}/TcClickhouseDatabaseType.java (98%) create mode 100644 test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/type/TcFirebirdDatabaseType.java rename test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/{ => type}/TcPostgreSQLDatabaseType.java (98%) rename test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/{ => type}/TcSQLServerDatabaseType.java (98%) rename test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/{ => type}/TestcontainersDatabaseType.java (98%) create mode 100644 test/native/src/test/resources/META-INF/services/org.apache.shardingsphere.database.connector.core.jdbcurl.parser.ConnectionPropertiesParser diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/optional-plugins/clickhouse/_index.cn.md b/docs/document/content/user-manual/shardingsphere-jdbc/optional-plugins/clickhouse/_index.cn.md index 5bd5262cdb81f..8728ff87cddfa 100644 --- a/docs/document/content/user-manual/shardingsphere-jdbc/optional-plugins/clickhouse/_index.cn.md +++ b/docs/document/content/user-manual/shardingsphere-jdbc/optional-plugins/clickhouse/_index.cn.md @@ -43,7 +43,7 @@ ShardingSphere 对 ClickHouse JDBC Driver 的支持位于可选模块中。 ```yaml services: clickhouse-server: - image: clickhouse/clickhouse-server:25.6.5.41 + image: clickhouse/clickhouse-server:25.9.6.117 environment: CLICKHOUSE_SKIP_USER_SETUP: "1" ports: diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/optional-plugins/clickhouse/_index.en.md b/docs/document/content/user-manual/shardingsphere-jdbc/optional-plugins/clickhouse/_index.en.md index 2ca667c6ec040..71999eadf74c1 100644 --- a/docs/document/content/user-manual/shardingsphere-jdbc/optional-plugins/clickhouse/_index.en.md +++ b/docs/document/content/user-manual/shardingsphere-jdbc/optional-plugins/clickhouse/_index.en.md @@ -43,7 +43,7 @@ Write a Docker Compose file to start ClickHouse. ```yaml services: clickhouse-server: - image: clickhouse/clickhouse-server:25.6.5.41 + image: clickhouse/clickhouse-server:25.9.6.117 environment: CLICKHOUSE_SKIP_USER_SETUP: "1" ports: diff --git a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/reachability-metadata.json b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/reachability-metadata.json index 527f97c53635e..01ad295c03e42 100644 --- a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/reachability-metadata.json +++ b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/reachability-metadata.json @@ -11690,6 +11690,18 @@ }, "glob": "current-git-commit.properties" }, + { + "condition": { + "typeReached": "org.apache.shardingsphere.driver.jdbc.core.statement.StatementManager" + }, + "glob": "isc_error_msg.properties" + }, + { + "condition": { + "typeReached": "org.apache.shardingsphere.driver.jdbc.core.statement.StatementManager" + }, + "glob": "isc_error_sqlstates.properties" + }, { "condition": { "typeReached": "org.apache.shardingsphere.transaction.xa.atomikos.manager.AtomikosTransactionManagerProvider" @@ -11702,6 +11714,18 @@ }, "glob": "lib/sqlparser/druid.jar" }, + { + "condition": { + "typeReached": "org.apache.shardingsphere.driver.jdbc.core.statement.StatementManager" + }, + "glob": "org/firebirdsql/jaybird_error_msg.properties" + }, + { + "condition": { + "typeReached": "org.apache.shardingsphere.driver.jdbc.core.statement.StatementManager" + }, + "glob": "org/firebirdsql/jaybird_error_sqlstates.properties" + }, { "condition": { "typeReached": "org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager" diff --git a/pom.xml b/pom.xml index 9b69d2603e8e7..65f1a3486c749 100644 --- a/pom.xml +++ b/pom.xml @@ -136,6 +136,7 @@ 3.0 4.11.0 4.3.0 + 1.6.0 1.9.0 24.1.2 diff --git a/test/native/pom.xml b/test/native/pom.xml index 8061aab15f869..4867e65049d5b 100644 --- a/test/native/pom.xml +++ b/test/native/pom.xml @@ -136,6 +136,12 @@ clickhouse test + + org.firebirdsql + firebird-testcontainers-java + ${firebird-testcontainers-java.version} + test + org.apache.curator curator-test diff --git a/test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/jdbcurl/TcFirebirdConnectionPropertiesParser.java b/test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/jdbcurl/TcFirebirdConnectionPropertiesParser.java new file mode 100644 index 0000000000000..00927a2864baf --- /dev/null +++ b/test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/jdbcurl/TcFirebirdConnectionPropertiesParser.java @@ -0,0 +1,40 @@ +/* + * 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.natived.commons.algorithm.testcontainers.jdbcurl; + +import org.apache.shardingsphere.database.connector.core.jdbcurl.parser.ConnectionProperties; +import org.apache.shardingsphere.database.connector.core.jdbcurl.parser.ConnectionPropertiesParser; +import org.apache.shardingsphere.database.connector.core.jdbcurl.parser.StandardJdbcUrlParser; + +/** + * Connection properties parser of Firebird. + */ +public final class TcFirebirdConnectionPropertiesParser implements ConnectionPropertiesParser { + + private static final int DEFAULT_PORT = 3050; + + @Override + public ConnectionProperties parse(final String url, final String username, final String catalog) { + return new StandardJdbcUrlParser().parse(url, DEFAULT_PORT); + } + + @Override + public String getDatabaseType() { + return "TC-Firebird"; + } +} diff --git a/test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/TcClickhouseDatabaseType.java b/test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/type/TcClickhouseDatabaseType.java similarity index 98% rename from test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/TcClickhouseDatabaseType.java rename to test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/type/TcClickhouseDatabaseType.java index 192a768c4ccf1..20d490f25d925 100644 --- a/test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/TcClickhouseDatabaseType.java +++ b/test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/type/TcClickhouseDatabaseType.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.test.natived.commons.algorithm.testcontainers; +package org.apache.shardingsphere.test.natived.commons.algorithm.testcontainers.type; import org.apache.shardingsphere.database.connector.core.type.DatabaseType; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; diff --git a/test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/type/TcFirebirdDatabaseType.java b/test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/type/TcFirebirdDatabaseType.java new file mode 100644 index 0000000000000..6f2c223c9d999 --- /dev/null +++ b/test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/type/TcFirebirdDatabaseType.java @@ -0,0 +1,46 @@ +/* + * 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.natived.commons.algorithm.testcontainers.type; + +import org.apache.shardingsphere.database.connector.core.type.DatabaseType; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Optional; + +/** + * Database type of Firebird in testcontainers. + */ +public final class TcFirebirdDatabaseType implements TestcontainersDatabaseType { + + @Override + public Collection getJdbcUrlPrefixes() { + return Arrays.asList("jdbc:tc:firebird:", "jdbc:tc:firebirdsql:"); + } + + @Override + public Optional getTrunkDatabaseType() { + return Optional.of(TypedSPILoader.getService(DatabaseType.class, "Firebird")); + } + + @Override + public String getType() { + return "TC-Firebird"; + } +} diff --git a/test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/TcPostgreSQLDatabaseType.java b/test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/type/TcPostgreSQLDatabaseType.java similarity index 98% rename from test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/TcPostgreSQLDatabaseType.java rename to test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/type/TcPostgreSQLDatabaseType.java index c985e66f40288..b69adbbe43da6 100644 --- a/test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/TcPostgreSQLDatabaseType.java +++ b/test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/type/TcPostgreSQLDatabaseType.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.test.natived.commons.algorithm.testcontainers; +package org.apache.shardingsphere.test.natived.commons.algorithm.testcontainers.type; import org.apache.shardingsphere.database.connector.core.type.DatabaseType; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; diff --git a/test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/TcSQLServerDatabaseType.java b/test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/type/TcSQLServerDatabaseType.java similarity index 98% rename from test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/TcSQLServerDatabaseType.java rename to test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/type/TcSQLServerDatabaseType.java index 197e373b0d6dd..39f4daf7c151c 100644 --- a/test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/TcSQLServerDatabaseType.java +++ b/test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/type/TcSQLServerDatabaseType.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.test.natived.commons.algorithm.testcontainers; +package org.apache.shardingsphere.test.natived.commons.algorithm.testcontainers.type; import org.apache.shardingsphere.database.connector.core.type.DatabaseType; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; diff --git a/test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/TestcontainersDatabaseType.java b/test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/type/TestcontainersDatabaseType.java similarity index 98% rename from test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/TestcontainersDatabaseType.java rename to test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/type/TestcontainersDatabaseType.java index 185c99fa87e88..e38d918a2bf96 100644 --- a/test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/TestcontainersDatabaseType.java +++ b/test/native/src/test/java/org/apache/shardingsphere/test/natived/commons/algorithm/testcontainers/type/TestcontainersDatabaseType.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.test.natived.commons.algorithm.testcontainers; +package org.apache.shardingsphere.test.natived.commons.algorithm.testcontainers.type; import org.apache.shardingsphere.database.connector.core.type.DatabaseType; diff --git a/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/databases/ClickHouseTest.java b/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/databases/ClickHouseTest.java index 49761529cdf4b..5eb966f03247d 100644 --- a/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/databases/ClickHouseTest.java +++ b/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/databases/ClickHouseTest.java @@ -25,7 +25,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.EnabledInNativeImage; import org.testcontainers.jdbc.ContainerDatabaseDriver; -import org.testcontainers.junit.jupiter.Testcontainers; import javax.sql.DataSource; import java.sql.SQLException; @@ -33,7 +32,6 @@ import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; @EnabledInNativeImage -@Testcontainers class ClickHouseTest { private DataSource logicDataSource; diff --git a/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/databases/FirebirdTest.java b/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/databases/FirebirdTest.java index 4b25bbde04cba..27e307868a0ea 100644 --- a/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/databases/FirebirdTest.java +++ b/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/databases/FirebirdTest.java @@ -21,71 +21,33 @@ import com.zaxxer.hikari.HikariDataSource; import org.apache.shardingsphere.test.natived.commons.TestShardingService; import org.apache.shardingsphere.test.natived.commons.util.ResourceUtils; -import org.awaitility.Awaitility; -import org.firebirdsql.management.FBManager; -import org.firebirdsql.management.PageSizeConstants; import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.EnabledInNativeImage; -import org.testcontainers.containers.GenericContainer; -import org.testcontainers.junit.jupiter.Container; -import org.testcontainers.junit.jupiter.Testcontainers; +import org.testcontainers.jdbc.ContainerDatabaseDriver; import javax.sql.DataSource; -import java.sql.Connection; -import java.sql.DriverManager; import java.sql.SQLException; -import java.time.Duration; -import java.util.Properties; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.nullValue; @EnabledInNativeImage -@Testcontainers class FirebirdTest { - private final String systemPropKeyPrefix = "fixture.test-native.yaml.database.firebird."; - - private final String password = "masterkey"; - - @SuppressWarnings("resource") - @Container - private final GenericContainer container = new GenericContainer<>("firebirdsql/firebird:5.0.3") - .withEnv("FIREBIRD_ROOT_PASSWORD", password) - .withEnv("FIREBIRD_USER", "alice") - .withEnv("FIREBIRD_PASSWORD", password) - .withEnv("FIREBIRD_DATABASE", "mirror.fdb") - .withEnv("FIREBIRD_DATABASE_DEFAULT_CHARSET", "UTF8") - .withExposedPorts(3050); - private DataSource logicDataSource; - private String jdbcUrlPrefix; - private TestShardingService testShardingService; - @BeforeEach - void beforeEach() { - assertThat(System.getProperty(systemPropKeyPrefix + "ds0.jdbc-url"), is(nullValue())); - assertThat(System.getProperty(systemPropKeyPrefix + "ds1.jdbc-url"), is(nullValue())); - assertThat(System.getProperty(systemPropKeyPrefix + "ds2.jdbc-url"), is(nullValue())); - } - @AfterEach void afterEach() throws SQLException { ResourceUtils.closeJdbcDataSource(logicDataSource); - System.clearProperty(systemPropKeyPrefix + "ds0.jdbc-url"); - System.clearProperty(systemPropKeyPrefix + "ds1.jdbc-url"); - System.clearProperty(systemPropKeyPrefix + "ds2.jdbc-url"); + ContainerDatabaseDriver.killContainers(); } @Test - void assertShardingInLocalTransactions() throws Exception { - jdbcUrlPrefix = "jdbc:firebird://localhost:" + container.getMappedPort(3050) + "//var/lib/firebird/data/"; - logicDataSource = createDataSource(); + void assertShardingInLocalTransactions() throws SQLException { + HikariConfig config = new HikariConfig(); + config.setDriverClassName("org.apache.shardingsphere.driver.ShardingSphereDriver"); + config.setJdbcUrl("jdbc:shardingsphere:classpath:test-native/yaml/jdbc/databases/firebird.yaml"); + logicDataSource = new HikariDataSource(config); testShardingService = new TestShardingService(logicDataSource); initEnvironment(); testShardingService.processSuccess(); @@ -103,48 +65,4 @@ private void initEnvironment() throws SQLException { testShardingService.getOrderItemRepository().createTableInFirebird(); testShardingService.getAddressRepository().createTableInFirebird(); } - - private Connection openConnection() throws SQLException { - Properties props = new Properties(); - props.setProperty("user", "alice"); - props.setProperty("password", password); - return DriverManager.getConnection(jdbcUrlPrefix + "mirror.fdb", props); - } - - /** - * Due to FirebirdSQL/jaybird#629, - * the SQL statement `Create Database` cannot be executed on the Firebird JDBC driver. - * Unit testing requires the use of {@link org.firebirdsql.management.FBManager}. - * - * @return Data Source - * @throws Exception Exception - * @see org.firebirdsql.management.FBManager - */ - @SuppressWarnings({"SqlDialectInspection", "SqlNoDataSourceInspection"}) - private DataSource createDataSource() throws Exception { - Awaitility.await().atMost(Duration.ofMinutes(1L)).ignoreExceptions().until(() -> { - openConnection().close(); - return true; - }); - try (FBManager fbManager = new FBManager()) { - fbManager.setServer("localhost"); - fbManager.setUserName("alice"); - fbManager.setPassword(password); - fbManager.setFileName("/var/lib/firebird/data/mirror.fdb"); - fbManager.setPageSize(PageSizeConstants.SIZE_16K); - fbManager.setDefaultCharacterSet("UTF8"); - fbManager.setPort(container.getMappedPort(3050)); - fbManager.start(); - fbManager.createDatabase("/var/lib/firebird/data/demo_ds_0.fdb", "alice", password); - fbManager.createDatabase("/var/lib/firebird/data/demo_ds_1.fdb", "alice", password); - fbManager.createDatabase("/var/lib/firebird/data/demo_ds_2.fdb", "alice", password); - } - HikariConfig config = new HikariConfig(); - config.setDriverClassName("org.apache.shardingsphere.driver.ShardingSphereDriver"); - config.setJdbcUrl("jdbc:shardingsphere:classpath:test-native/yaml/jdbc/databases/firebird.yaml?placeholder-type=system_props"); - System.setProperty(systemPropKeyPrefix + "ds0.jdbc-url", jdbcUrlPrefix + "demo_ds_0.fdb"); - System.setProperty(systemPropKeyPrefix + "ds1.jdbc-url", jdbcUrlPrefix + "demo_ds_1.fdb"); - System.setProperty(systemPropKeyPrefix + "ds2.jdbc-url", jdbcUrlPrefix + "demo_ds_2.fdb"); - return new HikariDataSource(config); - } } diff --git a/test/native/src/test/resources/META-INF/services/org.apache.shardingsphere.database.connector.core.jdbcurl.parser.ConnectionPropertiesParser b/test/native/src/test/resources/META-INF/services/org.apache.shardingsphere.database.connector.core.jdbcurl.parser.ConnectionPropertiesParser new file mode 100644 index 0000000000000..9f5bffe72d528 --- /dev/null +++ b/test/native/src/test/resources/META-INF/services/org.apache.shardingsphere.database.connector.core.jdbcurl.parser.ConnectionPropertiesParser @@ -0,0 +1,18 @@ +# +# 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. +# + +org.apache.shardingsphere.test.natived.commons.algorithm.testcontainers.jdbcurl.TcFirebirdConnectionPropertiesParser diff --git a/test/native/src/test/resources/META-INF/services/org.apache.shardingsphere.database.connector.core.type.DatabaseType b/test/native/src/test/resources/META-INF/services/org.apache.shardingsphere.database.connector.core.type.DatabaseType index 6c22de3937a98..2908b7054fc89 100644 --- a/test/native/src/test/resources/META-INF/services/org.apache.shardingsphere.database.connector.core.type.DatabaseType +++ b/test/native/src/test/resources/META-INF/services/org.apache.shardingsphere.database.connector.core.type.DatabaseType @@ -15,6 +15,7 @@ # limitations under the License. # -org.apache.shardingsphere.test.natived.commons.algorithm.testcontainers.TcPostgreSQLDatabaseType -org.apache.shardingsphere.test.natived.commons.algorithm.testcontainers.TcSQLServerDatabaseType -org.apache.shardingsphere.test.natived.commons.algorithm.testcontainers.TcClickhouseDatabaseType +org.apache.shardingsphere.test.natived.commons.algorithm.testcontainers.type.TcPostgreSQLDatabaseType +org.apache.shardingsphere.test.natived.commons.algorithm.testcontainers.type.TcSQLServerDatabaseType +org.apache.shardingsphere.test.natived.commons.algorithm.testcontainers.type.TcClickhouseDatabaseType +org.apache.shardingsphere.test.natived.commons.algorithm.testcontainers.type.TcFirebirdDatabaseType diff --git a/test/native/src/test/resources/test-native/yaml/jdbc/databases/clickhouse.yaml b/test/native/src/test/resources/test-native/yaml/jdbc/databases/clickhouse.yaml index 90bca7900e9a6..44127a2162303 100644 --- a/test/native/src/test/resources/test-native/yaml/jdbc/databases/clickhouse.yaml +++ b/test/native/src/test/resources/test-native/yaml/jdbc/databases/clickhouse.yaml @@ -19,15 +19,15 @@ dataSources: ds_0: dataSourceClassName: com.zaxxer.hikari.HikariDataSource driverClassName: org.testcontainers.jdbc.ContainerDatabaseDriver - jdbcUrl: jdbc:tc:clickhouse:25.6.5.41:///demo_ds_0?TC_INITSCRIPT=test-native/sql/clickhouse-init.sql + jdbcUrl: jdbc:tc:clickhouse:25.9.6.117:///demo_ds_0?TC_INITSCRIPT=test-native/sql/clickhouse-init.sql ds_1: dataSourceClassName: com.zaxxer.hikari.HikariDataSource driverClassName: org.testcontainers.jdbc.ContainerDatabaseDriver - jdbcUrl: jdbc:tc:clickhouse:25.6.5.41:///demo_ds_1?TC_INITSCRIPT=test-native/sql/clickhouse-init.sql + jdbcUrl: jdbc:tc:clickhouse:25.9.6.117:///demo_ds_1?TC_INITSCRIPT=test-native/sql/clickhouse-init.sql ds_2: dataSourceClassName: com.zaxxer.hikari.HikariDataSource driverClassName: org.testcontainers.jdbc.ContainerDatabaseDriver - jdbcUrl: jdbc:tc:clickhouse:25.6.5.41:///demo_ds_2?TC_INITSCRIPT=test-native/sql/clickhouse-init.sql + jdbcUrl: jdbc:tc:clickhouse:25.9.6.117:///demo_ds_2?TC_INITSCRIPT=test-native/sql/clickhouse-init.sql rules: - !SHARDING diff --git a/test/native/src/test/resources/test-native/yaml/jdbc/databases/firebird.yaml b/test/native/src/test/resources/test-native/yaml/jdbc/databases/firebird.yaml index 9b4a9b636cd30..f0cca2453372b 100644 --- a/test/native/src/test/resources/test-native/yaml/jdbc/databases/firebird.yaml +++ b/test/native/src/test/resources/test-native/yaml/jdbc/databases/firebird.yaml @@ -18,23 +18,16 @@ dataSources: ds_0: dataSourceClassName: com.zaxxer.hikari.HikariDataSource - driverClassName: org.firebirdsql.jdbc.FBDriver - jdbcUrl: $${fixture.test-native.yaml.database.firebird.ds0.jdbc-url::} - username: alice - password: masterkey + driverClassName: org.testcontainers.jdbc.ContainerDatabaseDriver + jdbcUrl: jdbc:tc:firebird:5.0.3:///demo_ds_0 ds_1: dataSourceClassName: com.zaxxer.hikari.HikariDataSource - driverClassName: org.firebirdsql.jdbc.FBDriver - jdbcUrl: $${fixture.test-native.yaml.database.firebird.ds1.jdbc-url::} - username: alice - password: masterkey + driverClassName: org.testcontainers.jdbc.ContainerDatabaseDriver + jdbcUrl: jdbc:tc:firebird:5.0.3:///demo_ds_1 ds_2: dataSourceClassName: com.zaxxer.hikari.HikariDataSource - driverClassName: org.firebirdsql.jdbc.FBDriver - jdbcUrl: $${fixture.test-native.yaml.database.firebird.ds2.jdbc-url::} - username: alice - password: masterkey - + driverClassName: org.testcontainers.jdbc.ContainerDatabaseDriver + jdbcUrl: jdbc:tc:firebird:5.0.3:///demo_ds_2 rules: - !SHARDING tables: