This is an automated email from the ASF dual-hosted git repository.
jianglongtao 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 e1c032f1626 Rename E2ETestCasesLoader (#32173)
e1c032f1626 is described below
commit e1c032f16264818507d84da1918ceb9bf7e889e9
Author: Liang Zhang <[email protected]>
AuthorDate: Thu Jul 18 19:03:05 2024 +0800
Rename E2ETestCasesLoader (#32173)
---
...estCasesLoader.java => E2ETestCasesLoader.java} | 28 +++++++++++-----------
...estCaseContext.java => E2ETestCaseContext.java} | 4 ++--
.../param/array/E2ETestParameterGenerator.java | 28 +++++++++++-----------
.../param/model/AssertionTestParameter.java | 4 ++--
.../framework/param/model/CaseTestParameter.java | 4 ++--
.../framework/param/model/E2ETestParameter.java | 4 ++--
6 files changed, 36 insertions(+), 36 deletions(-)
diff --git
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/cases/IntegrationTestCasesLoader.java
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/cases/E2ETestCasesLoader.java
similarity index 74%
rename from
test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/cases/IntegrationTestCasesLoader.java
rename to
test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/cases/E2ETestCasesLoader.java
index 3b93e8916c2..7e222b919d5 100644
---
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/cases/IntegrationTestCasesLoader.java
+++
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/cases/E2ETestCasesLoader.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.test.e2e.cases;
import com.google.common.base.Preconditions;
import lombok.SneakyThrows;
-import
org.apache.shardingsphere.test.e2e.cases.casse.IntegrationTestCaseContext;
+import org.apache.shardingsphere.test.e2e.cases.casse.E2ETestCaseContext;
import org.apache.shardingsphere.test.e2e.framework.type.SQLCommandType;
import javax.xml.bind.JAXBContext;
@@ -43,45 +43,45 @@ import java.util.Objects;
import java.util.stream.Collectors;
/**
- * Integration test cases loader.
+ * E2E test cases loader.
*/
-public final class IntegrationTestCasesLoader {
+public final class E2ETestCasesLoader {
private static final String FILE_EXTENSION = ".xml";
- private static final IntegrationTestCasesLoader INSTANCE = new
IntegrationTestCasesLoader();
+ private static final E2ETestCasesLoader INSTANCE = new
E2ETestCasesLoader();
- private final Map<SQLCommandType, Collection<IntegrationTestCaseContext>>
testCaseContexts = new LinkedHashMap<>();
+ private final Map<SQLCommandType, Collection<E2ETestCaseContext>>
testCaseContexts = new LinkedHashMap<>();
/**
* Get singleton instance.
*
* @return singleton instance
*/
- public static IntegrationTestCasesLoader getInstance() {
+ public static E2ETestCasesLoader getInstance() {
return INSTANCE;
}
/**
- * Get integration test case contexts.
+ * Get E2E test case contexts.
*
* @param sqlCommandType SQL command type
- * @return integration test case contexts
+ * @return E2E test case contexts
*/
- public Collection<IntegrationTestCaseContext> getTestCaseContexts(final
SQLCommandType sqlCommandType) {
+ public Collection<E2ETestCaseContext> getTestCaseContexts(final
SQLCommandType sqlCommandType) {
return testCaseContexts.computeIfAbsent(sqlCommandType,
this::loadIntegrationTestCaseContexts);
}
@SneakyThrows({IOException.class, URISyntaxException.class,
JAXBException.class})
- private Collection<IntegrationTestCaseContext>
loadIntegrationTestCaseContexts(final SQLCommandType sqlCommandType) {
+ private Collection<E2ETestCaseContext>
loadIntegrationTestCaseContexts(final SQLCommandType sqlCommandType) {
URL url =
Objects.requireNonNull(Thread.currentThread().getContextClassLoader().getResource("cases/"));
return loadIntegrationTestCaseContexts(url, sqlCommandType);
}
- private Collection<IntegrationTestCaseContext>
loadIntegrationTestCaseContexts(final URL url, final SQLCommandType
sqlCommandType) throws IOException, URISyntaxException, JAXBException {
+ private Collection<E2ETestCaseContext>
loadIntegrationTestCaseContexts(final URL url, final SQLCommandType
sqlCommandType) throws IOException, URISyntaxException, JAXBException {
Collection<File> files = getFiles(url, sqlCommandType);
Preconditions.checkNotNull(files, "Can not find integration test
cases.");
- Collection<IntegrationTestCaseContext> result = new LinkedList<>();
+ Collection<E2ETestCaseContext> result = new LinkedList<>();
for (File each : files) {
result.addAll(getIntegrationTestCaseContexts(each));
}
@@ -103,8 +103,8 @@ public final class IntegrationTestCasesLoader {
return result;
}
- private Collection<IntegrationTestCaseContext>
getIntegrationTestCaseContexts(final File file) throws IOException,
JAXBException {
- return unmarshal(file.getPath()).getTestCases().stream().map(each ->
new IntegrationTestCaseContext(each,
file.getParent())).collect(Collectors.toList());
+ private Collection<E2ETestCaseContext>
getIntegrationTestCaseContexts(final File file) throws IOException,
JAXBException {
+ return unmarshal(file.getPath()).getTestCases().stream().map(each ->
new E2ETestCaseContext(each, file.getParent())).collect(Collectors.toList());
}
private E2ETestCases unmarshal(final String integrateCasesFile) throws
IOException, JAXBException {
diff --git
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/cases/casse/IntegrationTestCaseContext.java
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/cases/casse/E2ETestCaseContext.java
similarity index 92%
rename from
test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/cases/casse/IntegrationTestCaseContext.java
rename to
test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/cases/casse/E2ETestCaseContext.java
index 1117b6b5582..1814b400a72 100644
---
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/cases/casse/IntegrationTestCaseContext.java
+++
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/cases/casse/E2ETestCaseContext.java
@@ -21,11 +21,11 @@ import lombok.Getter;
import lombok.RequiredArgsConstructor;
/**
- * Integration test case context.
+ * E2E test case context.
*/
@RequiredArgsConstructor
@Getter
-public final class IntegrationTestCaseContext {
+public final class E2ETestCaseContext {
private final E2ETestCase testCase;
diff --git
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/framework/param/array/E2ETestParameterGenerator.java
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/framework/param/array/E2ETestParameterGenerator.java
index 8748d25ef03..dd12548630b 100644
---
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/framework/param/array/E2ETestParameterGenerator.java
+++
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/framework/param/array/E2ETestParameterGenerator.java
@@ -25,8 +25,8 @@ import
org.apache.shardingsphere.distsql.statement.rdl.RDLStatement;
import org.apache.shardingsphere.infra.database.core.type.DatabaseType;
import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;
import
org.apache.shardingsphere.sql.parser.statement.core.statement.SQLStatement;
-import
org.apache.shardingsphere.test.e2e.cases.casse.IntegrationTestCaseContext;
-import org.apache.shardingsphere.test.e2e.cases.IntegrationTestCasesLoader;
+import org.apache.shardingsphere.test.e2e.cases.casse.E2ETestCaseContext;
+import org.apache.shardingsphere.test.e2e.cases.E2ETestCasesLoader;
import org.apache.shardingsphere.test.e2e.framework.type.SQLCommandType;
import org.apache.shardingsphere.test.e2e.framework.type.SQLExecuteType;
import
org.apache.shardingsphere.test.e2e.cases.casse.assertion.E2ETestCaseAssertion;
@@ -46,7 +46,7 @@ import java.util.stream.Collectors;
@RequiredArgsConstructor
public final class E2ETestParameterGenerator {
- private static final IntegrationTestCasesLoader TEST_CASES_LOADER =
IntegrationTestCasesLoader.getInstance();
+ private static final E2ETestCasesLoader TEST_CASES_LOADER =
E2ETestCasesLoader.getInstance();
private final Collection<String> envAdapters;
@@ -66,7 +66,7 @@ public final class E2ETestParameterGenerator {
*/
public Collection<AssertionTestParameter> getAssertionTestParameter(final
SQLCommandType sqlCommandType) {
Collection<AssertionTestParameter> result = new LinkedList<>();
- for (IntegrationTestCaseContext each :
TEST_CASES_LOADER.getTestCaseContexts(sqlCommandType)) {
+ for (E2ETestCaseContext each :
TEST_CASES_LOADER.getTestCaseContexts(sqlCommandType)) {
if (smoke) {
result.addAll(getAssertionTestParameterFilterBySmoke(each,
sqlCommandType));
} else {
@@ -76,7 +76,7 @@ public final class E2ETestParameterGenerator {
return result;
}
- private Collection<AssertionTestParameter> getAssertionTestParameter(final
IntegrationTestCaseContext testCaseContext, final SQLCommandType
sqlCommandType) {
+ private Collection<AssertionTestParameter> getAssertionTestParameter(final
E2ETestCaseContext testCaseContext, final SQLCommandType sqlCommandType) {
Collection<AssertionTestParameter> result = new LinkedList<>();
for (DatabaseType each :
getDatabaseTypes(testCaseContext.getTestCase().getDbTypes())) {
if (envDatabaseTypes.contains(each)) {
@@ -86,7 +86,7 @@ public final class E2ETestParameterGenerator {
return result;
}
- private Collection<AssertionTestParameter> getAssertionTestParameter(final
IntegrationTestCaseContext testCaseContext,
+ private Collection<AssertionTestParameter> getAssertionTestParameter(final
E2ETestCaseContext testCaseContext,
final
DatabaseType databaseType, final SQLCommandType sqlCommandType) {
Collection<AssertionTestParameter> result = new LinkedList<>();
for (SQLExecuteType each : SQLExecuteType.values()) {
@@ -97,7 +97,7 @@ public final class E2ETestParameterGenerator {
return result;
}
- private Collection<AssertionTestParameter> getAssertionTestParameter(final
IntegrationTestCaseContext testCaseContext,
+ private Collection<AssertionTestParameter> getAssertionTestParameter(final
E2ETestCaseContext testCaseContext,
final
DatabaseType databaseType, final SQLExecuteType sqlExecuteType, final
SQLCommandType sqlCommandType) {
Collection<AssertionTestParameter> result = new LinkedList<>();
for (E2ETestCaseAssertion each :
testCaseContext.getTestCase().getAssertions()) {
@@ -106,7 +106,7 @@ public final class E2ETestParameterGenerator {
return result;
}
- private Collection<AssertionTestParameter> getAssertionTestParameter(final
IntegrationTestCaseContext testCaseContext,
+ private Collection<AssertionTestParameter> getAssertionTestParameter(final
E2ETestCaseContext testCaseContext,
final
DatabaseType databaseType, final SQLExecuteType sqlExecuteType,
final
E2ETestCaseAssertion assertion, final SQLCommandType sqlCommandType) {
Collection<AssertionTestParameter> result = new LinkedList<>();
@@ -118,7 +118,7 @@ public final class E2ETestParameterGenerator {
return result;
}
- private Collection<AssertionTestParameter> getAssertionTestParameter(final
IntegrationTestCaseContext testCaseContext, final E2ETestCaseAssertion
assertion,
+ private Collection<AssertionTestParameter> getAssertionTestParameter(final
E2ETestCaseContext testCaseContext, final E2ETestCaseAssertion assertion,
final
String adapter, final DatabaseType databaseType,
final
SQLExecuteType sqlExecuteType, final SQLCommandType sqlCommandType) {
Collection<String> scenarios = null ==
testCaseContext.getTestCase().getScenarioTypes() ? Collections.emptyList() :
Arrays.asList(testCaseContext.getTestCase().getScenarioTypes().split(","));
@@ -126,7 +126,7 @@ public final class E2ETestParameterGenerator {
.map(each -> new AssertionTestParameter(testCaseContext,
assertion, adapter, each, envMode, databaseType, sqlExecuteType,
sqlCommandType)).collect(Collectors.toList());
}
- private Collection<AssertionTestParameter>
getAssertionTestParameterFilterBySmoke(final IntegrationTestCaseContext
testCaseContext, final SQLCommandType sqlCommandType) {
+ private Collection<AssertionTestParameter>
getAssertionTestParameterFilterBySmoke(final E2ETestCaseContext
testCaseContext, final SQLCommandType sqlCommandType) {
Collection<AssertionTestParameter> result = new LinkedList<>();
if (testCaseContext.getTestCase().isSmoke()) {
result.addAll(getAssertionTestParameter(testCaseContext,
sqlCommandType));
@@ -159,13 +159,13 @@ public final class E2ETestParameterGenerator {
*/
public Collection<E2ETestParameter> getCaseTestParameter(final
SQLCommandType sqlCommandType) {
Collection<E2ETestParameter> result = new LinkedList<>();
- for (IntegrationTestCaseContext each :
TEST_CASES_LOADER.getTestCaseContexts(sqlCommandType)) {
+ for (E2ETestCaseContext each :
TEST_CASES_LOADER.getTestCaseContexts(sqlCommandType)) {
result.addAll(getCaseTestParameter(each, sqlCommandType));
}
return result;
}
- private Collection<E2ETestParameter> getCaseTestParameter(final
IntegrationTestCaseContext testCaseContext, final SQLCommandType
sqlCommandType) {
+ private Collection<E2ETestParameter> getCaseTestParameter(final
E2ETestCaseContext testCaseContext, final SQLCommandType sqlCommandType) {
Collection<E2ETestParameter> result = new LinkedList<>();
for (DatabaseType each :
getDatabaseTypes(testCaseContext.getTestCase().getDbTypes())) {
if (envDatabaseTypes.contains(each)) {
@@ -175,7 +175,7 @@ public final class E2ETestParameterGenerator {
return result;
}
- private Collection<E2ETestParameter> getCaseTestParameter(final
IntegrationTestCaseContext testCaseContext, final DatabaseType databaseType,
final SQLCommandType sqlCommandType) {
+ private Collection<E2ETestParameter> getCaseTestParameter(final
E2ETestCaseContext testCaseContext, final DatabaseType databaseType, final
SQLCommandType sqlCommandType) {
Collection<E2ETestParameter> result = new LinkedList<>();
for (String each : envAdapters) {
result.addAll(getCaseTestParameter(testCaseContext, each,
databaseType, sqlCommandType));
@@ -183,7 +183,7 @@ public final class E2ETestParameterGenerator {
return result;
}
- private Collection<E2ETestParameter> getCaseTestParameter(final
IntegrationTestCaseContext testCaseContext, final String adapter,
+ private Collection<E2ETestParameter> getCaseTestParameter(final
E2ETestCaseContext testCaseContext, final String adapter,
final
DatabaseType databaseType, final SQLCommandType sqlCommandType) {
if (null != testCaseContext.getTestCase().getAdapters() &&
!testCaseContext.getTestCase().getAdapters().contains(adapter)) {
return Collections.emptyList();
diff --git
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/framework/param/model/AssertionTestParameter.java
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/framework/param/model/AssertionTestParameter.java
index d70a1f3fc8a..d4ba56af14c 100644
---
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/framework/param/model/AssertionTestParameter.java
+++
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/framework/param/model/AssertionTestParameter.java
@@ -20,7 +20,7 @@ package
org.apache.shardingsphere.test.e2e.framework.param.model;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.infra.database.core.type.DatabaseType;
-import
org.apache.shardingsphere.test.e2e.cases.casse.IntegrationTestCaseContext;
+import org.apache.shardingsphere.test.e2e.cases.casse.E2ETestCaseContext;
import org.apache.shardingsphere.test.e2e.framework.type.SQLCommandType;
import org.apache.shardingsphere.test.e2e.framework.type.SQLExecuteType;
import
org.apache.shardingsphere.test.e2e.cases.casse.assertion.E2ETestCaseAssertion;
@@ -32,7 +32,7 @@ import
org.apache.shardingsphere.test.e2e.cases.casse.assertion.E2ETestCaseAsser
@Getter
public final class AssertionTestParameter implements E2ETestParameter {
- private final IntegrationTestCaseContext testCaseContext;
+ private final E2ETestCaseContext testCaseContext;
private final E2ETestCaseAssertion assertion;
diff --git
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/framework/param/model/CaseTestParameter.java
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/framework/param/model/CaseTestParameter.java
index f5b4aab413d..70b739af2e4 100644
---
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/framework/param/model/CaseTestParameter.java
+++
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/framework/param/model/CaseTestParameter.java
@@ -20,7 +20,7 @@ package
org.apache.shardingsphere.test.e2e.framework.param.model;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.infra.database.core.type.DatabaseType;
-import
org.apache.shardingsphere.test.e2e.cases.casse.IntegrationTestCaseContext;
+import org.apache.shardingsphere.test.e2e.cases.casse.E2ETestCaseContext;
import org.apache.shardingsphere.test.e2e.framework.type.SQLCommandType;
/**
@@ -30,7 +30,7 @@ import
org.apache.shardingsphere.test.e2e.framework.type.SQLCommandType;
@Getter
public final class CaseTestParameter implements E2ETestParameter {
- private final IntegrationTestCaseContext testCaseContext;
+ private final E2ETestCaseContext testCaseContext;
private final String adapter;
diff --git
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/framework/param/model/E2ETestParameter.java
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/framework/param/model/E2ETestParameter.java
index b9b835f3d9b..190a7fd8ca0 100644
---
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/framework/param/model/E2ETestParameter.java
+++
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/framework/param/model/E2ETestParameter.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.test.e2e.framework.param.model;
import org.apache.shardingsphere.infra.database.core.type.DatabaseType;
-import
org.apache.shardingsphere.test.e2e.cases.casse.IntegrationTestCaseContext;
+import org.apache.shardingsphere.test.e2e.cases.casse.E2ETestCaseContext;
import org.apache.shardingsphere.test.e2e.framework.type.SQLCommandType;
/**
@@ -31,7 +31,7 @@ public interface E2ETestParameter {
*
* @return test case context
*/
- IntegrationTestCaseContext getTestCaseContext();
+ E2ETestCaseContext getTestCaseContext();
/**
* Get database type.