[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

2016-12-12 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/drill/pull/676


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

2016-12-09 Thread sudheeshkatkam
Github user sudheeshkatkam commented on a diff in the pull request:

https://github.com/apache/drill/pull/676#discussion_r91797180
  
--- Diff: 
exec/jdbc/src/test/java/org/apache/drill/jdbc/test/Drill2489CallsAfterCloseThrowExceptionsTest.java
 ---
@@ -477,18 +468,32 @@ public void testClosedConnectionMethodsThrowRight() {
 }
 
 @Override
+protected boolean isOkayNonthrowingMethod(Method method) {
+  // Java 8 method
+  if ("getLargeUpdateCount".equals(method.getName())) {
+return true; }
+  return super.isOkayNonthrowingMethod(method);
+}
+
+@Override
 protected boolean isOkaySpecialCaseException(Method method, Throwable 
cause) {
   final boolean result;
   if (super.isOkaySpecialCaseException(method, cause)) {
 result = true;
   }
+  else if (   method.getName().equals("executeLargeBatch")
+   || method.getName().equals("executeLargeUpdate")) {
+// New Java 8 methods not implemented in Avatica.
--- End diff --

Please open a ticket for this, so we make changes once Avatica supports 
Java 8, add TODOs instead of comments for easy tracking 
([example](https://github.com/apache/drill/blob/master/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/FragmentWrapper.java#L103)).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

2016-12-07 Thread paul-rogers
Github user paul-rogers commented on a diff in the pull request:

https://github.com/apache/drill/pull/676#discussion_r91426377
  
--- Diff: 
exec/jdbc/src/test/java/org/apache/drill/jdbc/test/Drill2489CallsAfterCloseThrowExceptionsTest.java
 ---
@@ -543,6 +566,14 @@ else if (RuntimeException.class == cause.getClass()
 // Special good-enough case--we had to use RuntimeException for 
now.
 result = true;
   }
+  else if (  method.getName().equals("setObject")
--- End diff --

Same style issue as earlier.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

2016-12-07 Thread paul-rogers
Github user paul-rogers commented on a diff in the pull request:

https://github.com/apache/drill/pull/676#discussion_r91429339
  
--- Diff: 
exec/jdbc/src/test/java/org/apache/drill/jdbc/test/JdbcAssert.java ---
@@ -66,6 +66,11 @@ public static void setFactory(ConnectionFactory factory) 
{
   public static Properties getDefaultProperties() {
 final Properties properties = new Properties();
 properties.setProperty("drillJDBCUnitTests", "true");
+
+// Must set this to false to ensure that the tests ignore any existing
+// plugin configurations stored in /tmp/drill.
+
--- End diff --

I prefer extra lines around comments. Makes the flow less cluttered.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

2016-12-07 Thread paul-rogers
Github user paul-rogers commented on a diff in the pull request:

https://github.com/apache/drill/pull/676#discussion_r91426330
  
--- Diff: 
exec/jdbc/src/test/java/org/apache/drill/jdbc/test/Drill2489CallsAfterCloseThrowExceptionsTest.java
 ---
@@ -477,18 +477,32 @@ public void testClosedConnectionMethodsThrowRight() {
 }
 
 @Override
+protected boolean isOkayNonthrowingMethod(Method method) {
+  // Java 8 method
+  if ( "getLargeUpdateCount".equals(method.getName())) {
+return true; }
+  return super.isOkayNonthrowingMethod(method);
+}
+
+@Override
 protected boolean isOkaySpecialCaseException(Method method, Throwable 
cause) {
   final boolean result;
   if (super.isOkaySpecialCaseException(method, cause)) {
 result = true;
   }
+  else if (   method.getName().equals("executeLargeBatch")
--- End diff --

This one stays... The style in this file was to align the terms in the 
conditional. Following a pattern established elsewhere in the file.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

2016-12-07 Thread ppadma
Github user ppadma commented on a diff in the pull request:

https://github.com/apache/drill/pull/676#discussion_r91421952
  
--- Diff: 
exec/jdbc/src/test/java/org/apache/drill/jdbc/test/Drill2489CallsAfterCloseThrowExceptionsTest.java
 ---
@@ -477,18 +477,32 @@ public void testClosedConnectionMethodsThrowRight() {
 }
 
 @Override
+protected boolean isOkayNonthrowingMethod(Method method) {
+  // Java 8 method
+  if ( "getLargeUpdateCount".equals(method.getName())) {
+return true; }
--- End diff --

remove extra space after if ( .  
} in a separate line.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

2016-12-07 Thread ppadma
Github user ppadma commented on a diff in the pull request:

https://github.com/apache/drill/pull/676#discussion_r91423240
  
--- Diff: 
exec/jdbc/src/test/java/org/apache/drill/jdbc/test/Drill2769UnsupportedReportsUseSqlExceptionTest.java
 ---
@@ -280,6 +280,10 @@ else if (NullPointerException.class == cause.getClass()
   // code implements them.
   successLinesBuf.append(resultLine);
 }
+else if (isOkaySpecialCaseException(method, cause)) {
+  successLinesBuf.append(resultLine);
+}
+
--- End diff --

remove extra line


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

2016-12-07 Thread ppadma
Github user ppadma commented on a diff in the pull request:

https://github.com/apache/drill/pull/676#discussion_r91421707
  
--- Diff: 
exec/jdbc/src/test/java/org/apache/drill/jdbc/test/Drill2769UnsupportedReportsUseSqlExceptionTest.java
 ---
@@ -397,10 +419,19 @@ public void testPlainStatementMethodsThrowRight() {
   this.factoryConnection = factoryConnection;
 }
 
+@Override
 protected PreparedStatement getJdbcObject() throws SQLException {
   return factoryConnection.prepareStatement("VALUES 1");
 }
 
+@Override
+protected boolean isOkaySpecialCaseException(Method method,
+ Throwable cause) {
+   // New Java 8 method not supported by Avatica
+
--- End diff --

remove the extra line


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

2016-12-07 Thread ppadma
Github user ppadma commented on a diff in the pull request:

https://github.com/apache/drill/pull/676#discussion_r91421638
  
--- Diff: 
exec/jdbc/src/test/java/org/apache/drill/jdbc/test/JdbcAssert.java ---
@@ -66,6 +66,11 @@ public static void setFactory(ConnectionFactory factory) 
{
   public static Properties getDefaultProperties() {
 final Properties properties = new Properties();
 properties.setProperty("drillJDBCUnitTests", "true");
+
+// Must set this to false to ensure that the tests ignore any existing
+// plugin configurations stored in /tmp/drill.
+
--- End diff --

remove the extra line


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

2016-12-07 Thread ppadma
Github user ppadma commented on a diff in the pull request:

https://github.com/apache/drill/pull/676#discussion_r91422697
  
--- Diff: 
exec/jdbc/src/test/java/org/apache/drill/jdbc/test/Drill2769UnsupportedReportsUseSqlExceptionTest.java
 ---
@@ -368,10 +381,19 @@ public void testConnectionMethodsThrowRight() {
   this.factoryConnection = factoryConnection;
 }
 
+@Override
 protected Statement getJdbcObject() throws SQLException {
   return factoryConnection.createStatement();
 }
 
+@Override
+protected boolean isOkaySpecialCaseException(Method method,
+ Throwable cause) {
+   // New Java 8 method not supported by Avatica
+
--- End diff --

remove the extra line


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

2016-12-07 Thread ppadma
Github user ppadma commented on a diff in the pull request:

https://github.com/apache/drill/pull/676#discussion_r91422511
  
--- Diff: 
exec/jdbc/src/test/java/org/apache/drill/jdbc/test/Drill2489CallsAfterCloseThrowExceptionsTest.java
 ---
@@ -543,6 +566,14 @@ else if (RuntimeException.class == cause.getClass()
 // Special good-enough case--we had to use RuntimeException for 
now.
 result = true;
   }
+  else if (  method.getName().equals("setObject")
--- End diff --

remove extra space after if


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

2016-12-07 Thread ppadma
Github user ppadma commented on a diff in the pull request:

https://github.com/apache/drill/pull/676#discussion_r91422118
  
--- Diff: 
exec/jdbc/src/test/java/org/apache/drill/jdbc/test/Drill2489CallsAfterCloseThrowExceptionsTest.java
 ---
@@ -477,18 +477,32 @@ public void testClosedConnectionMethodsThrowRight() {
 }
 
 @Override
+protected boolean isOkayNonthrowingMethod(Method method) {
+  // Java 8 method
+  if ( "getLargeUpdateCount".equals(method.getName())) {
+return true; }
+  return super.isOkayNonthrowingMethod(method);
+}
+
+@Override
 protected boolean isOkaySpecialCaseException(Method method, Throwable 
cause) {
   final boolean result;
   if (super.isOkaySpecialCaseException(method, cause)) {
 result = true;
   }
+  else if (   method.getName().equals("executeLargeBatch")
--- End diff --

remove extra space after if. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

2016-12-07 Thread ppadma
Github user ppadma commented on a diff in the pull request:

https://github.com/apache/drill/pull/676#discussion_r91422620
  
--- Diff: 
exec/jdbc/src/test/java/org/apache/drill/jdbc/test/Drill2489CallsAfterCloseThrowExceptionsTest.java
 ---
@@ -587,6 +618,12 @@ else if (RuntimeException.class == cause.getClass()
 // Special good-enough case--we had to use RuntimeException for 
now.
 result = true;
   }
+  else if (SQLFeatureNotSupportedException.class == cause.getClass()
+  && (   method.getName().equals("updateObject")
--- End diff --

extra space after ( .   move && to line above. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---