This is an automated email from the ASF dual-hosted git repository.
terrymanu 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 9da8485acbe Remove placeholder arguments from SQL E2E tests (#39212)
9da8485acbe is described below
commit 9da8485acbe1cc7c742a90b1e7809607151e0739
Author: Liang Zhang <[email protected]>
AuthorDate: Wed Jul 22 21:24:32 2026 +0800
Remove placeholder arguments from SQL E2E tests (#39212)
Allow SQL E2E parameterized tests to run with zero invocations.
Remove synthetic null parameters and obsolete null guards.
---
.../sql/framework/SQLE2EITArgumentsProvider.java | 20 ++++-------------
.../param/model/AssertionTestParameter.java | 4 +---
.../framework/param/model/CaseTestParameter.java | 4 +---
.../shardingsphere/test/e2e/sql/it/SQLE2EIT.java | 4 ----
.../test/e2e/sql/it/distsql/ral/RALE2EIT.java | 6 +----
.../test/e2e/sql/it/distsql/rdl/RDLE2EIT.java | 6 +----
.../test/e2e/sql/it/distsql/rql/RQLE2EIT.java | 6 +----
.../test/e2e/sql/it/sql/dal/DALE2EIT.java | 6 +----
.../test/e2e/sql/it/sql/dcl/DCLE2EIT.java | 12 ++--------
.../test/e2e/sql/it/sql/ddl/DDLE2EIT.java | 12 ++--------
.../e2e/sql/it/sql/dml/AdditionalDMLE2EIT.java | 26 ++++++----------------
.../test/e2e/sql/it/sql/dml/BaseDMLE2EIT.java | 5 +----
.../test/e2e/sql/it/sql/dml/BatchDMLE2EIT.java | 14 +++---------
.../test/e2e/sql/it/sql/dml/GeneralDMLE2EIT.java | 12 ++--------
.../e2e/sql/it/sql/dql/AdditionalDQLE2EIT.java | 24 ++++----------------
.../test/e2e/sql/it/sql/dql/GeneralDQLE2EIT.java | 12 ++--------
16 files changed, 33 insertions(+), 140 deletions(-)
diff --git
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/SQLE2EITArgumentsProvider.java
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/SQLE2EITArgumentsProvider.java
index 34e5d754131..3fce200f4e8 100644
---
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/SQLE2EITArgumentsProvider.java
+++
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/SQLE2EITArgumentsProvider.java
@@ -19,10 +19,7 @@ package org.apache.shardingsphere.test.e2e.sql.framework;
import com.google.common.base.Preconditions;
import
org.apache.shardingsphere.test.e2e.sql.framework.param.array.E2ETestParameterFactory;
-import
org.apache.shardingsphere.test.e2e.sql.framework.param.model.AssertionTestParameter;
-import
org.apache.shardingsphere.test.e2e.sql.framework.param.model.CaseTestParameter;
import
org.apache.shardingsphere.test.e2e.sql.framework.param.model.E2ETestParameter;
-import org.apache.shardingsphere.test.e2e.sql.framework.type.SQLCommandType;
import org.junit.jupiter.api.extension.ExtensionContext;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.ArgumentsProvider;
@@ -40,18 +37,9 @@ public final class SQLE2EITArgumentsProvider implements
ArgumentsProvider {
public Stream<? extends Arguments> provideArguments(final
ParameterDeclarations parameters, final ExtensionContext context) {
SQLE2EITSettings settings =
context.getRequiredTestClass().getAnnotation(SQLE2EITSettings.class);
Preconditions.checkNotNull(settings, "Annotation `%s` is required.",
SQLE2EITSettings.class.getSimpleName());
- return settings.batch() ? getBatchTestCaseArguments(settings.value())
: getSingleTestCaseArguments(settings.value());
- }
-
- private Stream<Arguments> getBatchTestCaseArguments(final SQLCommandType
type) {
- Collection<E2ETestParameter> result =
E2ETestParameterFactory.getCaseTestParameters(type);
- // TODO make sure test case can not be null
- return result.isEmpty() ? Stream.of(Arguments.of(new
CaseTestParameter(null, null, null, null, null, null))) :
result.stream().map(Arguments::of);
- }
-
- private Stream<Arguments> getSingleTestCaseArguments(final SQLCommandType
type) {
- Collection<AssertionTestParameter> result =
E2ETestParameterFactory.getAssertionTestParameters(type);
- // TODO make sure test case can not be null
- return result.isEmpty() ? Stream.of(Arguments.of(new
AssertionTestParameter(null, null, null, null, null, null, null, null))) :
result.stream().map(Arguments::of);
+ Collection<? extends E2ETestParameter> testParams = settings.batch()
+ ?
E2ETestParameterFactory.getCaseTestParameters(settings.value())
+ :
E2ETestParameterFactory.getAssertionTestParameters(settings.value());
+ return testParams.stream().map(Arguments::of);
}
}
diff --git
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/model/AssertionTestParameter.java
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/model/AssertionTestParameter.java
index 69c75caf0d0..63d534a1f52 100644
---
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/model/AssertionTestParameter.java
+++
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/model/AssertionTestParameter.java
@@ -51,8 +51,6 @@ public final class AssertionTestParameter implements
E2ETestParameter {
@Override
public String toString() {
- String sql = null == testCaseContext ? null :
testCaseContext.getTestCase().getSql();
- String type = null == databaseType ? null : databaseType.getType();
- return String.format("%s: %s -> %s -> %s -> %s", adapter, scenario,
type, sqlExecuteType, sql);
+ return String.format("%s: %s -> %s -> %s -> %s", adapter, scenario,
databaseType.getType(), sqlExecuteType, testCaseContext.getTestCase().getSql());
}
}
diff --git
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/model/CaseTestParameter.java
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/model/CaseTestParameter.java
index c7b47e95686..76c05f1e199 100644
---
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/model/CaseTestParameter.java
+++
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/framework/param/model/CaseTestParameter.java
@@ -45,8 +45,6 @@ public final class CaseTestParameter implements
E2ETestParameter {
@Override
public String toString() {
- String sql = null == testCaseContext ? null :
testCaseContext.getTestCase().getSql();
- String type = null == databaseType ? null : databaseType.getType();
- return String.format("%s: %s -> %s -> %s", adapter, scenario, type,
sql);
+ return String.format("%s: %s -> %s -> %s", adapter, scenario,
databaseType.getType(), testCaseContext.getTestCase().getSql());
}
}
diff --git
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/SQLE2EIT.java
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/SQLE2EIT.java
index 7bdd5f5a8c3..3bbf5ae2ab9 100644
---
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/SQLE2EIT.java
+++
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/SQLE2EIT.java
@@ -52,10 +52,6 @@ public interface SQLE2EIT {
for (Object each : invocationContext.getArguments()) {
if (each instanceof E2ETestParameter) {
E2ETestParameter testParameter = (E2ETestParameter) each;
- // TODO make sure test case can not be null
- if (null == testParameter.getTestCaseContext()) {
- break;
- }
setEnvironmentEngine(extensionContext, testParameter);
}
}
diff --git
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/distsql/ral/RALE2EIT.java
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/distsql/ral/RALE2EIT.java
index 9a7d2d7e007..dcfeeebf7a2 100644
---
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/distsql/ral/RALE2EIT.java
+++
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/distsql/ral/RALE2EIT.java
@@ -58,14 +58,10 @@ class RALE2EIT implements SQLE2EIT {
private SQLE2EEnvironmentEngine environmentEngine;
- @ParameterizedTest(name = "{0}")
+ @ParameterizedTest(name = "{0}", allowZeroInvocations = true)
@EnabledIf("isEnabled")
@ArgumentsSource(SQLE2EITArgumentsProvider.class)
void assertExecute(final AssertionTestParameter testParam) throws
SQLException {
- // TODO make sure test case can not be null
- if (null == testParam.getTestCaseContext()) {
- return;
- }
SQLE2EITContext context = new SQLE2EITContext(testParam);
init(context);
try {
diff --git
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/distsql/rdl/RDLE2EIT.java
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/distsql/rdl/RDLE2EIT.java
index ce25aef9ed5..182a9a9be1c 100644
---
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/distsql/rdl/RDLE2EIT.java
+++
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/distsql/rdl/RDLE2EIT.java
@@ -58,14 +58,10 @@ class RDLE2EIT implements SQLE2EIT {
private SQLE2EEnvironmentEngine environmentEngine;
- @ParameterizedTest(name = "{0}")
+ @ParameterizedTest(name = "{0}", allowZeroInvocations = true)
@EnabledIf("isEnabled")
@ArgumentsSource(SQLE2EITArgumentsProvider.class)
void assertExecute(final AssertionTestParameter testParam) throws
SQLException {
- // TODO make sure test case can not be null
- if (null == testParam.getTestCaseContext()) {
- return;
- }
SQLE2EITContext context = new SQLE2EITContext(testParam);
init(context);
try {
diff --git
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/distsql/rql/RQLE2EIT.java
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/distsql/rql/RQLE2EIT.java
index 22c54f7412b..bbf55c58b1f 100644
---
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/distsql/rql/RQLE2EIT.java
+++
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/distsql/rql/RQLE2EIT.java
@@ -53,14 +53,10 @@ class RQLE2EIT implements SQLE2EIT {
private SQLE2EEnvironmentEngine environmentEngine;
- @ParameterizedTest(name = "{0}")
+ @ParameterizedTest(name = "{0}", allowZeroInvocations = true)
@EnabledIf("isEnabled")
@ArgumentsSource(SQLE2EITArgumentsProvider.class)
void assertExecute(final AssertionTestParameter testParam) throws
SQLException {
- // TODO make sure test case can not be null
- if (null == testParam.getTestCaseContext()) {
- return;
- }
SQLE2EITContext context = new SQLE2EITContext(testParam);
assertExecute(context);
}
diff --git
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dal/DALE2EIT.java
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dal/DALE2EIT.java
index 3952ee25502..476292ba9c7 100644
---
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dal/DALE2EIT.java
+++
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dal/DALE2EIT.java
@@ -58,14 +58,10 @@ class DALE2EIT implements SQLE2EIT {
private SQLE2EEnvironmentEngine environmentEngine;
- @ParameterizedTest(name = "{0}")
+ @ParameterizedTest(name = "{0}", allowZeroInvocations = true)
@EnabledIf("isEnabled")
@ArgumentsSource(SQLE2EITArgumentsProvider.class)
void assertExecute(final AssertionTestParameter testParam) throws
SQLException {
- // TODO make sure test case can not be null
- if (null == testParam.getTestCaseContext()) {
- return;
- }
SQLE2EITContext context = new SQLE2EITContext(testParam);
assertExecute(context);
}
diff --git
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dcl/DCLE2EIT.java
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dcl/DCLE2EIT.java
index 2c39d6363a3..d1c7141d90e 100644
---
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dcl/DCLE2EIT.java
+++
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dcl/DCLE2EIT.java
@@ -46,14 +46,10 @@ class DCLE2EIT implements SQLE2EIT {
private SQLE2EEnvironmentEngine environmentEngine;
- @ParameterizedTest(name = "{0}")
+ @ParameterizedTest(name = "{0}", allowZeroInvocations = true)
@EnabledIf("isEnabled")
@ArgumentsSource(SQLE2EITArgumentsProvider.class)
void assertExecuteUpdate(final AssertionTestParameter testParam) throws
SQLException, JAXBException, IOException {
- // TODO make sure test case can not be null
- if (null == testParam.getTestCaseContext()) {
- return;
- }
SQLE2EITContext context = new SQLE2EITContext(testParam);
try (
AuthorityEnvironmentManager ignored = new
AuthorityEnvironmentManager(
@@ -77,14 +73,10 @@ class DCLE2EIT implements SQLE2EIT {
}
}
- @ParameterizedTest(name = "{0}")
+ @ParameterizedTest(name = "{0}", allowZeroInvocations = true)
@EnabledIf("isEnabled")
@ArgumentsSource(SQLE2EITArgumentsProvider.class)
void assertExecute(final AssertionTestParameter testParam) throws
SQLException, JAXBException, IOException {
- // TODO make sure test case can not be null
- if (null == testParam.getTestCaseContext()) {
- return;
- }
SQLE2EITContext context = new SQLE2EITContext(testParam);
try (
AuthorityEnvironmentManager ignored = new
AuthorityEnvironmentManager(
diff --git
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/ddl/DDLE2EIT.java
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/ddl/DDLE2EIT.java
index 566ad539d8e..ffb7e1e1c38 100644
---
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/ddl/DDLE2EIT.java
+++
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/ddl/DDLE2EIT.java
@@ -83,14 +83,10 @@ class DDLE2EIT implements SQLE2EIT {
private SQLE2EEnvironmentEngine environmentEngine;
- @ParameterizedTest(name = "{0}")
+ @ParameterizedTest(name = "{0}", allowZeroInvocations = true)
@EnabledIf("isEnabled")
@ArgumentsSource(SQLE2EITArgumentsProvider.class)
void assertExecuteUpdate(final AssertionTestParameter testParam) throws
SQLException {
- // TODO make sure test case can not be null
- if (null == testParam.getTestCaseContext()) {
- return;
- }
SQLE2EITContext context = new SQLE2EITContext(testParam);
init(testParam, context);
try (Connection connection =
environmentEngine.getTargetDataSource().getConnection()) {
@@ -117,14 +113,10 @@ class DDLE2EIT implements SQLE2EIT {
}
}
- @ParameterizedTest(name = "{0}")
+ @ParameterizedTest(name = "{0}", allowZeroInvocations = true)
@EnabledIf("isEnabled")
@ArgumentsSource(SQLE2EITArgumentsProvider.class)
void assertExecute(final AssertionTestParameter testParam) throws
Exception {
- // TODO make sure test case can not be null
- if (null == testParam.getTestCaseContext()) {
- return;
- }
SQLE2EITContext context = new SQLE2EITContext(testParam);
init(testParam, context);
try (Connection connection =
environmentEngine.getTargetDataSource().getConnection()) {
diff --git
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dml/AdditionalDMLE2EIT.java
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dml/AdditionalDMLE2EIT.java
index 66b00a48ae2..c52e8271abc 100644
---
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dml/AdditionalDMLE2EIT.java
+++
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dml/AdditionalDMLE2EIT.java
@@ -43,14 +43,10 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
@SQLE2EITSettings(SQLCommandType.DML)
class AdditionalDMLE2EIT extends BaseDMLE2EIT {
- @ParameterizedTest(name = "{0}")
+ @ParameterizedTest(name = "{0}", allowZeroInvocations = true)
@EnabledIf("isEnabled")
@ArgumentsSource(SQLE2EITArgumentsProvider.class)
void assertExecuteUpdateWithAutoGeneratedKeys(final AssertionTestParameter
testParam) throws SQLException, JAXBException, IOException {
- // TODO make sure test case can not be null
- if (null == testParam.getTestCaseContext()) {
- return;
- }
if (isPostgreSQLOrOpenGauss(testParam.getDatabaseType().getType()) ||
isOracleInsertStatement(testParam.getDatabaseType().getType(),
testParam.getTestCaseContext().getTestCase().getSql())) {
return;
}
@@ -112,7 +108,7 @@ class AdditionalDMLE2EIT extends BaseDMLE2EIT {
// TODO
@Disabled("support execute update with column indexes in #23626")
- @ParameterizedTest(name = "{0}")
+ @ParameterizedTest(name = "{0}", allowZeroInvocations = true)
@EnabledIf("isEnabled")
@ArgumentsSource(SQLE2EITArgumentsProvider.class)
void assertExecuteUpdateWithColumnIndexes(final AssertionTestParameter
testParam) throws SQLException, JAXBException, IOException {
@@ -151,7 +147,7 @@ class AdditionalDMLE2EIT extends BaseDMLE2EIT {
// TODO
@Disabled("support execute update with column names in #23626")
- @ParameterizedTest(name = "{0}")
+ @ParameterizedTest(name = "{0}", allowZeroInvocations = true)
@EnabledIf("isEnabled")
@ArgumentsSource(SQLE2EITArgumentsProvider.class)
void assertExecuteUpdateWithColumnNames(final AssertionTestParameter
testParam) throws SQLException, JAXBException, IOException {
@@ -188,14 +184,10 @@ class AdditionalDMLE2EIT extends BaseDMLE2EIT {
}
}
- @ParameterizedTest(name = "{0}")
+ @ParameterizedTest(name = "{0}", allowZeroInvocations = true)
@EnabledIf("isEnabled")
@ArgumentsSource(SQLE2EITArgumentsProvider.class)
void assertExecuteWithoutAutoGeneratedKeys(final AssertionTestParameter
testParam) throws SQLException, JAXBException, IOException {
- // TODO make sure test case can not be null
- if (null == testParam.getTestCaseContext()) {
- return;
- }
if (isPostgreSQLOrOpenGauss(testParam.getDatabaseType().getType())) {
return;
}
@@ -231,14 +223,10 @@ class AdditionalDMLE2EIT extends BaseDMLE2EIT {
}
}
- @ParameterizedTest(name = "{0}")
+ @ParameterizedTest(name = "{0}", allowZeroInvocations = true)
@EnabledIf("isEnabled")
@ArgumentsSource(SQLE2EITArgumentsProvider.class)
void assertExecuteWithAutoGeneratedKeys(final AssertionTestParameter
testParam) throws SQLException, JAXBException, IOException {
- // TODO make sure test case can not be null
- if (null == testParam.getTestCaseContext()) {
- return;
- }
if (isPostgreSQLOrOpenGauss(testParam.getDatabaseType().getType()) ||
isOracleInsertStatement(testParam.getDatabaseType().getType(),
testParam.getTestCaseContext().getTestCase().getSql())) {
return;
}
@@ -280,7 +268,7 @@ class AdditionalDMLE2EIT extends BaseDMLE2EIT {
// TODO
@Disabled("support execute with column indexes in #23626")
- @ParameterizedTest(name = "{0}")
+ @ParameterizedTest(name = "{0}", allowZeroInvocations = true)
@EnabledIf("isEnabled")
@ArgumentsSource(SQLE2EITArgumentsProvider.class)
void assertExecuteWithColumnIndexes(final AssertionTestParameter
testParam) throws SQLException, JAXBException, IOException {
@@ -321,7 +309,7 @@ class AdditionalDMLE2EIT extends BaseDMLE2EIT {
// TODO
@Disabled("support execute with column names in #23626")
- @ParameterizedTest(name = "{0}")
+ @ParameterizedTest(name = "{0}", allowZeroInvocations = true)
@EnabledIf("isEnabled")
@ArgumentsSource(SQLE2EITArgumentsProvider.class)
void assertExecuteWithColumnNames(final AssertionTestParameter testParam)
throws SQLException, JAXBException, IOException {
diff --git
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dml/BaseDMLE2EIT.java
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dml/BaseDMLE2EIT.java
index d2cd78bd6f8..2a6122d7615 100644
---
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dml/BaseDMLE2EIT.java
+++
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dml/BaseDMLE2EIT.java
@@ -111,10 +111,7 @@ public abstract class BaseDMLE2EIT implements SQLE2EIT {
}
void tearDown() {
- // TODO make sure test case can not be null
- if (null != dataSetEnvironmentManager) {
- dataSetEnvironmentManager.cleanData(resetTableNames);
- }
+ dataSetEnvironmentManager.cleanData(resetTableNames);
}
private DataSet getDataSet(final int[] actualUpdateCounts, final
Collection<DataSet> dataSets, final String sql) {
diff --git
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dml/BatchDMLE2EIT.java
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dml/BatchDMLE2EIT.java
index 3fd1552c594..220223940b2 100644
---
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dml/BatchDMLE2EIT.java
+++
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dml/BatchDMLE2EIT.java
@@ -40,14 +40,10 @@ import static org.hamcrest.MatcherAssert.assertThat;
@SQLE2EITSettings(value = SQLCommandType.DML, batch = true)
class BatchDMLE2EIT extends BaseDMLE2EIT {
- @ParameterizedTest(name = "{0}")
+ @ParameterizedTest(name = "{0}", allowZeroInvocations = true)
@EnabledIf("isEnabled")
@ArgumentsSource(SQLE2EITArgumentsProvider.class)
void assertExecuteBatch(final CaseTestParameter testParam) throws
SQLException, JAXBException, IOException {
- // TODO make sure test case can not be null
- if (null == testParam.getTestCaseContext()) {
- return;
- }
init(testParam);
try {
int[] actualUpdateCounts;
@@ -98,14 +94,10 @@ class BatchDMLE2EIT extends BaseDMLE2EIT {
preparedStatement.addBatch();
}
- @ParameterizedTest(name = "{0}")
+ @ParameterizedTest(name = "{0}", allowZeroInvocations = true)
@EnabledIf("isEnabled")
@ArgumentsSource(SQLE2EITArgumentsProvider.class)
- void assertClearBatch(final CaseTestParameter testParam) throws
SQLException, JAXBException, IOException {
- // TODO make sure test case can not be null
- if (null == testParam.getTestCaseContext()) {
- return;
- }
+ void assertClearBatch(final CaseTestParameter testParam) throws
SQLException {
try (
Connection connection =
getEnvironmentEngine().getTargetDataSource().getConnection();
PreparedStatement preparedStatement =
connection.prepareStatement(testParam.getTestCaseContext().getTestCase().getSql()))
{
diff --git
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dml/GeneralDMLE2EIT.java
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dml/GeneralDMLE2EIT.java
index df9ae44414d..55d2b0c9363 100644
---
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dml/GeneralDMLE2EIT.java
+++
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dml/GeneralDMLE2EIT.java
@@ -41,14 +41,10 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
@SQLE2EITSettings(SQLCommandType.DML)
class GeneralDMLE2EIT extends BaseDMLE2EIT {
- @ParameterizedTest(name = "{0}")
+ @ParameterizedTest(name = "{0}", allowZeroInvocations = true)
@EnabledIf("isEnabled")
@ArgumentsSource(SQLE2EITArgumentsProvider.class)
void assertExecuteUpdate(final AssertionTestParameter testParam) throws
SQLException, JAXBException, IOException {
- // TODO make sure test case can not be null
- if (null == testParam.getTestCaseContext()) {
- return;
- }
SQLE2EITContext context = new SQLE2EITContext(testParam);
init(testParam);
try {
@@ -89,14 +85,10 @@ class GeneralDMLE2EIT extends BaseDMLE2EIT {
}
}
- @ParameterizedTest(name = "{0}")
+ @ParameterizedTest(name = "{0}", allowZeroInvocations = true)
@EnabledIf("isEnabled")
@ArgumentsSource(SQLE2EITArgumentsProvider.class)
void assertExecute(final AssertionTestParameter testParam) throws
SQLException, JAXBException, IOException {
- // TODO make sure test case can not be null
- if (null == testParam.getTestCaseContext()) {
- return;
- }
SQLE2EITContext context = new SQLE2EITContext(testParam);
init(testParam);
try {
diff --git
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dql/AdditionalDQLE2EIT.java
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dql/AdditionalDQLE2EIT.java
index b02b97ff190..05eb6c28b97 100644
---
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dql/AdditionalDQLE2EIT.java
+++
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dql/AdditionalDQLE2EIT.java
@@ -45,54 +45,38 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
@SQLE2EITSettings(SQLCommandType.DQL)
class AdditionalDQLE2EIT extends BaseDQLE2EIT {
- @ParameterizedTest(name = "{0}")
+ @ParameterizedTest(name = "{0}", allowZeroInvocations = true)
@Execution(ExecutionMode.CONCURRENT)
@EnabledIf("isEnabled")
@ArgumentsSource(SQLE2EITArgumentsProvider.class)
void assertExecuteQueryWithResultSetTypeAndConcurrency(final
AssertionTestParameter testParam) throws SQLException, JAXBException,
IOException {
- // TODO make sure test case can not be null
- if (null == testParam.getTestCaseContext()) {
- return;
- }
SQLE2EITContext context = new SQLE2EITContext(testParam);
executeDQL(context, () ->
assertExecuteQueryWithResultSetTypes(testParam, context,
ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY));
}
- @ParameterizedTest(name = "{0}")
+ @ParameterizedTest(name = "{0}", allowZeroInvocations = true)
@Execution(ExecutionMode.CONCURRENT)
@EnabledIf("isEnabled")
@ArgumentsSource(SQLE2EITArgumentsProvider.class)
void assertExecuteQueryWithResultSetTypeAndConcurrencyAndHoldability(final
AssertionTestParameter testParam) throws SQLException, JAXBException,
IOException {
- // TODO make sure test case can not be null
- if (null == testParam.getTestCaseContext()) {
- return;
- }
SQLE2EITContext context = new SQLE2EITContext(testParam);
executeDQL(context, () ->
assertExecuteQueryWithResultSetTypes(testParam, context,
ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY,
ResultSet.HOLD_CURSORS_OVER_COMMIT));
}
- @ParameterizedTest(name = "{0}")
+ @ParameterizedTest(name = "{0}", allowZeroInvocations = true)
@Execution(ExecutionMode.CONCURRENT)
@EnabledIf("isEnabled")
@ArgumentsSource(SQLE2EITArgumentsProvider.class)
void assertExecuteWithResultSetTypeAndConcurrency(final
AssertionTestParameter testParam) throws SQLException, JAXBException,
IOException {
- // TODO make sure test case can not be null
- if (null == testParam.getTestCaseContext()) {
- return;
- }
SQLE2EITContext context = new SQLE2EITContext(testParam);
executeDQL(context, () -> assertExecuteWithResultSetTypes(testParam,
context, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY));
}
- @ParameterizedTest(name = "{0}")
+ @ParameterizedTest(name = "{0}", allowZeroInvocations = true)
@Execution(ExecutionMode.CONCURRENT)
@EnabledIf("isEnabled")
@ArgumentsSource(SQLE2EITArgumentsProvider.class)
void assertExecuteWithResultSetTypeAndConcurrencyAndHoldability(final
AssertionTestParameter testParam) throws SQLException, JAXBException,
IOException {
- // TODO make sure test case can not be null
- if (null == testParam.getTestCaseContext()) {
- return;
- }
SQLE2EITContext context = new SQLE2EITContext(testParam);
executeDQL(context, () -> assertExecuteWithResultSetTypes(testParam,
context, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY,
ResultSet.HOLD_CURSORS_OVER_COMMIT));
}
diff --git
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dql/GeneralDQLE2EIT.java
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dql/GeneralDQLE2EIT.java
index cbb60ed12b3..5ceb68de638 100644
---
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dql/GeneralDQLE2EIT.java
+++
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/dql/GeneralDQLE2EIT.java
@@ -44,15 +44,11 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
@SQLE2EITSettings(SQLCommandType.DQL)
class GeneralDQLE2EIT extends BaseDQLE2EIT {
- @ParameterizedTest(name = "{0}")
+ @ParameterizedTest(name = "{0}", allowZeroInvocations = true)
@Execution(ExecutionMode.CONCURRENT)
@EnabledIf("isEnabled")
@ArgumentsSource(SQLE2EITArgumentsProvider.class)
void assertExecuteQuery(final AssertionTestParameter testParam) throws
SQLException, IOException, JAXBException {
- // TODO make sure test case can not be null
- if (null == testParam.getTestCaseContext()) {
- return;
- }
SQLE2EITContext context = new SQLE2EITContext(testParam);
executeDQL(context, () -> {
init(testParam, context);
@@ -148,15 +144,11 @@ class GeneralDQLE2EIT extends BaseDQLE2EIT {
}
}
- @ParameterizedTest(name = "{0}")
+ @ParameterizedTest(name = "{0}", allowZeroInvocations = true)
@Execution(ExecutionMode.CONCURRENT)
@EnabledIf("isEnabled")
@ArgumentsSource(SQLE2EITArgumentsProvider.class)
void assertExecute(final AssertionTestParameter testParam) throws
SQLException, JAXBException, IOException {
- // TODO make sure test case can not be null
- if (null == testParam.getTestCaseContext()) {
- return;
- }
SQLE2EITContext context = new SQLE2EITContext(testParam);
executeDQL(context, () -> {
init(testParam, context);