You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/09/08 06:43:30 UTC

[GitHub] [shardingsphere] LeeGuoPing commented on a diff in pull request #20873: Refactor DistSQL RAL assertion logic of integration test

LeeGuoPing commented on code in PR #20873:
URL: https://github.com/apache/shardingsphere/pull/20873#discussion_r965563476


##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/ral/BaseRALIT.java:
##########
@@ -106,23 +115,27 @@ private void assertMetaData(final ResultSetMetaData actual, final Collection<Dat
         }
     }
     
-    private void assertRows(final ResultSet actual, final List<DataSetRow> expected) throws SQLException {
+    private void assertRows(final ResultSet actual, final Collection<String> notAssertionColumns, final List<DataSetRow> expected) throws SQLException {
         int rowCount = 0;
         ResultSetMetaData actualMetaData = actual.getMetaData();
         while (actual.next()) {
             assertTrue("Size of actual result set is different with size of expected dat set rows.", rowCount < expected.size());
-            assertRow(actual, actualMetaData, expected.get(rowCount));
+            assertRow(actual, notAssertionColumns, actualMetaData, expected.get(rowCount));
             rowCount++;
         }
         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 {
+    private void assertRow(final ResultSet actual, final Collection<String> notAssertionColumns, final ResultSetMetaData actualMetaData, final DataSetRow expected) throws SQLException {
         int columnIndex = 1;
         for (String each : expected.splitValues("|")) {
             String columnLabel = actualMetaData.getColumnLabel(columnIndex);
-            assertObjectValue(actual, columnIndex, columnLabel, each);
-            columnIndex++;
+            if (notAssertionColumns.contains(columnLabel)) {

Review Comment:
           if (!notAssertionColumns.contains(columnLabel)) {
               assertObjectValue(actual, columnIndex, columnLabel, each);
           }
           columnIndex++;



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org