From ea299b31fdb6411eb59dd0ccd68b73f87cc44f05 Mon Sep 17 00:00:00 2001 From: haocao Date: Wed, 1 Aug 2018 14:53:11 +0800 Subject: [PATCH] for #601, removed useless codes for integrate database type codes --- .../core/common/base/AbstractSQLTest.java | 24 +++----- ...tractShardingJDBCDatabaseAndTableTest.java | 20 +------ .../jdbc/adapter/ConnectionAdapterTest.java | 22 ++----- .../jdbc/adapter/DataSourceAdapterTest.java | 4 -- .../adapter/PreparedStatementAdapterTest.java | 4 -- .../jdbc/adapter/ResultSetAdapterTest.java | 6 +- .../adapter/ResultSetGetterAdapterTest.java | 7 +-- .../jdbc/adapter/StatementAdapterTest.java | 6 +- .../ShardingPreparedStatementTest.java | 30 ++-------- .../core/statement/ShardingStatementTest.java | 58 ++++++++----------- .../UnsupportedOperationConnectionTest.java | 4 -- .../UnsupportedOperationDataSourceTest.java | 4 -- ...pportedOperationPreparedStatementTest.java | 4 -- .../UnsupportedOperationResultSetTest.java | 4 -- .../UnsupportedOperationStatementTest.java | 4 -- ...supportedUpdateOperationResultSetTest.java | 4 -- .../resources/integrate/schema/table/jdbc.sql | 6 ++ 17 files changed, 55 insertions(+), 156 deletions(-) create mode 100644 sharding-jdbc/src/test/resources/integrate/schema/table/jdbc.sql diff --git a/sharding-jdbc/src/test/java/io/shardingsphere/core/common/base/AbstractSQLTest.java b/sharding-jdbc/src/test/java/io/shardingsphere/core/common/base/AbstractSQLTest.java index 8645a82785d36..11b046c50e75b 100644 --- a/sharding-jdbc/src/test/java/io/shardingsphere/core/common/base/AbstractSQLTest.java +++ b/sharding-jdbc/src/test/java/io/shardingsphere/core/common/base/AbstractSQLTest.java @@ -115,8 +115,6 @@ private static BasicDataSource buildDataSource(final String dbName, final Databa protected abstract List getInitDataSetFiles(); - protected abstract DatabaseType getCurrentDatabaseType(); - protected final Map> createDataSourceMap() { for (String each : getInitDataSetFiles()) { String dbName = getDatabaseName(each); @@ -172,19 +170,15 @@ private static void closeDataSources(final Collection dataSources) t } protected final void importDataSet() throws Exception { - for (DatabaseType databaseType : getDatabaseTypes()) { - if (databaseType == getCurrentDatabaseType() || null == getCurrentDatabaseType()) { - DatabaseEnvironment dbEnv = new DatabaseEnvironment(databaseType); - for (String each : getInitDataSetFiles()) { - InputStream is = AbstractSQLTest.class.getClassLoader().getResourceAsStream(each); - IDataSet dataSet = new FlatXmlDataSetBuilder().build(new InputStreamReader(is)); - IDatabaseTester databaseTester = new ShardingJdbcDatabaseTester(dbEnv.getDriverClassName(), dbEnv.getURL(getDatabaseName(each)), - dbEnv.getUsername(), dbEnv.getPassword(), dbEnv.getSchema(getDatabaseName(each))); - databaseTester.setSetUpOperation(DatabaseOperation.CLEAN_INSERT); - databaseTester.setDataSet(dataSet); - databaseTester.onSetup(); - } - } + DatabaseEnvironment dbEnv = new DatabaseEnvironment(DatabaseType.H2); + for (String each : getInitDataSetFiles()) { + InputStream is = AbstractSQLTest.class.getClassLoader().getResourceAsStream(each); + IDataSet dataSet = new FlatXmlDataSetBuilder().build(new InputStreamReader(is)); + IDatabaseTester databaseTester = new ShardingJdbcDatabaseTester(dbEnv.getDriverClassName(), dbEnv.getURL(getDatabaseName(each)), + dbEnv.getUsername(), dbEnv.getPassword(), dbEnv.getSchema(getDatabaseName(each))); + databaseTester.setSetUpOperation(DatabaseOperation.CLEAN_INSERT); + databaseTester.setDataSet(dataSet); + databaseTester.onSetup(); } } } diff --git a/sharding-jdbc/src/test/java/io/shardingsphere/core/common/base/AbstractShardingJDBCDatabaseAndTableTest.java b/sharding-jdbc/src/test/java/io/shardingsphere/core/common/base/AbstractShardingJDBCDatabaseAndTableTest.java index 8a710aaa239e5..c7006f949e813 100644 --- a/sharding-jdbc/src/test/java/io/shardingsphere/core/common/base/AbstractShardingJDBCDatabaseAndTableTest.java +++ b/sharding-jdbc/src/test/java/io/shardingsphere/core/common/base/AbstractShardingJDBCDatabaseAndTableTest.java @@ -27,25 +27,17 @@ import io.shardingsphere.core.fixture.RangeOrderShardingAlgorithm; import io.shardingsphere.core.jdbc.core.datasource.ShardingDataSource; import io.shardingsphere.core.rule.ShardingRule; -import lombok.RequiredArgsConstructor; import org.junit.Before; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; import javax.sql.DataSource; import java.sql.SQLException; import java.util.Arrays; -import java.util.Collection; import java.util.LinkedList; import java.util.List; import java.util.Map; -@RequiredArgsConstructor -@RunWith(Parameterized.class) public abstract class AbstractShardingJDBCDatabaseAndTableTest extends AbstractSQLTest { - private final DatabaseType databaseType; - @Before public void cleanAndInitTable() throws Exception { importDataSet(); @@ -94,17 +86,7 @@ protected List getInitDataSetFiles() { return Arrays.asList("integrate/dataset/jdbc/jdbc_0.xml", "integrate/dataset/jdbc/jdbc_1.xml"); } - @Parameterized.Parameters(name = "{0}") - public static Collection dataParameters() { - return getDatabaseTypes(); - } - - @Override - protected DatabaseType getCurrentDatabaseType() { - return databaseType; - } - protected ShardingDataSource getShardingDataSource() { - return getShardingDataSources().get(databaseType); + return getShardingDataSources().get(DatabaseType.H2); } } diff --git a/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/adapter/ConnectionAdapterTest.java b/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/adapter/ConnectionAdapterTest.java index 4acbd5b874fe1..dd1cd18fa2ed0 100644 --- a/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/adapter/ConnectionAdapterTest.java +++ b/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/adapter/ConnectionAdapterTest.java @@ -38,10 +38,6 @@ public final class ConnectionAdapterTest extends AbstractShardingJDBCDatabaseAnd private String sql = JDBCTestSQL.SELECT_GROUP_BY_USER_ID_SQL; - public ConnectionAdapterTest(final DatabaseType databaseType) { - super(databaseType); - } - @Test public void assertSetAutoCommit() throws SQLException { try (ShardingConnection actual = getShardingDataSource().getConnection()) { @@ -109,10 +105,8 @@ public void assertSetReadOnly() throws SQLException { actual.setReadOnly(false); actual.createStatement().executeQuery(sql); assertReadOnly(actual, false); - if (DatabaseType.SQLServer != getCurrentDatabaseType()) { - actual.setReadOnly(true); - assertReadOnly(actual, true); - } + actual.setReadOnly(true); + assertReadOnly(actual, true); } } @@ -129,11 +123,7 @@ private void assertReadOnly(final ShardingConnection actual, final boolean readO public void assertGetTransactionIsolation() throws SQLException { try (ShardingConnection actual = getShardingDataSource().getConnection()) { actual.createStatement().executeQuery(sql); - if (DatabaseType.MySQL == getCurrentDatabaseType()) { - assertThat(actual.getTransactionIsolation(), is(Connection.TRANSACTION_REPEATABLE_READ)); - } else { - assertThat(actual.getTransactionIsolation(), is(Connection.TRANSACTION_READ_COMMITTED)); - } + assertThat(actual.getTransactionIsolation(), is(Connection.TRANSACTION_READ_COMMITTED)); } } @@ -144,10 +134,8 @@ public void assertSetTransactionIsolation() throws SQLException { actual.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE); actual.createStatement().executeQuery(sql); assertTransactionIsolation(actual, Connection.TRANSACTION_SERIALIZABLE); - if (DatabaseType.Oracle != getCurrentDatabaseType()) { - actual.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED); - assertTransactionIsolation(actual, Connection.TRANSACTION_READ_COMMITTED); - } + actual.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED); + assertTransactionIsolation(actual, Connection.TRANSACTION_READ_COMMITTED); } } diff --git a/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/adapter/DataSourceAdapterTest.java b/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/adapter/DataSourceAdapterTest.java index ca96359d55cfb..772978350c8a2 100644 --- a/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/adapter/DataSourceAdapterTest.java +++ b/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/adapter/DataSourceAdapterTest.java @@ -40,10 +40,6 @@ public final class DataSourceAdapterTest extends AbstractShardingJDBCDatabaseAndTableTest { - public DataSourceAdapterTest(final DatabaseType databaseType) { - super(databaseType); - } - @Test public void assertUnwrapSuccess() throws SQLException { assertThat(getShardingDataSource().unwrap(Object.class), is((Object) getShardingDataSource())); diff --git a/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/adapter/PreparedStatementAdapterTest.java b/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/adapter/PreparedStatementAdapterTest.java index cdb163de2864b..f475e626a1a7a 100644 --- a/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/adapter/PreparedStatementAdapterTest.java +++ b/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/adapter/PreparedStatementAdapterTest.java @@ -55,10 +55,6 @@ public final class PreparedStatementAdapterTest extends AbstractShardingJDBCData private final List preparedStatements = new ArrayList<>(); - public PreparedStatementAdapterTest(final DatabaseType databaseType) { - super(databaseType); - } - @Before public void init() { ShardingConnection shardingConnection = getShardingDataSource().getConnection(); diff --git a/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/adapter/ResultSetAdapterTest.java b/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/adapter/ResultSetAdapterTest.java index 5f27f7801ff2c..0ea0d5c547729 100644 --- a/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/adapter/ResultSetAdapterTest.java +++ b/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/adapter/ResultSetAdapterTest.java @@ -48,17 +48,13 @@ public final class ResultSetAdapterTest extends AbstractShardingJDBCDatabaseAndT private final Map resultSets = new HashMap<>(); - public ResultSetAdapterTest(final DatabaseType databaseType) { - super(databaseType); - } - @Before public void init() throws SQLException { ShardingConnection shardingConnection = getShardingDataSource().getConnection(); shardingConnections.add(shardingConnection); Statement statement = shardingConnection.createStatement(); statements.add(statement); - resultSets.put(getCurrentDatabaseType(), statement.executeQuery(JDBCTestSQL.SELECT_GROUP_BY_USER_ID_SQL)); + resultSets.put(DatabaseType.H2, statement.executeQuery(JDBCTestSQL.SELECT_GROUP_BY_USER_ID_SQL)); } @After diff --git a/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/adapter/ResultSetGetterAdapterTest.java b/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/adapter/ResultSetGetterAdapterTest.java index 3f86949ac0773..82888631bef5a 100644 --- a/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/adapter/ResultSetGetterAdapterTest.java +++ b/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/adapter/ResultSetGetterAdapterTest.java @@ -52,10 +52,7 @@ public final class ResultSetGetterAdapterTest extends AbstractShardingJDBCDataba private final String columnName = "user_id"; - public ResultSetGetterAdapterTest(final DatabaseType databaseType) { - super(databaseType); - } - + @Before public void init() throws SQLException { ShardingConnection shardingConnection = getShardingDataSource().getConnection(); @@ -64,7 +61,7 @@ public void init() throws SQLException { statements.add(statement); ResultSet resultSet = statement.executeQuery(JDBCTestSQL.SELECT_ORDER_BY_USER_ID_SQL); resultSet.next(); - resultSets.put(getCurrentDatabaseType(), resultSet); + resultSets.put(DatabaseType.H2, resultSet); } @After diff --git a/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/adapter/StatementAdapterTest.java b/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/adapter/StatementAdapterTest.java index 8f49a628104dd..d3cff221b70e7 100644 --- a/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/adapter/StatementAdapterTest.java +++ b/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/adapter/StatementAdapterTest.java @@ -53,15 +53,11 @@ public final class StatementAdapterTest extends AbstractShardingJDBCDatabaseAndT private String sql = JDBCTestSQL.SELECT_GROUP_BY_USER_ID_SQL; - public StatementAdapterTest(final DatabaseType databaseType) { - super(databaseType); - } - @Before public void init() { ShardingConnection shardingConnection = getShardingDataSource().getConnection(); shardingConnections.add(shardingConnection); - statements.put(getCurrentDatabaseType(), shardingConnection.createStatement()); + statements.put(DatabaseType.H2, shardingConnection.createStatement()); } @After diff --git a/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/core/statement/ShardingPreparedStatementTest.java b/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/core/statement/ShardingPreparedStatementTest.java index 63c951f00a109..e28b6cd4371ac 100644 --- a/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/core/statement/ShardingPreparedStatementTest.java +++ b/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/core/statement/ShardingPreparedStatementTest.java @@ -43,10 +43,6 @@ public final class ShardingPreparedStatementTest extends AbstractShardingJDBCDatabaseAndTableTest { - public ShardingPreparedStatementTest(final DatabaseType databaseType) { - super(databaseType); - } - @Test public void assertAddBatch() throws SQLException { Object listener = new Object() { @@ -87,10 +83,8 @@ public void subscribe(final DMLExecutionEvent event) { preparedStatement.setString(4, "BATCH"); preparedStatement.addBatch(); int[] result = preparedStatement.executeBatch(); - if (DatabaseType.Oracle != getCurrentDatabaseType()) { - for (int rs : result) { - assertThat(rs, is(1)); - } + for (int rs : result) { + assertThat(rs, is(1)); } } EventBusInstance.getInstance().unregister(listener); @@ -98,10 +92,6 @@ public void subscribe(final DMLExecutionEvent event) { @Test public void assertAddBatchWithoutGenerateKeyColumn() throws SQLException { - // TODO 调研oracle为什么不可以 - if (DatabaseType.Oracle == getCurrentDatabaseType()) { - return; - } String sql = SQLPlaceholderUtil.replacePreparedStatement(JDBCTestSQL.INSERT_WITH_AUTO_INCREMENT_COLUMN_SQL); try ( Connection connection = getShardingDataSource().getConnection(); @@ -158,10 +148,6 @@ public void assertAddBatchWithoutGenerateKeyColumn() throws SQLException { @Test public void assertAddBatchWithGenerateKeyColumn() throws SQLException { - // TODO 调研oracle为什么不可以 - if (DatabaseType.Oracle == getCurrentDatabaseType()) { - return; - } try ( Connection connection = getShardingDataSource().getConnection(); PreparedStatement preparedStatement = connection.prepareStatement(JDBCTestSQL.INSERT_ORDER_ITEM_WITH_ALL_PLACEHOLDERS_SQL, Statement.RETURN_GENERATED_KEYS); @@ -237,15 +223,9 @@ public void assertUpdateBatch() throws SQLException { int[] result = preparedStatement.executeBatch(); assertThat(result.length, is(3)); - if (DatabaseType.Oracle == getCurrentDatabaseType()) { - assertThat(result[0], is(-2)); - assertThat(result[1], is(-2)); - assertThat(result[2], is(-2)); - } else { - assertThat(result[0], is(4)); - assertThat(result[1], is(0)); - assertThat(result[2], is(4)); - } + assertThat(result[0], is(4)); + assertThat(result[1], is(0)); + assertThat(result[2], is(4)); } } diff --git a/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/core/statement/ShardingStatementTest.java b/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/core/statement/ShardingStatementTest.java index 0f5b2cb5fbf1a..16a0fca8b8015 100644 --- a/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/core/statement/ShardingStatementTest.java +++ b/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/core/statement/ShardingStatementTest.java @@ -35,41 +35,33 @@ public final class ShardingStatementTest extends AbstractShardingJDBCDatabaseAnd private String sql = "INSERT INTO t_order_item(order_id, user_id, status) VALUES (%d, %d, '%s')"; - public ShardingStatementTest(final DatabaseType databaseType) { - super(databaseType); - } - @Test public void assertGetGeneratedKeys() throws SQLException { - if (DatabaseType.PostgreSQL != getCurrentDatabaseType()) { - try ( - Connection connection = getShardingDataSource().getConnection(); - Statement stmt = connection.createStatement()) { - assertFalse(stmt.execute(String.format(sql, 1, 1, "init"))); - assertFalse(stmt.execute(String.format(sql, 1, 1, "init"), Statement.NO_GENERATED_KEYS)); - assertFalse(stmt.execute(String.format(sql, 1, 1, "init"), Statement.RETURN_GENERATED_KEYS)); - ResultSet generatedKeysResultSet = stmt.getGeneratedKeys(); - assertTrue(generatedKeysResultSet.next()); - assertThat(generatedKeysResultSet.getLong(1), is(3L)); - assertFalse(stmt.execute(String.format(sql, 1, 1, "init"), new int[]{1})); - generatedKeysResultSet = stmt.getGeneratedKeys(); - assertTrue(generatedKeysResultSet.next()); - assertThat(generatedKeysResultSet.getLong(1), is(4L)); - assertFalse(stmt.execute(String.format(sql, 1, 1, "init"), new String[]{"user_id"})); - generatedKeysResultSet = stmt.getGeneratedKeys(); - assertTrue(generatedKeysResultSet.next()); - assertThat(generatedKeysResultSet.getLong(1), is(5L)); - assertFalse(stmt.execute(String.format(sql, 1, 1, "init"), new int[]{2})); - generatedKeysResultSet = stmt.getGeneratedKeys(); - assertTrue(generatedKeysResultSet.next()); - assertThat(generatedKeysResultSet.getLong(1), is(6L)); - if (DatabaseType.Oracle != getCurrentDatabaseType()) { - assertFalse(stmt.execute(String.format(sql, 1, 1, "init"), new String[]{"no"})); - generatedKeysResultSet = stmt.getGeneratedKeys(); - assertTrue(generatedKeysResultSet.next()); - assertThat(generatedKeysResultSet.getLong(1), is(7L)); - } - } + try ( + Connection connection = getShardingDataSource().getConnection(); + Statement stmt = connection.createStatement()) { + assertFalse(stmt.execute(String.format(sql, 1, 1, "init"))); + assertFalse(stmt.execute(String.format(sql, 1, 1, "init"), Statement.NO_GENERATED_KEYS)); + assertFalse(stmt.execute(String.format(sql, 1, 1, "init"), Statement.RETURN_GENERATED_KEYS)); + ResultSet generatedKeysResultSet = stmt.getGeneratedKeys(); + assertTrue(generatedKeysResultSet.next()); + assertThat(generatedKeysResultSet.getLong(1), is(3L)); + assertFalse(stmt.execute(String.format(sql, 1, 1, "init"), new int[]{1})); + generatedKeysResultSet = stmt.getGeneratedKeys(); + assertTrue(generatedKeysResultSet.next()); + assertThat(generatedKeysResultSet.getLong(1), is(4L)); + assertFalse(stmt.execute(String.format(sql, 1, 1, "init"), new String[]{"user_id"})); + generatedKeysResultSet = stmt.getGeneratedKeys(); + assertTrue(generatedKeysResultSet.next()); + assertThat(generatedKeysResultSet.getLong(1), is(5L)); + assertFalse(stmt.execute(String.format(sql, 1, 1, "init"), new int[]{2})); + generatedKeysResultSet = stmt.getGeneratedKeys(); + assertTrue(generatedKeysResultSet.next()); + assertThat(generatedKeysResultSet.getLong(1), is(6L)); + assertFalse(stmt.execute(String.format(sql, 1, 1, "init"), new String[]{"no"})); + generatedKeysResultSet = stmt.getGeneratedKeys(); + assertTrue(generatedKeysResultSet.next()); + assertThat(generatedKeysResultSet.getLong(1), is(7L)); } } } diff --git a/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/unsupported/UnsupportedOperationConnectionTest.java b/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/unsupported/UnsupportedOperationConnectionTest.java index 7c64b5fdc4594..d6aceddc62804 100644 --- a/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/unsupported/UnsupportedOperationConnectionTest.java +++ b/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/unsupported/UnsupportedOperationConnectionTest.java @@ -34,10 +34,6 @@ public final class UnsupportedOperationConnectionTest extends AbstractShardingJD private final List shardingConnections = new ArrayList<>(); - public UnsupportedOperationConnectionTest(final DatabaseType databaseType) { - super(databaseType); - } - @Before public void init() { shardingConnections.add(getShardingDataSource().getConnection()); diff --git a/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/unsupported/UnsupportedOperationDataSourceTest.java b/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/unsupported/UnsupportedOperationDataSourceTest.java index 06e5bf41642d0..4a246ec903033 100644 --- a/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/unsupported/UnsupportedOperationDataSourceTest.java +++ b/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/unsupported/UnsupportedOperationDataSourceTest.java @@ -26,10 +26,6 @@ public final class UnsupportedOperationDataSourceTest extends AbstractShardingJDBCDatabaseAndTableTest { - public UnsupportedOperationDataSourceTest(final DatabaseType databaseType) { - super(databaseType); - } - @Test(expected = SQLFeatureNotSupportedException.class) public void assertGetLoginTimeout() throws SQLException { getShardingDataSource().getLoginTimeout(); diff --git a/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/unsupported/UnsupportedOperationPreparedStatementTest.java b/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/unsupported/UnsupportedOperationPreparedStatementTest.java index dd9dac43fe84f..a9debe02d4791 100644 --- a/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/unsupported/UnsupportedOperationPreparedStatementTest.java +++ b/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/unsupported/UnsupportedOperationPreparedStatementTest.java @@ -39,10 +39,6 @@ public final class UnsupportedOperationPreparedStatementTest extends AbstractSha private final List statements = new ArrayList<>(); - public UnsupportedOperationPreparedStatementTest(final DatabaseType databaseType) { - super(databaseType); - } - @Before public void init() { ShardingConnection shardingConnection = getShardingDataSource().getConnection(); diff --git a/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/unsupported/UnsupportedOperationResultSetTest.java b/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/unsupported/UnsupportedOperationResultSetTest.java index 4f23e6d947055..20cfbbb2a8e8d 100644 --- a/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/unsupported/UnsupportedOperationResultSetTest.java +++ b/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/unsupported/UnsupportedOperationResultSetTest.java @@ -43,10 +43,6 @@ public final class UnsupportedOperationResultSetTest extends AbstractShardingJDB private final List resultSets = new ArrayList<>(); - public UnsupportedOperationResultSetTest(final DatabaseType databaseType) { - super(databaseType); - } - @Before public void init() throws SQLException { ShardingConnection connection = getShardingDataSource().getConnection(); diff --git a/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/unsupported/UnsupportedOperationStatementTest.java b/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/unsupported/UnsupportedOperationStatementTest.java index 498c5fa5c6016..c6bd73309302c 100644 --- a/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/unsupported/UnsupportedOperationStatementTest.java +++ b/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/unsupported/UnsupportedOperationStatementTest.java @@ -37,10 +37,6 @@ public final class UnsupportedOperationStatementTest extends AbstractShardingJDB private final List statements = new ArrayList<>(); - public UnsupportedOperationStatementTest(final DatabaseType databaseType) { - super(databaseType); - } - @Before public void init() { ShardingConnection connection = getShardingDataSource().getConnection(); diff --git a/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/unsupported/UnsupportedUpdateOperationResultSetTest.java b/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/unsupported/UnsupportedUpdateOperationResultSetTest.java index 5ef0b25022b85..3484e19fa3ca0 100644 --- a/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/unsupported/UnsupportedUpdateOperationResultSetTest.java +++ b/sharding-jdbc/src/test/java/io/shardingsphere/core/jdbc/unsupported/UnsupportedUpdateOperationResultSetTest.java @@ -48,10 +48,6 @@ public final class UnsupportedUpdateOperationResultSetTest extends AbstractShard private final List resultSets = new ArrayList<>(); - public UnsupportedUpdateOperationResultSetTest(final DatabaseType databaseType) { - super(databaseType); - } - @Before public void init() throws SQLException { ShardingConnection shardingConnection = getShardingDataSource().getConnection(); diff --git a/sharding-jdbc/src/test/resources/integrate/schema/table/jdbc.sql b/sharding-jdbc/src/test/resources/integrate/schema/table/jdbc.sql new file mode 100644 index 0000000000000..ab1795a408dba --- /dev/null +++ b/sharding-jdbc/src/test/resources/integrate/schema/table/jdbc.sql @@ -0,0 +1,6 @@ +CREATE TABLE t_order_0 (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id)); +CREATE TABLE t_order_1 (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id)); +CREATE TABLE t_order_item_0 (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (item_id)); +CREATE TABLE t_order_item_1 (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (item_id)); +CREATE TABLE t_config (id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (id)); +CREATE TABLE t_global (id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (id)); \ No newline at end of file