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/11/15 04:00:57 UTC

[GitHub] [shardingsphere] yx9o commented on a diff in pull request #22176: Enhance the test case of ConvertYamlConfigurationHandler.

yx9o commented on code in PR #22176:
URL: https://github.com/apache/shardingsphere/pull/22176#discussion_r1022293895


##########
proxy/backend/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ConvertYamlConfigurationHandlerTest.java:
##########
@@ -123,9 +130,19 @@ private void assertQueryHeader(final QueryHeader actual) {
         assertFalse(actual.isAutoIncrement());
     }
     
-    private void assertRowData(final Collection<Object> actual, final String expectedFilePath) {
-        assertThat(actual.size(), is(1));
-        assertThat(actual.iterator().next(), is(loadExpectedRow(expectedFilePath)));
+    private void assertRowData(final Collection<Object> data, final String expectedFilePath) {
+        assertThat(data.size(), is(1));
+        Object actual = data.iterator().next();
+        assertThat(actual, is(loadExpectedRow(expectedFilePath)));
+        assertParseSQL((String) actual);
+    }
+    
+    private void assertParseSQL(final String actual) {
+        for (String each : Splitter.on(";").trimResults().splitToList(actual)) {
+            if (!Strings.isNullOrEmpty(each)) {
+                assertNotNull(sqlParserRule.getSQLParserEngine("MYSQL").parse(each, false));

Review Comment:
   OK, thanks.



-- 
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