You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by me...@apache.org on 2021/09/17 05:51:25 UTC
[shardingsphere] branch master updated: add rdl && rql base it test
(#12477)
This is an automated email from the ASF dual-hosted git repository.
menghaoran 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 62828cd add rdl && rql base it test (#12477)
62828cd is described below
commit 62828cdfee6a24ee0be57e16eb41848979dba079
Author: Jieker <ji...@163.com>
AuthorDate: Fri Sep 17 13:50:48 2021 +0800
add rdl && rql base it test (#12477)
* add rdl && rql base it test
* ci fixed!
* add rdl&&rql env
* modify cases
* add rdl&&rql env
* close rdl test
* little modify
* bug fixded
---
.../test/integration/cases/SQLCommandType.java | 14 +++-
.../assertion/IntegrationTestCaseAssertion.java | 5 +-
...L.java => IntegrationTestCaseAssertionSQL.java} | 2 +-
.../integration/cases/dataset/row/DataSetRow.java | 9 +++
.../test/integration/engine/it/BatchITCase.java | 5 +-
.../test/integration/engine/it/dcl/BaseDCLIT.java | 8 +-
.../test/integration/engine/it/ddl/BaseDDLIT.java | 19 +----
.../test/integration/engine/it/dml/BaseDMLIT.java | 7 +-
.../test/integration/engine/it/dql/BaseDQLIT.java | 4 +-
.../it/{dql/BaseDQLIT.java => rdl/BaseRDLIT.java} | 94 +++++++++++-----------
.../integration/engine/it/rdl/GeneralRDLIT.java | 74 +++++++++++++++++
.../it/{dql/BaseDQLIT.java => rql/BaseRQLIT.java} | 63 +++------------
.../integration/engine/it/rql/GeneralRQLIT.java | 74 +++++++++++++++++
.../cases/rdl/dataset/db/mysql/add_resource.xml | 23 ++++++
.../mysql/add_resource.xml | 23 ++++++
.../mysql/add_resource.xml | 23 ++++++
.../rdl/dataset/encrypt/mysql/add_resource.xml | 23 ++++++
.../readwrite_splitting/mysql/add_resource.xml | 23 ++++++
.../sharding_governance/mysql/add_resource.xml | 23 ++++++
.../cases/rdl/dataset/tbl/mysql/add_resource.xml | 23 ++++++
.../cases/rdl/rdl-integration-test-cases.xml | 24 ++++++
.../cases/rql/dataset/db/mysql/show_resources.xml | 37 +++++++++
.../mysql/show_resources.xml | 47 +++++++++++
.../mysql/show_resources.xml | 47 +++++++++++
.../rql/dataset/encrypt/mysql/show_resources.xml | 28 +++++++
.../readwrite_splitting/mysql/show_resources.xml | 30 +++++++
.../sharding_governance/mysql/show_resources.xml | 28 +++++++
.../cases/rql/dataset/tbl/mysql/show_resources.xml | 28 +++++++
.../cases/rql/rql-integration-test-cases.xml | 21 +++++
29 files changed, 692 insertions(+), 137 deletions(-)
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/cases/SQLCommandType.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/cases/SQLCommandType.java
index f8a5b2d..897303b 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/cases/SQLCommandType.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/cases/SQLCommandType.java
@@ -19,6 +19,8 @@ package org.apache.shardingsphere.test.integration.cases;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.distsql.parser.statement.rdl.RDLStatement;
+import org.apache.shardingsphere.distsql.parser.statement.rql.RQLStatement;
import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatement;
import org.apache.shardingsphere.sql.parser.sql.common.statement.dal.DALStatement;
import org.apache.shardingsphere.sql.parser.sql.common.statement.dcl.DCLStatement;
@@ -70,7 +72,17 @@ public enum SQLCommandType {
/**
* Database control Language.
*/
- DCL(DCLStatement.class, "dcl-integration-test-cases");
+ DCL(DCLStatement.class, "dcl-integration-test-cases"),
+
+ /**
+ * Resource & Rule Query Language.
+ */
+ RQL(RQLStatement.class, "rql-integration-test-cases"),
+
+ /**
+ * Resource & Rule Definition Language.
+ */
+ RDL(RDLStatement.class, "rdl-integration-test-cases");
private final Class<? extends SQLStatement> sqlStatementClass;
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/cases/assertion/IntegrationTestCaseAssertion.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/cases/assertion/IntegrationTestCaseAssertion.java
index 5c99db5..5c04c97 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/cases/assertion/IntegrationTestCaseAssertion.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/cases/assertion/IntegrationTestCaseAssertion.java
@@ -47,7 +47,10 @@ public final class IntegrationTestCaseAssertion {
private String parameters;
@XmlElement(name = "initial-sql")
- private IntegrationTestCaseAssertionInitialSQL initialSQL;
+ private IntegrationTestCaseAssertionSQL initialSQL;
+
+ @XmlElement(name = "destroy-sql")
+ private IntegrationTestCaseAssertionSQL destroySQL;
/**
* Get SQL values.
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/cases/assertion/IntegrationTestCaseAssertionInitialSQL.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/cases/assertion/IntegrationTestCaseAssertionSQL.java
similarity index 95%
rename from shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/cases/assertion/IntegrationTestCaseAssertionInitialSQL.java
rename to shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/cases/assertion/IntegrationTestCaseAssertionSQL.java
index e853471..8cc9491 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/cases/assertion/IntegrationTestCaseAssertionInitialSQL.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/cases/assertion/IntegrationTestCaseAssertionSQL.java
@@ -30,7 +30,7 @@ import javax.xml.bind.annotation.XmlAttribute;
@Getter
@Setter
@XmlAccessorType(XmlAccessType.FIELD)
-public final class IntegrationTestCaseAssertionInitialSQL {
+public final class IntegrationTestCaseAssertionSQL {
@XmlAttribute
private String sql;
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/cases/dataset/row/DataSetRow.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/cases/dataset/row/DataSetRow.java
index 0985544..8d31cf7 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/cases/dataset/row/DataSetRow.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/java/org/apache/shardingsphere/test/integration/cases/dataset/row/DataSetRow.java
@@ -50,4 +50,13 @@ public final class DataSetRow {
public List<String> getValues() {
return Splitter.on(",").trimResults().splitToList(values);
}
+
+ /**
+ * Get values.
+ *
+ * @return value list
+ */
+ public List<String> getValuesByBar() {
+ return Splitter.on("|").trimResults().splitToList(values);
+ }
}
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/BatchITCase.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/BatchITCase.java
index 4deacb8..99f4b19 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/BatchITCase.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/BatchITCase.java
@@ -19,7 +19,6 @@ package org.apache.shardingsphere.test.integration.engine.it;
import lombok.AccessLevel;
import lombok.Getter;
-import lombok.SneakyThrows;
import org.apache.shardingsphere.infra.datanode.DataNode;
import org.apache.shardingsphere.sharding.support.InlineExpressionParser;
import org.apache.shardingsphere.test.integration.cases.assertion.IntegrationTestCaseAssertion;
@@ -34,7 +33,6 @@ import org.apache.shardingsphere.test.integration.junit.compose.GovernanceContai
import org.apache.shardingsphere.test.integration.junit.param.model.CaseParameterizedArray;
import javax.sql.DataSource;
-import java.io.IOException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@@ -67,9 +65,8 @@ public abstract class BatchITCase extends BaseITCase {
this.parentPath = parameterizedArray.getTestCaseContext().getParentPath();
}
- @SneakyThrows
@Override
- public void init() throws IOException {
+ public void init() throws Exception {
super.init();
for (IntegrationTestCaseAssertion each : getIntegrationTestCase().getAssertions()) {
dataSets.add(DataSetLoader.load(getParentPath(), getScenario(), getDatabaseType(), each.getExpectedDataFile()));
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/dcl/BaseDCLIT.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/dcl/BaseDCLIT.java
index 566cf4c..b69a617 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/dcl/BaseDCLIT.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/dcl/BaseDCLIT.java
@@ -17,14 +17,11 @@
package org.apache.shardingsphere.test.integration.engine.it.dcl;
-import lombok.SneakyThrows;
import org.apache.shardingsphere.test.integration.engine.it.SingleITCase;
import org.apache.shardingsphere.test.integration.env.EnvironmentPath;
import org.apache.shardingsphere.test.integration.env.authority.AuthorityEnvironmentManager;
import org.apache.shardingsphere.test.integration.junit.param.model.AssertionParameterizedArray;
-import java.io.IOException;
-
public abstract class BaseDCLIT extends SingleITCase {
private AuthorityEnvironmentManager authorityEnvironmentManager;
@@ -32,10 +29,9 @@ public abstract class BaseDCLIT extends SingleITCase {
public BaseDCLIT(final AssertionParameterizedArray parameterizedArray) {
super(parameterizedArray);
}
-
- @SneakyThrows
+
@Override
- public final void init() throws IOException {
+ public final void init() throws Exception {
super.init();
authorityEnvironmentManager = new AuthorityEnvironmentManager(
EnvironmentPath.getAuthorityFile(getScenario()),
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/ddl/BaseDDLIT.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/ddl/BaseDDLIT.java
index ae4313e..392170f 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/ddl/BaseDDLIT.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/ddl/BaseDDLIT.java
@@ -18,7 +18,6 @@
package org.apache.shardingsphere.test.integration.engine.it.ddl;
import com.google.common.base.Splitter;
-import lombok.SneakyThrows;
import org.apache.shardingsphere.infra.datanode.DataNode;
import org.apache.shardingsphere.sharding.route.engine.exception.NoSuchTableException;
import org.apache.shardingsphere.sharding.support.InlineExpressionParser;
@@ -26,13 +25,10 @@ import org.apache.shardingsphere.test.integration.cases.dataset.metadata.DataSet
import org.apache.shardingsphere.test.integration.cases.dataset.metadata.DataSetIndex;
import org.apache.shardingsphere.test.integration.cases.dataset.metadata.DataSetMetadata;
import org.apache.shardingsphere.test.integration.engine.it.SingleITCase;
-import org.apache.shardingsphere.test.integration.env.EnvironmentPath;
-import org.apache.shardingsphere.test.integration.env.dataset.DataSetEnvironmentManager;
import org.apache.shardingsphere.test.integration.junit.compose.GovernanceContainerCompose;
import org.apache.shardingsphere.test.integration.junit.param.model.AssertionParameterizedArray;
import javax.sql.DataSource;
-import java.io.IOException;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
@@ -51,23 +47,15 @@ import static org.junit.Assert.assertThat;
public abstract class BaseDDLIT extends SingleITCase {
- private DataSetEnvironmentManager dataSetEnvironmentManager;
-
public BaseDDLIT(final AssertionParameterizedArray parameterizedArray) {
super(parameterizedArray);
}
-
- @SneakyThrows
+
@Override
- public final void init() throws IOException {
+ public final void init() throws Exception {
super.init();
assertNotNull("Expected affected table is required", getAssertion().getInitialSQL());
- assertNotNull("Expected affected table is required", getAssertion().getInitialSQL().getAffectedTable());
- dataSetEnvironmentManager = new DataSetEnvironmentManager(
- EnvironmentPath.getDataSetFile(getScenario()),
- getStorageContainer().getDataSourceMap()
- );
- dataSetEnvironmentManager.fillData();
+ assertNotNull("Init SQL is required", getAssertion().getInitialSQL().getAffectedTable());
try (Connection connection = getTargetDataSource().getConnection()) {
executeInitSQLs(connection);
}
@@ -75,7 +63,6 @@ public abstract class BaseDDLIT extends SingleITCase {
@Override
public final void tearDown() throws Exception {
- dataSetEnvironmentManager.clearData();
try (Connection connection = getTargetDataSource().getConnection()) {
String dropSql = String.format("DROP TABLE %s", getAssertion().getInitialSQL().getAffectedTable());
executeUpdateForPrepareStatement(connection, dropSql);
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/dml/BaseDMLIT.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/dml/BaseDMLIT.java
index 487392a..e0723c7 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/dml/BaseDMLIT.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/dml/BaseDMLIT.java
@@ -17,7 +17,6 @@
package org.apache.shardingsphere.test.integration.engine.it.dml;
-import lombok.SneakyThrows;
import org.apache.shardingsphere.infra.database.type.dialect.PostgreSQLDatabaseType;
import org.apache.shardingsphere.infra.datanode.DataNode;
import org.apache.shardingsphere.sharding.support.InlineExpressionParser;
@@ -31,7 +30,6 @@ import org.apache.shardingsphere.test.integration.junit.compose.GovernanceContai
import org.apache.shardingsphere.test.integration.junit.param.model.AssertionParameterizedArray;
import javax.sql.DataSource;
-import java.io.IOException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@@ -53,10 +51,9 @@ public abstract class BaseDMLIT extends SingleITCase {
public BaseDMLIT(final AssertionParameterizedArray parameterizedArray) {
super(parameterizedArray);
}
-
- @SneakyThrows
+
@Override
- public final void init() throws IOException {
+ public final void init() throws Exception {
super.init();
dataSetEnvironmentManager = new DataSetEnvironmentManager(
EnvironmentPath.getDataSetFile(getScenario()),
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/dql/BaseDQLIT.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/dql/BaseDQLIT.java
index e034b56..d5fa001 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/dql/BaseDQLIT.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/dql/BaseDQLIT.java
@@ -17,7 +17,6 @@
package org.apache.shardingsphere.test.integration.engine.it.dql;
-import lombok.SneakyThrows;
import org.apache.shardingsphere.test.integration.cases.dataset.metadata.DataSetColumn;
import org.apache.shardingsphere.test.integration.cases.dataset.metadata.DataSetMetadata;
import org.apache.shardingsphere.test.integration.cases.dataset.row.DataSetRow;
@@ -48,9 +47,8 @@ public abstract class BaseDQLIT extends SingleITCase {
super(parameter);
}
- @SneakyThrows
@Override
- public void init() throws IOException {
+ public void init() throws Exception {
super.init();
compose.executeOnStarted(compose -> {
try {
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/dql/BaseDQLIT.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/rdl/BaseRDLIT.java
similarity index 68%
copy from shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/dql/BaseDQLIT.java
copy to shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/rdl/BaseRDLIT.java
index e034b56..cc9458f 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/dql/BaseDQLIT.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/rdl/BaseRDLIT.java
@@ -15,60 +15,75 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.test.integration.engine.it.dql;
+package org.apache.shardingsphere.test.integration.engine.it.rdl;
-import lombok.SneakyThrows;
+import com.google.common.base.Splitter;
import org.apache.shardingsphere.test.integration.cases.dataset.metadata.DataSetColumn;
import org.apache.shardingsphere.test.integration.cases.dataset.metadata.DataSetMetadata;
import org.apache.shardingsphere.test.integration.cases.dataset.row.DataSetRow;
import org.apache.shardingsphere.test.integration.engine.it.SingleITCase;
-import org.apache.shardingsphere.test.integration.env.EnvironmentPath;
-import org.apache.shardingsphere.test.integration.env.dataset.DataSetEnvironmentManager;
import org.apache.shardingsphere.test.integration.junit.param.model.AssertionParameterizedArray;
-import javax.xml.bind.JAXBException;
-import java.io.IOException;
+import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
-import java.sql.Types;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
-public abstract class BaseDQLIT extends SingleITCase {
-
- public BaseDQLIT(final AssertionParameterizedArray parameter) {
+public abstract class BaseRDLIT extends SingleITCase {
+
+ public BaseRDLIT(final AssertionParameterizedArray parameter) {
super(parameter);
}
- @SneakyThrows
@Override
- public void init() throws IOException {
+ public final void init() throws Exception {
super.init();
- compose.executeOnStarted(compose -> {
- try {
- new DataSetEnvironmentManager(
- EnvironmentPath.getDataSetFile(getScenario()),
- getStorageContainer().getDataSourceMap()
- ).fillData();
- } catch (IOException | JAXBException | SQLException | ParseException e) {
- throw new RuntimeException(e);
- }
- });
+ assertNotNull("Init SQL is required", getAssertion().getInitialSQL());
+ try (Connection connection = getTargetDataSource().getConnection()) {
+ executeInitSQLs(connection);
+ }
+ }
+
+ @Override
+ public final void tearDown() throws Exception {
+ assertNotNull("Destroy SQL is required", getAssertion().getDestroySQL());
+ try (Connection connection = getTargetDataSource().getConnection()) {
+ executeDestroySQLs(connection);
+ }
+ super.tearDown();
+ }
+
+ private void executeInitSQLs(final Connection connection) throws SQLException {
+ if (null == getAssertion().getInitialSQL().getSql()) {
+ return;
+ }
+ for (String each : Splitter.on(";").trimResults().splitToList(getAssertion().getInitialSQL().getSql())) {
+ executeUpdateForPrepareStatement(connection, each);
+ }
}
-
+
+ private void executeDestroySQLs(final Connection connection) throws SQLException {
+ if (null == getAssertion().getDestroySQL().getSql()) {
+ return;
+ }
+ for (String each : Splitter.on(";").trimResults().splitToList(getAssertion().getDestroySQL().getSql())) {
+ executeUpdateForPrepareStatement(connection, each);
+ }
+ }
+
protected final void assertResultSet(final ResultSet resultSet) throws SQLException {
assertMetaData(resultSet.getMetaData(), getExpectedColumns());
assertRows(resultSet, getDataSet().getRows());
}
-
+
private Collection<DataSetColumn> getExpectedColumns() {
Collection<DataSetColumn> result = new LinkedList<>();
for (DataSetMetadata each : getDataSet().getMetadataList()) {
@@ -76,19 +91,15 @@ public abstract class BaseDQLIT extends SingleITCase {
}
return result;
}
-
+
private void assertMetaData(final ResultSetMetaData actual, final Collection<DataSetColumn> expected) throws SQLException {
- // TODO Fix shadow
- if ("shadow".equals(getScenario())) {
- return;
- }
assertThat(actual.getColumnCount(), is(expected.size()));
int index = 1;
for (DataSetColumn each : expected) {
assertThat(actual.getColumnLabel(index++).toLowerCase(), is(each.getName().toLowerCase()));
}
}
-
+
private void assertRows(final ResultSet actual, final List<DataSetRow> expected) throws SQLException {
int rowCount = 0;
ResultSetMetaData actualMetaData = actual.getMetaData();
@@ -99,29 +110,16 @@ public abstract class BaseDQLIT extends SingleITCase {
}
assertThat("Size of actual result set is different with size of expected dat set rows.", rowCount, is(expected.size()));
}
-
+
private void assertRow(final ResultSet actual, final ResultSetMetaData actualMetaData, final DataSetRow expected) throws SQLException {
int columnIndex = 1;
for (String each : expected.getValues()) {
String columnLabel = actualMetaData.getColumnLabel(columnIndex);
- if (Types.DATE == actual.getMetaData().getColumnType(columnIndex)) {
- assertDateValue(actual, columnIndex, columnLabel, each);
- } else {
- assertObjectValue(actual, columnIndex, columnLabel, each);
- }
+ assertObjectValue(actual, columnIndex, columnLabel, each);
columnIndex++;
}
}
-
- private void assertDateValue(final ResultSet actual, final int columnIndex, final String columnLabel, final String expected) throws SQLException {
- if (NOT_VERIFY_FLAG.equals(expected)) {
- return;
- }
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
- assertThat(dateFormat.format(actual.getDate(columnIndex)), is(expected));
- assertThat(dateFormat.format(actual.getDate(columnLabel)), is(expected));
- }
-
+
private void assertObjectValue(final ResultSet actual, final int columnIndex, final String columnLabel, final String expected) throws SQLException {
assertThat(String.valueOf(actual.getObject(columnIndex)), is(expected));
assertThat(String.valueOf(actual.getObject(columnLabel)), is(expected));
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/rdl/GeneralRDLIT.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/rdl/GeneralRDLIT.java
new file mode 100644
index 0000000..49c947b
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/rdl/GeneralRDLIT.java
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.test.integration.engine.it.rdl;
+
+import org.apache.shardingsphere.test.integration.cases.SQLCommandType;
+import org.apache.shardingsphere.test.integration.common.SQLExecuteType;
+import org.apache.shardingsphere.test.integration.junit.compose.ComposeManager;
+import org.apache.shardingsphere.test.integration.junit.param.ParameterizedArrayFactory;
+import org.apache.shardingsphere.test.integration.junit.param.model.AssertionParameterizedArray;
+import org.apache.shardingsphere.test.integration.junit.param.model.ParameterizedArray;
+import org.apache.shardingsphere.test.integration.junit.runner.parallel.annotaion.ParallelLevel;
+import org.apache.shardingsphere.test.integration.junit.runner.parallel.annotaion.ParallelRuntimeStrategy;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.junit.runners.Parameterized.Parameters;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.text.ParseException;
+import java.util.Collection;
+import java.util.stream.Collectors;
+
+@ParallelRuntimeStrategy(ParallelLevel.SCENARIO)
+public final class GeneralRDLIT extends BaseRDLIT {
+
+ @ClassRule
+ public static ComposeManager composeManager = new ComposeManager("GeneralRDLIT");
+
+ public GeneralRDLIT(final AssertionParameterizedArray parameterizedArray) {
+ super(parameterizedArray);
+ }
+
+ @Parameters(name = "{0}")
+ public static Collection<ParameterizedArray> getParameters() {
+ return ParameterizedArrayFactory.getAssertionParameterized(SQLCommandType.RDL)
+ .stream()
+ .filter(each -> SQLExecuteType.Literal == each.getSqlExecuteType())
+ .filter(each -> "proxy".equals(each.getAdapter()))
+ .peek(each -> each.setCompose(composeManager.getOrCreateCompose(each)))
+ .collect(Collectors.toList());
+ }
+
+ @Test
+ public void assertExecute() throws SQLException, ParseException {
+ try (Connection connection = getTargetDataSource().getConnection()) {
+ assertExecuteForStatement(connection);
+ }
+ }
+
+ private void assertExecuteForStatement(final Connection connection) throws SQLException, ParseException {
+ try (
+ Statement statement = connection.createStatement();
+ ResultSet resultSet = statement.executeQuery(getSQL())) {
+ assertResultSet(resultSet);
+ }
+ }
+}
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/dql/BaseDQLIT.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/rql/BaseRQLIT.java
similarity index 64%
copy from shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/dql/BaseDQLIT.java
copy to shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/rql/BaseRQLIT.java
index e034b56..d494125 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/dql/BaseDQLIT.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/rql/BaseRQLIT.java
@@ -15,25 +15,17 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.test.integration.engine.it.dql;
+package org.apache.shardingsphere.test.integration.engine.it.rql;
-import lombok.SneakyThrows;
import org.apache.shardingsphere.test.integration.cases.dataset.metadata.DataSetColumn;
import org.apache.shardingsphere.test.integration.cases.dataset.metadata.DataSetMetadata;
import org.apache.shardingsphere.test.integration.cases.dataset.row.DataSetRow;
import org.apache.shardingsphere.test.integration.engine.it.SingleITCase;
-import org.apache.shardingsphere.test.integration.env.EnvironmentPath;
-import org.apache.shardingsphere.test.integration.env.dataset.DataSetEnvironmentManager;
import org.apache.shardingsphere.test.integration.junit.param.model.AssertionParameterizedArray;
-import javax.xml.bind.JAXBException;
-import java.io.IOException;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
-import java.sql.Types;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
@@ -42,33 +34,17 @@ import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
-public abstract class BaseDQLIT extends SingleITCase {
-
- public BaseDQLIT(final AssertionParameterizedArray parameter) {
+public abstract class BaseRQLIT extends SingleITCase {
+
+ public BaseRQLIT(final AssertionParameterizedArray parameter) {
super(parameter);
}
- @SneakyThrows
- @Override
- public void init() throws IOException {
- super.init();
- compose.executeOnStarted(compose -> {
- try {
- new DataSetEnvironmentManager(
- EnvironmentPath.getDataSetFile(getScenario()),
- getStorageContainer().getDataSourceMap()
- ).fillData();
- } catch (IOException | JAXBException | SQLException | ParseException e) {
- throw new RuntimeException(e);
- }
- });
- }
-
protected final void assertResultSet(final ResultSet resultSet) throws SQLException {
assertMetaData(resultSet.getMetaData(), getExpectedColumns());
assertRows(resultSet, getDataSet().getRows());
}
-
+
private Collection<DataSetColumn> getExpectedColumns() {
Collection<DataSetColumn> result = new LinkedList<>();
for (DataSetMetadata each : getDataSet().getMetadataList()) {
@@ -76,19 +52,15 @@ public abstract class BaseDQLIT extends SingleITCase {
}
return result;
}
-
+
private void assertMetaData(final ResultSetMetaData actual, final Collection<DataSetColumn> expected) throws SQLException {
- // TODO Fix shadow
- if ("shadow".equals(getScenario())) {
- return;
- }
assertThat(actual.getColumnCount(), is(expected.size()));
int index = 1;
for (DataSetColumn each : expected) {
assertThat(actual.getColumnLabel(index++).toLowerCase(), is(each.getName().toLowerCase()));
}
}
-
+
private void assertRows(final ResultSet actual, final List<DataSetRow> expected) throws SQLException {
int rowCount = 0;
ResultSetMetaData actualMetaData = actual.getMetaData();
@@ -99,29 +71,16 @@ public abstract class BaseDQLIT extends SingleITCase {
}
assertThat("Size of actual result set is different with size of expected dat set rows.", rowCount, is(expected.size()));
}
-
+
private void assertRow(final ResultSet actual, final ResultSetMetaData actualMetaData, final DataSetRow expected) throws SQLException {
int columnIndex = 1;
- for (String each : expected.getValues()) {
+ for (String each : expected.getValuesByBar()) {
String columnLabel = actualMetaData.getColumnLabel(columnIndex);
- if (Types.DATE == actual.getMetaData().getColumnType(columnIndex)) {
- assertDateValue(actual, columnIndex, columnLabel, each);
- } else {
- assertObjectValue(actual, columnIndex, columnLabel, each);
- }
+ assertObjectValue(actual, columnIndex, columnLabel, each);
columnIndex++;
}
}
-
- private void assertDateValue(final ResultSet actual, final int columnIndex, final String columnLabel, final String expected) throws SQLException {
- if (NOT_VERIFY_FLAG.equals(expected)) {
- return;
- }
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
- assertThat(dateFormat.format(actual.getDate(columnIndex)), is(expected));
- assertThat(dateFormat.format(actual.getDate(columnLabel)), is(expected));
- }
-
+
private void assertObjectValue(final ResultSet actual, final int columnIndex, final String columnLabel, final String expected) throws SQLException {
assertThat(String.valueOf(actual.getObject(columnIndex)), is(expected));
assertThat(String.valueOf(actual.getObject(columnLabel)), is(expected));
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/rql/GeneralRQLIT.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/rql/GeneralRQLIT.java
new file mode 100644
index 0000000..55f4502
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/it/rql/GeneralRQLIT.java
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.test.integration.engine.it.rql;
+
+import org.apache.shardingsphere.test.integration.cases.SQLCommandType;
+import org.apache.shardingsphere.test.integration.common.SQLExecuteType;
+import org.apache.shardingsphere.test.integration.junit.compose.ComposeManager;
+import org.apache.shardingsphere.test.integration.junit.param.ParameterizedArrayFactory;
+import org.apache.shardingsphere.test.integration.junit.param.model.AssertionParameterizedArray;
+import org.apache.shardingsphere.test.integration.junit.param.model.ParameterizedArray;
+import org.apache.shardingsphere.test.integration.junit.runner.parallel.annotaion.ParallelLevel;
+import org.apache.shardingsphere.test.integration.junit.runner.parallel.annotaion.ParallelRuntimeStrategy;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.junit.runners.Parameterized.Parameters;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.text.ParseException;
+import java.util.Collection;
+import java.util.stream.Collectors;
+
+@ParallelRuntimeStrategy(ParallelLevel.CASE)
+public final class GeneralRQLIT extends BaseRQLIT {
+
+ @ClassRule
+ public static ComposeManager composeManager = new ComposeManager("GeneralRQLIT");
+
+ public GeneralRQLIT(final AssertionParameterizedArray parameterizedArray) {
+ super(parameterizedArray);
+ }
+
+ @Parameters(name = "{0}")
+ public static Collection<ParameterizedArray> getParameters() {
+ return ParameterizedArrayFactory.getAssertionParameterized(SQLCommandType.RQL)
+ .stream()
+ .filter(each -> SQLExecuteType.Literal == each.getSqlExecuteType())
+ .filter(each -> "proxy".equals(each.getAdapter()))
+ .peek(each -> each.setCompose(composeManager.getOrCreateCompose(each)))
+ .collect(Collectors.toList());
+ }
+
+ @Test
+ public void assertExecute() throws SQLException, ParseException {
+ try (Connection connection = getTargetDataSource().getConnection()) {
+ assertExecuteForStatement(connection);
+ }
+ }
+
+ private void assertExecuteForStatement(final Connection connection) throws SQLException, ParseException {
+ try (
+ Statement statement = connection.createStatement();
+ ResultSet resultSet = statement.executeQuery(getSQL())) {
+ assertResultSet(resultSet);
+ }
+ }
+}
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rdl/dataset/db/mysql/add_resource.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rdl/dataset/db/mysql/add_resource.xml
new file mode 100644
index 0000000..1c4e409
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rdl/dataset/db/mysql/add_resource.xml
@@ -0,0 +1,23 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="a" />
+ </metadata>
+ <row values="1" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rdl/dataset/dbtbl_with_readwrite_splitting/mysql/add_resource.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rdl/dataset/dbtbl_with_readwrite_splitting/mysql/add_resource.xml
new file mode 100644
index 0000000..1c4e409
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rdl/dataset/dbtbl_with_readwrite_splitting/mysql/add_resource.xml
@@ -0,0 +1,23 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="a" />
+ </metadata>
+ <row values="1" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rdl/dataset/dbtbl_with_readwrite_splitting_and_encrypt/mysql/add_resource.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rdl/dataset/dbtbl_with_readwrite_splitting_and_encrypt/mysql/add_resource.xml
new file mode 100644
index 0000000..1c4e409
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rdl/dataset/dbtbl_with_readwrite_splitting_and_encrypt/mysql/add_resource.xml
@@ -0,0 +1,23 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="a" />
+ </metadata>
+ <row values="1" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rdl/dataset/encrypt/mysql/add_resource.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rdl/dataset/encrypt/mysql/add_resource.xml
new file mode 100644
index 0000000..1c4e409
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rdl/dataset/encrypt/mysql/add_resource.xml
@@ -0,0 +1,23 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="a" />
+ </metadata>
+ <row values="1" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rdl/dataset/readwrite_splitting/mysql/add_resource.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rdl/dataset/readwrite_splitting/mysql/add_resource.xml
new file mode 100644
index 0000000..1c4e409
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rdl/dataset/readwrite_splitting/mysql/add_resource.xml
@@ -0,0 +1,23 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="a" />
+ </metadata>
+ <row values="1" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rdl/dataset/sharding_governance/mysql/add_resource.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rdl/dataset/sharding_governance/mysql/add_resource.xml
new file mode 100644
index 0000000..1c4e409
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rdl/dataset/sharding_governance/mysql/add_resource.xml
@@ -0,0 +1,23 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="a" />
+ </metadata>
+ <row values="1" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rdl/dataset/tbl/mysql/add_resource.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rdl/dataset/tbl/mysql/add_resource.xml
new file mode 100644
index 0000000..1c4e409
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rdl/dataset/tbl/mysql/add_resource.xml
@@ -0,0 +1,23 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="a" />
+ </metadata>
+ <row values="1" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rdl/rdl-integration-test-cases.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rdl/rdl-integration-test-cases.xml
new file mode 100644
index 0000000..17a3766
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rdl/rdl-integration-test-cases.xml
@@ -0,0 +1,24 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<integration-test-cases>
+ <test-case sql="SELECT 1 as a" db-types="MySQL">
+ <assertion expected-data-file="add_resource.xml">
+ <initial-sql sql="CREATE TABLE rdl_test(id int, description varchar(10))" />
+ <destroy-sql sql="DROP TABLE rdl_test" />
+ </assertion>
+ </test-case>
+</integration-test-cases>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/mysql/show_resources.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/mysql/show_resources.xml
new file mode 100644
index 0000000..a7ed8be
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/db/mysql/show_resources.xml
@@ -0,0 +1,37 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="name" />
+ <column name="type" />
+ <column name="host" />
+ <column name="port" />
+ <column name="db" />
+ <column name="attribute" />
+ </metadata>
+ <row values="ds_0| MySQL| mysql.db.host| 3306| db_0| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="ds_1| MySQL| mysql.db.host| 3306| db_1| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="ds_2| MySQL| mysql.db.host| 3306| db_2| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="ds_3| MySQL| mysql.db.host| 3306| db_3| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="ds_4| MySQL| mysql.db.host| 3306| db_4| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="ds_5| MySQL| mysql.db.host| 3306| db_5| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="ds_6| MySQL| mysql.db.host| 3306| db_6| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="ds_7| MySQL| mysql.db.host| 3306| db_7| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="ds_8| MySQL| mysql.db.host| 3306| db_8| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="ds_9| MySQL| mysql.db.host| 3306| db_9| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting/mysql/show_resources.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting/mysql/show_resources.xml
new file mode 100644
index 0000000..48e3bf3
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting/mysql/show_resources.xml
@@ -0,0 +1,47 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="name" />
+ <column name="type" />
+ <column name="host" />
+ <column name="port" />
+ <column name="db" />
+ <column name="attribute" />
+ </metadata>
+ <row values="write_ds_0| MySQL| mysql.dbtbl_with_readwrite_splitting.host| 3306| write_ds_0| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="write_ds_1| MySQL| mysql.dbtbl_with_readwrite_splitting.host| 3306| write_ds_1| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="write_ds_2| MySQL| mysql.dbtbl_with_readwrite_splitting.host| 3306| write_ds_2| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="write_ds_3| MySQL| mysql.dbtbl_with_readwrite_splitting.host| 3306| write_ds_3| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="write_ds_4| MySQL| mysql.dbtbl_with_readwrite_splitting.host| 3306| write_ds_4| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="write_ds_5| MySQL| mysql.dbtbl_with_readwrite_splitting.host| 3306| write_ds_5| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="write_ds_6| MySQL| mysql.dbtbl_with_readwrite_splitting.host| 3306| write_ds_6| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="write_ds_7| MySQL| mysql.dbtbl_with_readwrite_splitting.host| 3306| write_ds_7| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="write_ds_8| MySQL| mysql.dbtbl_with_readwrite_splitting.host| 3306| write_ds_8| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="write_ds_9| MySQL| mysql.dbtbl_with_readwrite_splitting.host| 3306| write_ds_9| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="read_ds_0| MySQL| mysql.dbtbl_with_readwrite_splitting.host| 3306| read_ds_0| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="read_ds_1| MySQL| mysql.dbtbl_with_readwrite_splitting.host| 3306| read_ds_1| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="read_ds_2| MySQL| mysql.dbtbl_with_readwrite_splitting.host| 3306| read_ds_2| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="read_ds_3| MySQL| mysql.dbtbl_with_readwrite_splitting.host| 3306| read_ds_3| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="read_ds_4| MySQL| mysql.dbtbl_with_readwrite_splitting.host| 3306| read_ds_4| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="read_ds_5| MySQL| mysql.dbtbl_with_readwrite_splitting.host| 3306| read_ds_5| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="read_ds_6| MySQL| mysql.dbtbl_with_readwrite_splitting.host| 3306| read_ds_6| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="read_ds_7| MySQL| mysql.dbtbl_with_readwrite_splitting.host| 3306| read_ds_7| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="read_ds_8| MySQL| mysql.dbtbl_with_readwrite_splitting.host| 3306| read_ds_8| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="read_ds_9| MySQL| mysql.dbtbl_with_readwrite_splitting.host| 3306| read_ds_9| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/mysql/show_resources.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/mysql/show_resources.xml
new file mode 100644
index 0000000..9d7b5fd
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/mysql/show_resources.xml
@@ -0,0 +1,47 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="name" />
+ <column name="type" />
+ <column name="host" />
+ <column name="port" />
+ <column name="db" />
+ <column name="attribute" />
+ </metadata>
+ <row values="encrypt_write_ds_0| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_write_ds_0| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="encrypt_write_ds_1| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_write_ds_1| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="encrypt_write_ds_2| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_write_ds_2| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="encrypt_write_ds_3| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_write_ds_3| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="encrypt_write_ds_4| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_write_ds_4| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="encrypt_write_ds_5| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_write_ds_5| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="encrypt_write_ds_6| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_write_ds_6| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="encrypt_write_ds_7| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_write_ds_7| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="encrypt_write_ds_8| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_write_ds_8| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="encrypt_write_ds_9| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_write_ds_9| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="encrypt_read_ds_0| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_read_ds_0| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="encrypt_read_ds_1| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_read_ds_1| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="encrypt_read_ds_2| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_read_ds_2| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="encrypt_read_ds_3| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_read_ds_3| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="encrypt_read_ds_4| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_read_ds_4| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="encrypt_read_ds_5| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_read_ds_5| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="encrypt_read_ds_6| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_read_ds_6| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="encrypt_read_ds_7| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_read_ds_7| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="encrypt_read_ds_8| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_read_ds_8| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="encrypt_read_ds_9| MySQL| mysql.dbtbl_with_readwrite_splitting_and_encrypt.host| 3306| encrypt_read_ds_9| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/encrypt/mysql/show_resources.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/encrypt/mysql/show_resources.xml
new file mode 100644
index 0000000..c43bec9
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/encrypt/mysql/show_resources.xml
@@ -0,0 +1,28 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="name" />
+ <column name="type" />
+ <column name="host" />
+ <column name="port" />
+ <column name="db" />
+ <column name="attribute" />
+ </metadata>
+ <row values="encrypt| MySQL| mysql.encrypt.host| 3306| encrypt| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/readwrite_splitting/mysql/show_resources.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/readwrite_splitting/mysql/show_resources.xml
new file mode 100644
index 0000000..335bfee
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/readwrite_splitting/mysql/show_resources.xml
@@ -0,0 +1,30 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="name" />
+ <column name="type" />
+ <column name="host" />
+ <column name="port" />
+ <column name="db" />
+ <column name="attribute" />
+ </metadata>
+ <row values="write_ds| MySQL| mysql.readwrite_splitting.host| 3306| write_ds| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="read_0| MySQL| mysql.readwrite_splitting.host| 3306| read_0| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+ <row values="read_1| MySQL| mysql.readwrite_splitting.host| 3306| read_1| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_governance/mysql/show_resources.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_governance/mysql/show_resources.xml
new file mode 100644
index 0000000..fd480d8
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/sharding_governance/mysql/show_resources.xml
@@ -0,0 +1,28 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="name" />
+ <column name="type" />
+ <column name="host" />
+ <column name="port" />
+ <column name="db" />
+ <column name="attribute" />
+ </metadata>
+ <row values="governance_db| MySQL| mysql.sharding_governance.host| 3306| governance_db| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/tbl/mysql/show_resources.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/tbl/mysql/show_resources.xml
new file mode 100644
index 0000000..5690682
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/dataset/tbl/mysql/show_resources.xml
@@ -0,0 +1,28 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<dataset>
+ <metadata>
+ <column name="name" />
+ <column name="type" />
+ <column name="host" />
+ <column name="port" />
+ <column name="db" />
+ <column name="attribute" />
+ </metadata>
+ <row values="tbl| MySQL| mysql.tbl.host| 3306| tbl| {"maxLifetimeMilliseconds":1800000,"readOnly":false,"minPoolSize":2,"idleTimeoutMilliseconds":60000,"maxPoolSize":2,"connectionTimeoutMilliseconds":30000}" />
+</dataset>
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/rql-integration-test-cases.xml b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/rql-integration-test-cases.xml
new file mode 100644
index 0000000..7e9ab11
--- /dev/null
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/resources/cases/rql/rql-integration-test-cases.xml
@@ -0,0 +1,21 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<integration-test-cases>
+ <test-case sql="SHOW RESOURCES" db-types="MySQL">
+ <assertion expected-data-file="show_resources.xml" />
+ </test-case>
+</integration-test-cases>