KazydubB commented on a change in pull request #1825: DRILL-7084: ResultSet 
getObject method throws not implemented excepti…
URL: https://github.com/apache/drill/pull/1825#discussion_r302716445
 
 

 ##########
 File path: 
exec/jdbc/src/test/java/org/apache/drill/jdbc/DrillResultSetTest.java
 ##########
 @@ -45,123 +46,131 @@
       ExecConstants.HTTP_ENABLE;
 
   private static final String origStatusServerPropValue =
-      System.getProperty( STATUS_SERVER_PROPERTY_NAME, "true" );
+      System.getProperty(STATUS_SERVER_PROPERTY_NAME, "true");
 
   // Disable Jetty status server so unit tests run (outside Maven setup).
   // (TODO:  Move this to base test class and/or have Jetty try other ports.)
   @BeforeClass
   public static void setUpClass() {
-    System.setProperty( STATUS_SERVER_PROPERTY_NAME, "false" );
+    System.setProperty(STATUS_SERVER_PROPERTY_NAME, "false");
   }
 
   @AfterClass
   public static void tearDownClass() {
-    System.setProperty( STATUS_SERVER_PROPERTY_NAME, origStatusServerPropValue 
);
+    System.setProperty(STATUS_SERVER_PROPERTY_NAME, origStatusServerPropValue);
   }
 
 
   @Test
   public void test_next_blocksFurtherAccessAfterEnd()
-      throws SQLException
-  {
+      throws SQLException {
     Connection connection = connect();
     Statement statement = connection.createStatement();
     ResultSet resultSet =
-        statement.executeQuery( "SELECT 1 AS x \n" +
-                                "FROM cp.`donuts.json` \n" +
-                                "LIMIT 2" );
+        statement.executeQuery("SELECT 1 AS x \n" +
+            "FROM cp.`donuts.json` \n" +
+            "LIMIT 2");
 
     // Advance to first row; confirm can access data.
-    assertThat( resultSet.next(), is( true ) );
-    assertThat( resultSet.getInt( 1 ), is ( 1 ) );
+    assertThat(resultSet.next(), is(true));
+    assertThat(resultSet.getInt(1), is(1));
 
     // Advance from first to second (last) row, confirming data access.
-    assertThat( resultSet.next(), is( true ) );
-    assertThat( resultSet.getInt( 1 ), is ( 1 ) );
+    assertThat(resultSet.next(), is(true));
+    assertThat(resultSet.getInt(1), is(1));
 
     // Now advance past last row.
-    assertThat( resultSet.next(), is( false ) );
+    assertThat(resultSet.next(), is(false));
 
     // Main check:  That row data access methods now throw SQLException.
     try {
-      resultSet.getInt( 1 );
-      fail( "Didn't get expected SQLException." );
-    }
-    catch ( SQLException e ) {
+      resultSet.getInt(1);
+      fail("Didn't get expected SQLException.");
+    } catch (SQLException e) {
 
 Review comment:
   Here and below: catch expected `Exception` type instead of verifying it with 
`instanceOf(...)` and change `assertThat(e.toString(), containsString("past"))` 
to `assertThat(e.getMessage(), containsString("past"))` (also I suppose it is 
safe to check message completely rather than just if it contains one word).

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