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


##########
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/planner/AbstractPlannerTest.java:
##########
@@ -805,4 +857,79 @@ class TestFailureProcessor extends FailureProcessor {
             return true;
         }
     }
+
+    /** Test planning context builder. */
+    public static class TestPlanningContextBuilder {
+        /** */
+        private String query;
+
+        /** */
+        private Collection<IgniteSchema> schemas;
+
+        /** */
+        private Collection<Object> params = List.of();
+
+        /** */
+        private Collection<String> disabledRules = List.of();
+
+        /** */
+        @Nullable private RelOptListener planListener;
+
+        /** */
+        public TestPlanningContextBuilder query(String qry) {
+            query = qry;
+            return this;
+        }
+
+        /** */
+        public TestPlanningContextBuilder schema(IgniteSchema schemas) {
+            this.schemas = List.of(schemas);
+            return this;
+        }
+
+        /** */
+        public TestPlanningContextBuilder schemas(Collection<IgniteSchema> 
schemas) {
+            this.schemas = List.copyOf(schemas);
+            return this;
+        }
+
+        /** */
+        public TestPlanningContextBuilder params(Collection<Object> params) {
+            this.params = List.copyOf(params);
+            return this;
+        }
+
+        /** */
+        public TestPlanningContextBuilder params(Object... params) {
+            this.params = Arrays.asList(params);
+            return this;
+        }
+
+        /** */
+        public TestPlanningContextBuilder disabledRules(String... rules) {
+            disabledRules = List.of(rules);
+            return this;
+        }
+
+        /** */
+        public TestPlanningContextBuilder planListener(@Nullable 
RelOptListener planListener) {
+            this.planListener = planListener;
+            return this;
+        }
+    }
+
+    /** */
+    public static TestPlanningContextBuilder contextBuilder() {
+        return new TestPlanningContextBuilder();
+    }
+
+    /** */
+    @SuppressWarnings("ThrowableNotThrown")
+    static void assertThrows(

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