This is an automated email from the ASF dual-hosted git repository.
zhangliang 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 009f9734812 Move delayAssertionSeconds logic to BaseDQLE2EIT (#32119)
009f9734812 is described below
commit 009f9734812bff3a9010a63b0e3f2ec3c17e2568
Author: Liang Zhang <[email protected]>
AuthorDate: Mon Jul 15 23:20:20 2024 +0800
Move delayAssertionSeconds logic to BaseDQLE2EIT (#32119)
---
.../test/e2e/cases/assertion/IntegrationTestCase.java | 4 ++--
.../shardingsphere/test/e2e/engine/type/dql/BaseDQLE2EIT.java | 6 ++++++
.../shardingsphere/test/e2e/engine/type/dql/GeneralDQLE2EIT.java | 9 ---------
3 files changed, 8 insertions(+), 11 deletions(-)
diff --git
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/cases/assertion/IntegrationTestCase.java
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/cases/assertion/IntegrationTestCase.java
index cf32ed79646..57165940913 100644
---
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/cases/assertion/IntegrationTestCase.java
+++
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/cases/assertion/IntegrationTestCase.java
@@ -30,9 +30,9 @@ import java.util.LinkedList;
/**
* JAXB definition of integration test case.
*/
+@XmlAccessorType(XmlAccessType.FIELD)
@Getter
@Setter
-@XmlAccessorType(XmlAccessType.FIELD)
public final class IntegrationTestCase {
@XmlAttribute(name = "sql")
@@ -51,7 +51,7 @@ public final class IntegrationTestCase {
private String adapters;
@XmlAttribute(name = "delay-assertion-seconds")
- private Integer delayAssertionSeconds;
+ private int delayAssertionSeconds;
@XmlAttribute(name = "smoke")
private boolean smoke;
diff --git
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/engine/type/dql/BaseDQLE2EIT.java
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/engine/type/dql/BaseDQLE2EIT.java
index 40cdf55f78c..2fc178521a7 100644
---
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/engine/type/dql/BaseDQLE2EIT.java
+++
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/engine/type/dql/BaseDQLE2EIT.java
@@ -28,6 +28,7 @@ import
org.apache.shardingsphere.test.e2e.env.DataSetEnvironmentManager;
import
org.apache.shardingsphere.test.e2e.env.runtime.scenario.path.ScenarioDataPath;
import
org.apache.shardingsphere.test.e2e.env.runtime.scenario.path.ScenarioDataPath.Type;
import
org.apache.shardingsphere.test.e2e.framework.param.model.AssertionTestParameter;
+import org.testcontainers.shaded.org.awaitility.Awaitility;
import javax.sql.DataSource;
import javax.xml.bind.JAXBException;
@@ -39,11 +40,13 @@ import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.sql.Types;
+import java.time.Duration;
import java.time.LocalDateTime;
import java.util.Collection;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
+import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import static org.hamcrest.CoreMatchers.is;
@@ -66,6 +69,9 @@ public abstract class BaseDQLE2EIT {
?
getFirstExpectedDataSource(containerComposer.getExpectedDataSourceMap().values())
:
containerComposer.getExpectedDataSourceMap().get(containerComposer.getAssertion().getExpectedDataSourceName());
useXMLAsExpectedDataset = null !=
containerComposer.getAssertion().getExpectedDataFile();
+ if (0 !=
testParam.getTestCaseContext().getTestCase().getDelayAssertionSeconds()) {
+
Awaitility.await().atMost(Duration.ofMinutes(5L)).pollDelay(testParam.getTestCaseContext().getTestCase().getDelayAssertionSeconds(),
TimeUnit.SECONDS).until(() -> true);
+ }
}
private void fillDataOnlyOnce(final AssertionTestParameter testParam,
final SingleE2EContainerComposer containerComposer) throws IOException,
JAXBException {
diff --git
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/engine/type/dql/GeneralDQLE2EIT.java
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/engine/type/dql/GeneralDQLE2EIT.java
index fd82de46992..eace11a53b8 100644
---
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/engine/type/dql/GeneralDQLE2EIT.java
+++
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/engine/type/dql/GeneralDQLE2EIT.java
@@ -28,7 +28,6 @@ import
org.apache.shardingsphere.test.e2e.framework.param.model.AssertionTestPar
import org.junit.jupiter.api.condition.EnabledIf;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ArgumentsSource;
-import org.testcontainers.shaded.org.awaitility.Awaitility;
import javax.xml.bind.JAXBException;
import java.io.IOException;
@@ -37,8 +36,6 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
-import java.time.Duration;
-import java.util.concurrent.TimeUnit;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -55,9 +52,6 @@ class GeneralDQLE2EIT extends BaseDQLE2EIT {
}
SingleE2EContainerComposer containerComposer = new
SingleE2EContainerComposer(testParam);
init(testParam, containerComposer);
- if (null !=
testParam.getTestCaseContext().getTestCase().getDelayAssertionSeconds()) {
-
Awaitility.await().atMost(Duration.ofMinutes(5L)).pollDelay(testParam.getTestCaseContext().getTestCase().getDelayAssertionSeconds(),
TimeUnit.SECONDS).until(() -> true);
- }
if (isUseXMLAsExpectedDataset()) {
assertExecuteQueryWithXmlExpected(testParam, containerComposer);
} else {
@@ -129,9 +123,6 @@ class GeneralDQLE2EIT extends BaseDQLE2EIT {
}
SingleE2EContainerComposer containerComposer = new
SingleE2EContainerComposer(testParam);
init(testParam, containerComposer);
- if (null !=
testParam.getTestCaseContext().getTestCase().getDelayAssertionSeconds()) {
-
Awaitility.await().atMost(Duration.ofMinutes(5L)).pollDelay(testParam.getTestCaseContext().getTestCase().getDelayAssertionSeconds(),
TimeUnit.SECONDS).until(() -> true);
- }
if (isUseXMLAsExpectedDataset()) {
assertExecuteWithXmlExpected(testParam, containerComposer);
} else {