This is an automated email from the ASF dual-hosted git repository.
sunnianjun 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 c749820ef26 Rename E2ETestCases for log module (#32181)
c749820ef26 is described below
commit c749820ef26bee21113479506eed6032bf4ebe79
Author: Liang Zhang <[email protected]>
AuthorDate: Thu Jul 18 20:30:40 2024 +0800
Rename E2ETestCases for log module (#32181)
---
.../test/e2e/agent/file/FilePluginE2EIT.java | 4 +--
...IntegrationTestCases.java => E2ETestCases.java} | 6 ++--
...estCasesLoader.java => E2ETestCasesLoader.java} | 34 +++++++++++-----------
.../file/src/test/resources/cases/jdbc/logs.xml | 4 +--
.../file/src/test/resources/cases/proxy/logs.xml | 4 +--
5 files changed, 26 insertions(+), 26 deletions(-)
diff --git
a/test/e2e/agent/plugins/logging/file/src/test/java/org/apache/shardingsphere/test/e2e/agent/file/FilePluginE2EIT.java
b/test/e2e/agent/plugins/logging/file/src/test/java/org/apache/shardingsphere/test/e2e/agent/file/FilePluginE2EIT.java
index 7452b61a9f8..234884efeab 100644
---
a/test/e2e/agent/plugins/logging/file/src/test/java/org/apache/shardingsphere/test/e2e/agent/file/FilePluginE2EIT.java
+++
b/test/e2e/agent/plugins/logging/file/src/test/java/org/apache/shardingsphere/test/e2e/agent/file/FilePluginE2EIT.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.test.e2e.agent.file;
import
org.apache.shardingsphere.test.e2e.agent.common.AgentTestActionExtension;
import org.apache.shardingsphere.test.e2e.agent.common.env.E2ETestEnvironment;
import org.apache.shardingsphere.test.e2e.agent.file.asserts.ContentAssert;
-import
org.apache.shardingsphere.test.e2e.agent.file.cases.IntegrationTestCasesLoader;
+import org.apache.shardingsphere.test.e2e.agent.file.cases.E2ETestCasesLoader;
import org.apache.shardingsphere.test.e2e.agent.file.cases.LogTestCase;
import org.junit.jupiter.api.condition.EnabledIf;
import org.junit.jupiter.api.extension.ExtendWith;
@@ -53,7 +53,7 @@ class FilePluginE2EIT {
@Override
public Stream<? extends Arguments> provideArguments(final
ExtensionContext extensionContext) {
- return
IntegrationTestCasesLoader.getInstance().loadIntegrationTestCases(E2ETestEnvironment.getInstance().getAdapter()).stream().map(Arguments::of);
+ return
E2ETestCasesLoader.getInstance().loadTestCases(E2ETestEnvironment.getInstance().getAdapter()).stream().map(Arguments::of);
}
}
}
diff --git
a/test/e2e/agent/plugins/logging/file/src/test/java/org/apache/shardingsphere/test/e2e/agent/file/cases/IntegrationTestCases.java
b/test/e2e/agent/plugins/logging/file/src/test/java/org/apache/shardingsphere/test/e2e/agent/file/cases/E2ETestCases.java
similarity index 90%
rename from
test/e2e/agent/plugins/logging/file/src/test/java/org/apache/shardingsphere/test/e2e/agent/file/cases/IntegrationTestCases.java
rename to
test/e2e/agent/plugins/logging/file/src/test/java/org/apache/shardingsphere/test/e2e/agent/file/cases/E2ETestCases.java
index 8a34cda4456..b26dac9c2f8 100644
---
a/test/e2e/agent/plugins/logging/file/src/test/java/org/apache/shardingsphere/test/e2e/agent/file/cases/IntegrationTestCases.java
+++
b/test/e2e/agent/plugins/logging/file/src/test/java/org/apache/shardingsphere/test/e2e/agent/file/cases/E2ETestCases.java
@@ -25,11 +25,11 @@ import java.util.Collection;
import java.util.LinkedList;
/**
- * Integration test cases.
+ * E2E test cases.
*/
-@XmlRootElement(name = "integration-test-cases")
+@XmlRootElement(name = "e2e-test-cases")
@Getter
-public final class IntegrationTestCases {
+public final class E2ETestCases {
@XmlElement(name = "test-case")
private final Collection<LogTestCase> testCases = new LinkedList<>();
diff --git
a/test/e2e/agent/plugins/logging/file/src/test/java/org/apache/shardingsphere/test/e2e/agent/file/cases/IntegrationTestCasesLoader.java
b/test/e2e/agent/plugins/logging/file/src/test/java/org/apache/shardingsphere/test/e2e/agent/file/cases/E2ETestCasesLoader.java
similarity index 71%
rename from
test/e2e/agent/plugins/logging/file/src/test/java/org/apache/shardingsphere/test/e2e/agent/file/cases/IntegrationTestCasesLoader.java
rename to
test/e2e/agent/plugins/logging/file/src/test/java/org/apache/shardingsphere/test/e2e/agent/file/cases/E2ETestCasesLoader.java
index 90cc1d42301..dd5192166d0 100644
---
a/test/e2e/agent/plugins/logging/file/src/test/java/org/apache/shardingsphere/test/e2e/agent/file/cases/IntegrationTestCasesLoader.java
+++
b/test/e2e/agent/plugins/logging/file/src/test/java/org/apache/shardingsphere/test/e2e/agent/file/cases/E2ETestCasesLoader.java
@@ -39,44 +39,44 @@ import java.util.LinkedList;
import java.util.Objects;
/**
- * Integration test cases loader.
+ * E2E test cases loader.
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
-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 Collection<LogTestCase> integrationTestCases;
+ private Collection<LogTestCase> testCases;
/**
* Get singleton instance.
*
* @return singleton instance
*/
- public static IntegrationTestCasesLoader getInstance() {
+ public static E2ETestCasesLoader getInstance() {
return INSTANCE;
}
/**
- * Load integration test cases.
+ * Load test cases.
*
- * @param adapter adapter proxy or jdbc
- * @return integration test cases
+ * @param adapter adapter proxy or JDBC
+ * @return test cases
*/
@SneakyThrows({IOException.class, URISyntaxException.class,
JAXBException.class})
- public Collection<LogTestCase> loadIntegrationTestCases(final String
adapter) {
- if (null != integrationTestCases) {
- return integrationTestCases;
+ public Collection<LogTestCase> loadTestCases(final String adapter) {
+ if (null != testCases) {
+ return testCases;
}
- integrationTestCases = new LinkedList<>();
+ testCases = new LinkedList<>();
URL url =
Objects.requireNonNull(Thread.currentThread().getContextClassLoader().getResource(String.format("cases/%s",
adapter)));
Collection<File> files = getFiles(url);
for (File each : files) {
-
integrationTestCases.addAll(unmarshal(each.getPath()).getTestCases());
+ testCases.addAll(unmarshal(each.getPath()).getTestCases());
}
- return integrationTestCases;
+ return testCases;
}
private Collection<File> getFiles(final URL url) throws IOException,
URISyntaxException {
@@ -94,9 +94,9 @@ public final class IntegrationTestCasesLoader {
return result;
}
- private IntegrationTestCases unmarshal(final String integrateCasesFile)
throws IOException, JAXBException {
- try (FileReader reader = new FileReader(integrateCasesFile)) {
- return (IntegrationTestCases)
JAXBContext.newInstance(IntegrationTestCases.class).createUnmarshaller().unmarshal(reader);
+ private E2ETestCases unmarshal(final String e2eCasesFile) throws
IOException, JAXBException {
+ try (FileReader reader = new FileReader(e2eCasesFile)) {
+ return (E2ETestCases)
JAXBContext.newInstance(E2ETestCases.class).createUnmarshaller().unmarshal(reader);
}
}
}
diff --git
a/test/e2e/agent/plugins/logging/file/src/test/resources/cases/jdbc/logs.xml
b/test/e2e/agent/plugins/logging/file/src/test/resources/cases/jdbc/logs.xml
index 1185024ba01..47e28444c95 100644
--- a/test/e2e/agent/plugins/logging/file/src/test/resources/cases/jdbc/logs.xml
+++ b/test/e2e/agent/plugins/logging/file/src/test/resources/cases/jdbc/logs.xml
@@ -16,6 +16,6 @@
~ limitations under the License.
-->
-<integration-test-cases>
+<e2e-test-cases>
<test-case log-regex="Build meta data contexts finished,
cost\s(?=[1-9]+\d*)"/>
-</integration-test-cases>
+</e2e-test-cases>
diff --git
a/test/e2e/agent/plugins/logging/file/src/test/resources/cases/proxy/logs.xml
b/test/e2e/agent/plugins/logging/file/src/test/resources/cases/proxy/logs.xml
index 1185024ba01..47e28444c95 100644
---
a/test/e2e/agent/plugins/logging/file/src/test/resources/cases/proxy/logs.xml
+++
b/test/e2e/agent/plugins/logging/file/src/test/resources/cases/proxy/logs.xml
@@ -16,6 +16,6 @@
~ limitations under the License.
-->
-<integration-test-cases>
+<e2e-test-cases>
<test-case log-regex="Build meta data contexts finished,
cost\s(?=[1-9]+\d*)"/>
-</integration-test-cases>
+</e2e-test-cases>