Loading sharding-jdbc/src/test/java/io/shardingsphere/dbtest/engine/ddl/GeneralDDLIntegrateTest.java +16 −19 Original line number Diff line number Diff line Loading @@ -50,26 +50,15 @@ public final class GeneralDDLIntegrateTest extends BaseDDLIntegrateTest { @Test public void assertExecuteUpdate() throws JAXBException, IOException, SQLException { if (!getDatabaseTypeEnvironment().isEnabled()) { return; } try (Connection connection = getDataSource().getConnection()) { dropTableIfExisted(connection); if (!Strings.isNullOrEmpty(assertion.getInitSql())) { connection.prepareStatement(assertion.getInitSql()).executeUpdate(); } if (SQLCaseType.Literal == getCaseType()) { connection.createStatement().executeUpdate(getSql()); } else { connection.prepareStatement(getSql()).executeUpdate(); } assertMetadata(connection); dropTableIfExisted(connection); } assertExecuteByType(true); } @Test public void assertExecute() throws JAXBException, IOException, SQLException { assertExecuteByType(false); } private void assertExecuteByType(boolean isExecuteUpdate) throws JAXBException, IOException, SQLException { if (!getDatabaseTypeEnvironment().isEnabled()) { return; } Loading @@ -78,11 +67,19 @@ public final class GeneralDDLIntegrateTest extends BaseDDLIntegrateTest { if (!Strings.isNullOrEmpty(assertion.getInitSql())) { connection.prepareStatement(assertion.getInitSql()).executeUpdate(); } if (isExecuteUpdate) { if (SQLCaseType.Literal == getCaseType()) { connection.createStatement().execute(getSql()); } else { connection.prepareStatement(getSql()).execute(); } } else { if (SQLCaseType.Literal == getCaseType()) { connection.createStatement().executeUpdate(getSql()); } else { connection.prepareStatement(getSql()).executeUpdate(); } } assertMetadata(connection); dropTableIfExisted(connection); } Loading Loading
sharding-jdbc/src/test/java/io/shardingsphere/dbtest/engine/ddl/GeneralDDLIntegrateTest.java +16 −19 Original line number Diff line number Diff line Loading @@ -50,26 +50,15 @@ public final class GeneralDDLIntegrateTest extends BaseDDLIntegrateTest { @Test public void assertExecuteUpdate() throws JAXBException, IOException, SQLException { if (!getDatabaseTypeEnvironment().isEnabled()) { return; } try (Connection connection = getDataSource().getConnection()) { dropTableIfExisted(connection); if (!Strings.isNullOrEmpty(assertion.getInitSql())) { connection.prepareStatement(assertion.getInitSql()).executeUpdate(); } if (SQLCaseType.Literal == getCaseType()) { connection.createStatement().executeUpdate(getSql()); } else { connection.prepareStatement(getSql()).executeUpdate(); } assertMetadata(connection); dropTableIfExisted(connection); } assertExecuteByType(true); } @Test public void assertExecute() throws JAXBException, IOException, SQLException { assertExecuteByType(false); } private void assertExecuteByType(boolean isExecuteUpdate) throws JAXBException, IOException, SQLException { if (!getDatabaseTypeEnvironment().isEnabled()) { return; } Loading @@ -78,11 +67,19 @@ public final class GeneralDDLIntegrateTest extends BaseDDLIntegrateTest { if (!Strings.isNullOrEmpty(assertion.getInitSql())) { connection.prepareStatement(assertion.getInitSql()).executeUpdate(); } if (isExecuteUpdate) { if (SQLCaseType.Literal == getCaseType()) { connection.createStatement().execute(getSql()); } else { connection.prepareStatement(getSql()).execute(); } } else { if (SQLCaseType.Literal == getCaseType()) { connection.createStatement().executeUpdate(getSql()); } else { connection.prepareStatement(getSql()).executeUpdate(); } } assertMetadata(connection); dropTableIfExisted(connection); } Loading