You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2022/10/18 12:14:34 UTC

[shardingsphere] branch master updated: add IT test (#21550)

This is an automated email from the ASF dual-hosted git repository.

zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new d88f7507470 add IT test (#21550)
d88f7507470 is described below

commit d88f7507470e90a004cc9e847b13f2ecd38b3968
Author: cheese8 <yi...@163.com>
AuthorDate: Tue Oct 18 20:14:26 2022 +0800

    add IT test (#21550)
---
 .../tbl/batch_insert_all_into_order_table.xml      | 50 ++++++++++++++++++++++
 .../cases/dml/dml-integration-test-cases.xml       |  6 ++-
 2 files changed, 55 insertions(+), 1 deletion(-)

diff --git a/test/integration-test/test-suite/src/test/resources/cases/dml/dataset/tbl/batch_insert_all_into_order_table.xml b/test/integration-test/test-suite/src/test/resources/cases/dml/dataset/tbl/batch_insert_all_into_order_table.xml
new file mode 100644
index 00000000000..829a8182455
--- /dev/null
+++ b/test/integration-test/test-suite/src/test/resources/cases/dml/dataset/tbl/batch_insert_all_into_order_table.xml
@@ -0,0 +1,50 @@
+<!--
+  ~ 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 update-count="2">
+    <metadata data-nodes="tbl.t_order_${0..9}">
+        <column name="order_id" type="numeric" />
+        <column name="user_id" type="numeric" />
+        <column name="status" type="varchar" />
+        <column name="merchant_id" type="numeric" />
+        <column name="remark" type="varchar" />
+        <column name="creation_date" type="datetime" />
+    </metadata>
+    <row data-node="tbl.t_order_0" values="1000, 10, init, 1, test, 2017-08-08" />
+    <row data-node="tbl.t_order_1" values="1, 1, insert, 1, test, 2017-08-08" />
+    <row data-node="tbl.t_order_1" values="1001, 10, init, 2, test, 2017-08-08" />
+    <row data-node="tbl.t_order_2" values="2, 2, insert, 2, test, 2017-08-08" />
+    <row data-node="tbl.t_order_2" values="1002, 10, init, 3, test, 2017-08-08" />
+    <row data-node="tbl.t_order_3" values="1003, 10, init, 4, test, 2017-08-08" />
+    <row data-node="tbl.t_order_4" values="1004, 10, init, 5, test, 2017-08-08" />
+    <row data-node="tbl.t_order_5" values="1005, 10, init, 6, test, 2017-08-08" />
+    <row data-node="tbl.t_order_6" values="1006, 10, init, 7, test, 2017-08-08" />
+    <row data-node="tbl.t_order_7" values="1007, 10, init, 8, test, 2017-08-08" />
+    <row data-node="tbl.t_order_8" values="1008, 10, init, 9, test, 2017-08-08" />
+    <row data-node="tbl.t_order_9" values="1009, 10, init, 10, test, 2017-08-08" />
+    <row data-node="tbl.t_order_0" values="1100, 11, init, 11, test, 2017-08-08" />
+    <row data-node="tbl.t_order_1" values="1101, 11, init, 12, test, 2017-08-08" />
+    <row data-node="tbl.t_order_2" values="1102, 11, init, 13, test, 2017-08-08" />
+    <row data-node="tbl.t_order_3" values="1103, 11, init, 14, test, 2017-08-08" />
+    <row data-node="tbl.t_order_4" values="1104, 11, init, 15, test, 2017-08-08" />
+    <row data-node="tbl.t_order_5" values="1105, 11, init, 16, test, 2017-08-08" />
+    <row data-node="tbl.t_order_6" values="1106, 11, init, 17, test, 2017-08-08" />
+    <row data-node="tbl.t_order_7" values="1107, 11, init, 18, test, 2017-08-08" />
+    <row data-node="tbl.t_order_8" values="1108, 11, init, 19, test, 2017-08-08" />
+    <row data-node="tbl.t_order_9" values="1109, 11, init, 20, test, 2017-08-08" />
+    <row data-node="tbl.t_order_9" values="999, 10, insertALL, 1, test, 2017-08-08" />
+</dataset>
diff --git a/test/integration-test/test-suite/src/test/resources/cases/dml/dml-integration-test-cases.xml b/test/integration-test/test-suite/src/test/resources/cases/dml/dml-integration-test-cases.xml
index 1ca9b9ac974..70a74b180d4 100644
--- a/test/integration-test/test-suite/src/test/resources/cases/dml/dml-integration-test-cases.xml
+++ b/test/integration-test/test-suite/src/test/resources/cases/dml/dml-integration-test-cases.xml
@@ -71,7 +71,11 @@
     <test-case sql="INSERT INTO t_order_item SET item_id = ?, order_id = ?, user_id = ?, product_id = 1, quantity = 1, creation_date='2017-08-08'" db-types="MySQL,SQLServer,Oracle" scenario-types="db,tbl,dbtbl_with_readwrite_splitting,readwrite_splitting">
         <assertion parameters="1:int, 1:int, 1:int" expected-data-file="insert_with_generate_key_column.xml" />
     </test-case>
-    
+
+    <test-case sql="INSERT ALL INTO t_order (order_id, user_id, status, merchant_id, remark, creation_date) VALUES (?, ?, ?, 1, 'test', '2017-08-08') SELECT 1 FROM DUAL" db-types="Oracle" scenario-types="tbl">
+        <assertion parameters="999:int, 10:int, insertALL:String" expected-data-file="batch_insert_all_into_order_table.xml" />
+    </test-case>
+
     <test-case sql="INSERT INTO t_order_item values(?, ?, 1, 1, '2017-08-08')" scenario-types="db,tbl,dbtbl_with_readwrite_splitting">
         <assertion sharding-rule-type="dbtbl_with_readwrite_splitting" parameters="1:int, 1:int" expected-data-file="insert_without_generate_key_column.xml" />
         <!-- TODO add gen column on create table -->