zstan commented on code in PR #13602:
URL: https://github.com/apache/ignite/pull/13602#discussion_r4104067212


##########
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/QueryChecker.java:
##########
@@ -217,36 +217,56 @@ public static Matcher<String> containsSubPlan(String 
subPlan) {
 
     /** */
     public static Matcher<String> matches(final String substring) {
-        return new SubstringMatcher(substring) {
+        return new SubstringMatcher("contains", false, substring) {
             /** {@inheritDoc} */
             @Override protected boolean evalSubstringOf(String sIn) {
                 sIn = sIn.replaceAll("\n", "");
 
                 return sIn.matches(substring);
             }
+        };
+    }
 
+    /** Matches only one occurrence. */
+    static Matcher<String> matchesOnce(String pattern) {
+        return occursTimes(pattern, 1, true);
+    }
+
+    /** Has specified number of occurrence. */
+    static Matcher<String> occursTimes(String pattern, int times, boolean 
noMore) {
+        return new SubstringMatcher(resolveRelation(times, noMore), false, 
pattern) {
             /** {@inheritDoc} */
-            @Override protected String relationship() {
-                return null;
+            @Override protected boolean evalSubstringOf(String strIn) {
+                strIn = strIn.replaceAll(System.lineSeparator(), "");
+
+                return contains(strIn, substring, times, noMore);
             }
         };
     }
 
-    /** Matches only one occurance. */
-    public static Matcher<String> matchesOnce(final String substring) {
-        return new SubstringMatcher(substring) {
-            /** {@inheritDoc} */
-            @Override protected boolean evalSubstringOf(String sIn) {
-                sIn = sIn.replaceAll("\n", "");
+    /** */
+    private static String resolveRelation(int times, boolean noMore) {
+        assert times >= 0;

Review Comment:
   done



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to