vvysotskyi commented on a change in pull request #1714: DRILL-7048: Implement 
JDBC Statement.setMaxRows() with System Option
URL: https://github.com/apache/drill/pull/1714#discussion_r269710761
 
 

 ##########
 File path: 
exec/jdbc/src/test/java/org/apache/drill/jdbc/PreparedStatementTest.java
 ##########
 @@ -410,6 +417,155 @@ public void testNonTriggeredQueryTimeout() throws 
SQLException {
     }
   }
 
+  ////////////////////////////////////////
+  // Query maxRows methods:
+
+  /**
+   * Test for reading of default max rows
+   */
+  @Test
+  public void   testDefaultGetMaxRows() throws SQLException {
+    try (PreparedStatement pStmt = 
connection.prepareStatement(SYS_OPTIONS_SQL)) {
+      int maxRowsValue = pStmt.getMaxRows();
+      assertEquals(0, maxRowsValue);
+    }
+  }
+
+  /**
+   * Test Invalid parameter by giving negative maxRows value
+   */
+  @Test
+  public void testInvalidSetMaxRows() throws SQLException {
+    try (PreparedStatement pStmt = 
connection.prepareStatement(SYS_OPTIONS_SQL)) {
+      //Setting negative value
+      int valueToSet = -10;
+      try {
+        pStmt.setMaxRows(valueToSet);
+      } catch ( final SQLException e) {
 
 Review comment:
   ```suggestion
         } catch (final SQLException e) {
   ```

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


With regards,
Apache Git Services

Reply via email to