From 4cdc8c3c1e5073df8cf11613f3f366abda828ff6 Mon Sep 17 00:00:00 2001 From: liu ze jian Date: Fri, 4 May 2018 11:31:56 +0800 Subject: [PATCH] Validation table index modification --- .../io/shardingjdbc/dbtest/StartTest.java | 7 +- .../dbtest/common/DatabaseUtil.java | 293 +++++++++++------- .../dbtest/config/AnalyzeDataset.java | 84 ++--- .../dbtest/config/bean/ColumnDefinition.java | 22 ++ .../dbtest/config/bean/IndexDefinition.java | 30 ++ .../resources/asserts/create/assert-test.xml | 12 +- .../create/asserts/ddl/assertCreateIndex.xml | 10 + .../asserts/ddl/assertCreateUniqueIndex.xml | 10 + 8 files changed, 314 insertions(+), 154 deletions(-) create mode 100644 sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/config/bean/IndexDefinition.java create mode 100644 sharding-jdbc-core/src/test/resources/asserts/create/asserts/ddl/assertCreateIndex.xml create mode 100644 sharding-jdbc-core/src/test/resources/asserts/create/asserts/ddl/assertCreateUniqueIndex.xml diff --git a/sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/StartTest.java b/sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/StartTest.java index 4d3564aefe905..86dae10b2c5fb 100644 --- a/sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/StartTest.java +++ b/sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/StartTest.java @@ -37,6 +37,7 @@ import javax.xml.bind.JAXBException; import java.io.IOException; +import java.net.URISyntaxException; import java.net.URL; import java.nio.file.FileVisitResult; import java.nio.file.Files; @@ -68,7 +69,7 @@ public final class StartTest { private final String id; @Parameters(name = "{0} ({2}) -> {1}") - public static Collection getParameters() throws IOException, JAXBException { + public static Collection getParameters() throws IOException, JAXBException, URISyntaxException { URL integrateResources = StartTest.class.getClassLoader().getResource(INTEGRATION_RESOURCES_PATH); assertNotNull(integrateResources); for (String each : getAssertFiles(integrateResources)) { @@ -94,9 +95,9 @@ public static Collection getParameters() throws IOException, JAXBExcep return RESULT_ASSERT; } - private static List getAssertFiles(final URL integrateResources) throws IOException { + private static List getAssertFiles(final URL integrateResources) throws IOException, URISyntaxException { final List result = new LinkedList<>(); - Files.walkFileTree(Paths.get(integrateResources.getPath()), new SimpleFileVisitor() { + Files.walkFileTree(Paths.get(integrateResources.toURI()), new SimpleFileVisitor() { @Override public FileVisitResult visitFile(final Path file, final BasicFileAttributes basicFileAttributes) { diff --git a/sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/common/DatabaseUtil.java b/sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/common/DatabaseUtil.java index d155fddbb51fc..5b729a547faa7 100644 --- a/sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/common/DatabaseUtil.java +++ b/sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/common/DatabaseUtil.java @@ -17,17 +17,6 @@ package io.shardingjdbc.dbtest.common; -import io.shardingjdbc.dbtest.config.bean.ColumnDefinition; -import io.shardingjdbc.dbtest.config.bean.DatasetDatabase; -import io.shardingjdbc.dbtest.config.bean.DatasetDefinition; -import io.shardingjdbc.dbtest.config.bean.ParameterDefinition; -import io.shardingjdbc.dbtest.config.bean.ParameterValueDefinition; -import io.shardingjdbc.dbtest.exception.DbTestException; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.FastDateFormat; -import org.junit.Assert; - import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.Date; @@ -45,7 +34,22 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; +import io.shardingjdbc.dbtest.config.bean.ColumnDefinition; +import io.shardingjdbc.dbtest.config.bean.DatasetDatabase; +import io.shardingjdbc.dbtest.config.bean.DatasetDefinition; +import io.shardingjdbc.dbtest.config.bean.IndexDefinition; +import io.shardingjdbc.dbtest.config.bean.ParameterDefinition; +import io.shardingjdbc.dbtest.config.bean.ParameterValueDefinition; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.time.DateFormatUtils; +import org.apache.commons.lang3.time.FastDateFormat; + +import io.shardingjdbc.dbtest.exception.DbTestException; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; public class DatabaseUtil { @@ -94,62 +98,66 @@ public static boolean insertUsePreparedStatement(final Connection conn, final St throws SQLException, ParseException { try (PreparedStatement pstmt = conn.prepareStatement(sql);) { for (Map data : datas) { - int index = 1; - for (Map.Entry each : data.entrySet()) { - String key = each.getKey(); - String datacol = each.getValue(); - String type = "String"; - if (config != null) { - for (ColumnDefinition eachColumnDefinition : config) { - if (key.equals(eachColumnDefinition.getName())) { - type = eachColumnDefinition.getType(); - } - } - } - if (type == null) { - type = "String"; - } - switch (type) { - case "byte": - pstmt.setByte(index, Byte.valueOf(datacol)); - break; - case "short": - pstmt.setShort(index, Short.valueOf(datacol)); - break; - case "int": - pstmt.setInt(index, Integer.valueOf(datacol)); - break; - case "long": - pstmt.setLong(index, Long.valueOf(datacol)); - break; - case "float": - pstmt.setFloat(index, Float.valueOf(datacol)); - break; - case "double": - pstmt.setDouble(index, Double.valueOf(datacol)); - break; - case "boolean": - pstmt.setBoolean(index, Boolean.valueOf(datacol)); - break; - case "Date": - FastDateFormat fdf = FastDateFormat.getInstance("yyyy-MM-dd"); - pstmt.setDate(index, new Date(fdf.parse(datacol).getTime())); - break; - case "String": - pstmt.setString(index, datacol); - break; - default: - pstmt.setString(index, datacol); - break; - } - index++; - } + sqlParameterProcessing(config, pstmt, data); pstmt.executeUpdate(); } } return true; } + private static void sqlParameterProcessing(final List config, final PreparedStatement pstmt, final Map data) throws SQLException, ParseException { + int index = 1; + for (Map.Entry each : data.entrySet()) { + String key = each.getKey(); + String datacol = each.getValue(); + String type = "String"; + if (config != null) { + for (ColumnDefinition eachColumnDefinition : config) { + if (key.equals(eachColumnDefinition.getName())) { + type = eachColumnDefinition.getType(); + } + } + } + if (type == null) { + type = "String"; + } + switch (type) { + case "byte": + pstmt.setByte(index, Byte.valueOf(datacol)); + break; + case "short": + pstmt.setShort(index, Short.valueOf(datacol)); + break; + case "int": + pstmt.setInt(index, Integer.valueOf(datacol)); + break; + case "long": + pstmt.setLong(index, Long.valueOf(datacol)); + break; + case "float": + pstmt.setFloat(index, Float.valueOf(datacol)); + break; + case "double": + pstmt.setDouble(index, Double.valueOf(datacol)); + break; + case "boolean": + pstmt.setBoolean(index, Boolean.valueOf(datacol)); + break; + case "Date": + FastDateFormat fdf = FastDateFormat.getInstance("yyyy-MM-dd"); + pstmt.setDate(index, new Date(fdf.parse(datacol).getTime())); + break; + case "String": + pstmt.setString(index, datacol); + break; + default: + pstmt.setString(index, datacol); + break; + } + index++; + } + } + /** * clear table. * @@ -163,6 +171,28 @@ public static void cleanAllUsePreparedStatement(final Connection conn, final Str } } + /** + * To determine if it is a query statement. + * + * @param sql sql + * @return true select + */ + public static boolean isSelect(final String sql) { + String newSql = sql.trim(); + return newSql.startsWith("select"); + } + + /** + * To determine whether the statement is an update. + * + * @param sql sql + * @return true update + */ + public static boolean isInsertOrUpdateOrDelete(final String sql) { + String newSql = sql.trim(); + return newSql.startsWith("insert") || newSql.startsWith("update") || newSql.startsWith("delete"); + } + /** * Use Statement Test data update. * @@ -384,7 +414,7 @@ public static DatasetDatabase selectUsePreparedStatementToExecuteSelect(final Co try (PreparedStatement pstmt = conn.prepareStatement(newSql)) { sqlPreparedStatement(parameter, pstmt); boolean flag = pstmt.execute(); - Assert.assertTrue("Not a query statement.", flag); + assertTrue("Not a query statement.", flag); try (ResultSet resultSet = pstmt.getResultSet()) { return usePreparedStatementBackResultSet(resultSet); } @@ -594,7 +624,7 @@ private static void sqlPreparedStatement(final List pa * @return java type */ private static String getDataType(final int type, final int scale) { - String result; + String result = null; switch (type) { case Types.INTEGER: result = "int"; @@ -659,46 +689,49 @@ public static void assertConfigs(final DatasetDefinition expected, final List> configs = expected.getMetadatas(); List columnDefinitions = configs.get(table); for (ColumnDefinition each : columnDefinitions) { - - for (ColumnDefinition definition : actual) { - if (each.getName().equals(definition.getName())) { - boolean flag2 = true; - if (StringUtils.isNotEmpty(each.getType())) { - if (!each.getType().equals(definition.getType())) { - flag2 = false; - } - } - if (flag2 && each.getDecimalDigits() != null) { - if (!each.getDecimalDigits().equals(definition.getDecimalDigits())) { - flag2 = false; - } - } - if (flag2 && each.getNullAble() != null) { - if (!each.getNullAble().equals(definition.getNullAble())) { - flag2 = false; - } - } - if (flag2 && each.getNumPrecRadix() != null) { - if (!each.getNumPrecRadix().equals(definition.getNumPrecRadix())) { - flag2 = false; - } - } - if (flag2 && each.getSize() != null) { - if (!each.getSize().equals(definition.getSize())) { - flag2 = false; - } - } - if (flag2 && each.getIsAutoincrement() != 0) { - if (each.getIsAutoincrement() != definition.getIsAutoincrement()) { - flag2 = false; + checkActual(actual, msg, each); + } + } + + private static void checkActual(final List actual, final String msg, final ColumnDefinition expect) { + for (ColumnDefinition each : actual) { + if (expect.getName().equals(each.getName())) { + if (StringUtils.isNotEmpty(expect.getType())) { + assertEquals(msg, expect.getType(), each.getType()); + } + if (expect.getDecimalDigits() != null && !expect.getDecimalDigits().equals(each.getDecimalDigits())) { + fail(msg); + } + if (expect.getNullAble() != null && !expect.getNullAble().equals(each.getNullAble())) { + fail(msg); + } + if (expect.getNumPrecRadix() != null && !expect.getNumPrecRadix().equals(each.getNumPrecRadix())) { + fail(msg); + } + if (expect.getSize() != null && !expect.getSize().equals(each.getSize())) { + fail(msg); + } + if (expect.getIsAutoincrement() != 0 && expect.getIsAutoincrement() != each.getIsAutoincrement()) { + fail(msg); + } + List indexs = expect.getIndexs(); + if (indexs != null && !indexs.isEmpty()) { + for (IndexDefinition expectIndex : indexs) { + for (IndexDefinition actualIndex : each.getIndexs()) { + if (expectIndex.getName().equals(actualIndex.getName())) { + if (expectIndex.getType() != null && !expectIndex.getType().equals(actualIndex.getType())) { + fail(msg); + } + + if (expectIndex.isUnique() != actualIndex.isUnique()) { + fail(msg); + } + + } } } - if (!flag2) { - assertTrue(msg, false); - } } } - } } @@ -707,15 +740,16 @@ public static void assertConfigs(final DatasetDefinition expected, final List> actualConfigs = actual.getMetadatas(); Map> expectedConfigs = expected.getMetadatas(); for (Map.Entry> each : expectedConfigs.entrySet()) { List config = each.getValue(); List actualConfig = actualConfigs.get(each.getKey()); - assertTrue(actualConfig != null); + assertNotNull(msg, actualConfig); for (ColumnDefinition eachColumn : config) { boolean flag = false; for (ColumnDefinition eachActualColumn : actualConfig) { @@ -733,7 +767,7 @@ public static void assertDatas(final DatasetDefinition expected, final DatasetDa List> data = stringListEntry.getValue(); List> actualDatas = actualDatass.get(stringListEntry.getKey()); - assertTrue(msg + " result set validation failed , The number of validation data and query data is not equal", data.size() == actualDatas.size()); + assertEquals(msg + " result set validation failed , The number of validation data and query data is not equal", actualDatas.size(), data.size()); for (int i = 0; i < data.size(); i++) { Map expectData = data.get(i); @@ -742,7 +776,7 @@ public static void assertDatas(final DatasetDefinition expected, final DatasetDa if (!stringStringEntry.getValue().equals(actualData.get(stringStringEntry.getKey()))) { String actualMsg = actualDatas.toString(); String expectMsg = data.toString(); - assertTrue(msg + " result set validation failed . describe : actual = " + actualMsg + " . expect = " + expectMsg, stringStringEntry.getValue().equals(actualData.get(stringStringEntry.getKey()))); + fail(msg + " result set validation failed . describe : actual = " + actualMsg + " . expect = " + expectMsg); } } @@ -766,24 +800,63 @@ public static List getColumnDefinitions(final Connection conn, while (rs.next()) { ColumnDefinition col = new ColumnDefinition(); String column = rs.getString("COLUMN_NAME"); + col.setName(column); + int size = rs.getInt("COLUMN_SIZE"); + col.setSize(size); + String columnType = rs.getString("TYPE_NAME").toLowerCase(); - int decimalDigits = rs.getInt("DECIMAL_DIGITS"); - int numPrecRadix = rs.getInt("NUM_PREC_RADIX"); - int nullAble = rs.getInt("NULLABLE"); - String isAutoincrement = rs.getString("IS_AUTOINCREMENT"); + col.setType(columnType); - col.setSize(size); + int decimalDigits = rs.getInt("DECIMAL_DIGITS"); col.setDecimalDigits(decimalDigits); + + int numPrecRadix = rs.getInt("NUM_PREC_RADIX"); col.setNumPrecRadix(numPrecRadix); + + int nullAble = rs.getInt("NULLABLE"); col.setNullAble(nullAble); + + String isAutoincrement = rs.getString("IS_AUTOINCREMENT"); if (StringUtils.isNotEmpty(isAutoincrement)) { col.setIsAutoincrement(1); } - col.setName(column); - col.setType(columnType); + cols.add(col); } + geIndexDefinitions(stmt, cols, table); + return cols; + } + } + + private static List geIndexDefinitions(final DatabaseMetaData stmt, final List cols, final String table) throws SQLException, ParseException { + try (ResultSet rs = stmt.getIndexInfo(null, null, table, false, false)) { + while (rs.next()) { + IndexDefinition index = new IndexDefinition(); + + String name = rs.getString("COLUMN_NAME"); + String nameIndex = rs.getString("INDEX_NAME"); + if (StringUtils.isNotEmpty(nameIndex)) { + index.setName(nameIndex); + } + + String typeIndex = rs.getString("TYPE"); + if (StringUtils.isNotEmpty(typeIndex)) { + index.setType(typeIndex); + } + + String uniqueIndex = rs.getString("NON_UNIQUE"); + if (StringUtils.isNotEmpty(uniqueIndex)) { + index.setUnique(!"TRUE".equalsIgnoreCase(uniqueIndex)); + } + + for (ColumnDefinition col : cols) { + if (name.equals(col.getName())) { + col.getIndexs().add(index); + break; + } + } + } return cols; } } diff --git a/sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/config/AnalyzeDataset.java b/sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/config/AnalyzeDataset.java index 1132e357fddd5..ec31aef5902b5 100644 --- a/sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/config/AnalyzeDataset.java +++ b/sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/config/AnalyzeDataset.java @@ -34,6 +34,7 @@ import io.shardingjdbc.dbtest.config.bean.ColumnDefinition; import io.shardingjdbc.dbtest.config.bean.DatasetDefinition; +import io.shardingjdbc.dbtest.config.bean.IndexDefinition; import io.shardingjdbc.dbtest.exception.DbTestException; import org.apache.commons.lang3.StringUtils; import org.w3c.dom.Attr; @@ -49,13 +50,14 @@ public class AnalyzeDataset { * Parsing the Dataset file. * * @param path path + * @param tableName tableName * @return DatasetDefinition * @throws IOException IOException * @throws SAXException SAXException * @throws ParserConfigurationException ParserConfigurationException * @throws XPathExpressionException XPathExpressionException */ - public static DatasetDefinition analyze(final String path, String tableName) + public static DatasetDefinition analyze(final String path, final String tableName) throws IOException, SAXException, ParserConfigurationException, XPathExpressionException { return analyze(new File(path), tableName); } @@ -64,20 +66,27 @@ public static DatasetDefinition analyze(final String path, String tableName) * Parsing the Dataset file. * * @param file file + * @param tableName tableName * @return DatasetDefinition * @throws IOException IOException * @throws SAXException SAXException * @throws ParserConfigurationException ParserConfigurationException * @throws XPathExpressionException XPathExpressionException */ - public static DatasetDefinition analyze(final File file, String tableName) + public static DatasetDefinition analyze(final File file, final String tableName) throws IOException, SAXException, ParserConfigurationException, XPathExpressionException { - Document doc = parseFile(file); - Node rootNode = getNode(doc, "/init"); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setValidating(false); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document doc = db.parse(file); + XPathFactory factory = XPathFactory.newInstance(); + XPath oXpath = factory.newXPath(); + Node rootNode = (Node) oXpath.evaluate("/init", doc, XPathConstants.NODE); if (rootNode == null) { throw new DbTestException("file :" + file.getPath() + "analyze error,Missing init tag"); } + NodeList firstNodeList = rootNode.getChildNodes(); DatasetDefinition result = new DatasetDefinition(); for (int i = 0; i < firstNodeList.getLength(); i++) { @@ -138,6 +147,11 @@ private static void analyzeTableConfig(final DatasetDefinition datasetDefinition if (StringUtils.isNotEmpty(numPrecRadix)) { cd.setSize(Integer.valueOf(numPrecRadix)); } + + NodeList indexNodeList = attNode.getChildNodes(); + if (indexNodeList != null && indexNodeList.getLength() != 0) { + getIndexs(indexNodeList, cd); + } } } @@ -146,6 +160,33 @@ private static void analyzeTableConfig(final DatasetDefinition datasetDefinition } + private static void getIndexs(final NodeList indexNodeList, final ColumnDefinition cd) { + List indexs = new ArrayList<>(); + cd.setIndexs(indexs); + for (int w = 0; w < indexNodeList.getLength(); w++) { + Node indexNode = indexNodeList.item(w); + if (indexNode.getNodeType() == Node.ELEMENT_NODE) { + IndexDefinition index = new IndexDefinition(); + String nameIndex = getAttr("name", indexNode); + if (StringUtils.isNotEmpty(nameIndex)) { + index.setName(nameIndex); + } + + String typeIndex = getAttr("type", indexNode); + if (StringUtils.isNotEmpty(typeIndex)) { + index.setType(typeIndex); + } + + String uniqueIndex = getAttr("unique", indexNode); + if (StringUtils.isNotEmpty(uniqueIndex)) { + index.setUnique(Boolean.valueOf(uniqueIndex)); + } + + indexs.add(index); + } + } + } + private static String getAttr(final String nodeName, final Node node) { NamedNodeMap attNodeList = node.getAttributes(); for (int n = 0; n < attNodeList.getLength(); n++) { @@ -188,39 +229,4 @@ private static void analyzeDataset(final DatasetDefinition result, final String } } - /** - * Parse the file to Document. - * - * @param file file - * @return Document - * @throws ParserConfigurationException ParserConfigurationException - * @throws IOException IOException - * @throws SAXException SAXException - */ - private static Document parseFile(final File file) throws ParserConfigurationException, IOException, SAXException { - DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); - dbf.setValidating(false); - DocumentBuilder db = dbf.newDocumentBuilder(); - Document result = db.parse(file); - - return result; - } - - /** - * Acquisition node. - * - * @param node node - * @param xpath xpath - * @return node - * @throws XPathExpressionException XPathExpressionException - */ - private static Node getNode(final Node node, final String xpath) throws XPathExpressionException { - XPathFactory factory = XPathFactory.newInstance(); - XPath oXpath = factory.newXPath(); - Node result = (Node) oXpath.evaluate(xpath, node, XPathConstants.NODE); - - return result; - } - - } diff --git a/sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/config/bean/ColumnDefinition.java b/sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/config/bean/ColumnDefinition.java index 588e6132b904d..2801b1f862a90 100644 --- a/sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/config/bean/ColumnDefinition.java +++ b/sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/config/bean/ColumnDefinition.java @@ -1,7 +1,27 @@ +/* + * Copyright 1999-2015 dangdang.com. + *

+ * Licensed 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 io.shardingjdbc.dbtest.config.bean; import lombok.Data; +import java.util.ArrayList; +import java.util.List; + @Data public class ColumnDefinition { @@ -19,4 +39,6 @@ public class ColumnDefinition { private int isAutoincrement; + private List indexs = new ArrayList<>(); + } diff --git a/sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/config/bean/IndexDefinition.java b/sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/config/bean/IndexDefinition.java new file mode 100644 index 0000000000000..5ace482f2a3dd --- /dev/null +++ b/sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/config/bean/IndexDefinition.java @@ -0,0 +1,30 @@ +/* + * Copyright 1999-2015 dangdang.com. + *

+ * Licensed 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 io.shardingjdbc.dbtest.config.bean; + +import lombok.Data; + +@Data +public class IndexDefinition { + + private String name; + + private String type; + + private boolean unique; +} diff --git a/sharding-jdbc-core/src/test/resources/asserts/create/assert-test.xml b/sharding-jdbc-core/src/test/resources/asserts/create/assert-test.xml index 35b0de975f9cc..f1d59036f0188 100644 --- a/sharding-jdbc-core/src/test/resources/asserts/create/assert-test.xml +++ b/sharding-jdbc-core/src/test/resources/asserts/create/assert-test.xml @@ -1,6 +1,14 @@ - + + + + + diff --git a/sharding-jdbc-core/src/test/resources/asserts/create/asserts/ddl/assertCreateIndex.xml b/sharding-jdbc-core/src/test/resources/asserts/create/asserts/ddl/assertCreateIndex.xml new file mode 100644 index 0000000000000..570fcd54c25ea --- /dev/null +++ b/sharding-jdbc-core/src/test/resources/asserts/create/asserts/ddl/assertCreateIndex.xml @@ -0,0 +1,10 @@ + + + + + + + +
+
+
diff --git a/sharding-jdbc-core/src/test/resources/asserts/create/asserts/ddl/assertCreateUniqueIndex.xml b/sharding-jdbc-core/src/test/resources/asserts/create/asserts/ddl/assertCreateUniqueIndex.xml new file mode 100644 index 0000000000000..78d5d4e102432 --- /dev/null +++ b/sharding-jdbc-core/src/test/resources/asserts/create/asserts/ddl/assertCreateUniqueIndex.xml @@ -0,0 +1,10 @@ + + + + + + + +
+
+