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 2020/04/09 10:30:48 UTC

[GitHub] [incubator-shardingsphere] tristaZero commented on a change in pull request #5110: add support for test of JoinSpecfication

tristaZero commented on a change in pull request #5110: add support for test of JoinSpecfication
URL: https://github.com/apache/incubator-shardingsphere/pull/5110#discussion_r406108543
 
 

 ##########
 File path: shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/asserts/segment/JoinSpecificationAssert.java
 ##########
 @@ -37,5 +64,142 @@
      * @param expected expected JoinSpecification
      */
     public static void assertIs(final SQLCaseAssertContext assertContext, final JoinSpecificationSegment actual, final ExpectedJoinSpecification expected) {
+        assertThat(assertContext.getText("startindex assert error"), actual.getStartIndex(), is(expected.getStartIndex()));
+        assertThat(assertContext.getText("stopindex assert error"), actual.getStopIndex(), is(expected.getStopIndex()));
+        assertAndPredicates(assertContext, actual.getAndPredicates(), expected.getAndPredicates());
+    
+    }
+    
+    private static void assertAndPredicates(final SQLCaseAssertContext assertContext, final Collection<AndPredicate> actual, final List<ExpectedAndPredicate> expected) {
 
 Review comment:
   Those functions are the same as these in `WhereClauseAssert`. My suggestion is to extract `PredicatesAssert`, which will be used by `WhereClauseAssert` and this one.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services