tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1360606 - in /tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver: Connection.java Driver.java ResultSet.java Statement.java
Date Thu, 12 Jul 2012 09:56:17 GMT
Author: markt
Date: Thu Jul 12 09:56:17 2012
New Revision: 1360606

URL: http://svn.apache.org/viewvc?rev=1360606&view=rev
Log:
Get jdbc-pool tests compiling with Java 7

Modified:
    tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/Connection.java
    tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/Driver.java
    tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/ResultSet.java
    tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/Statement.java

Modified: tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/Connection.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/Connection.java?rev=1360606&r1=1360605&r2=1360606&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/Connection.java
(original)
+++ tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/Connection.java
Thu Jul 12 09:56:17 2012
@@ -32,6 +32,7 @@ import java.sql.Statement;
 import java.sql.Struct;
 import java.util.Map;
 import java.util.Properties;
+import java.util.concurrent.Executor;
 
 import org.apache.tomcat.jdbc.pool.PooledConnection;
 
@@ -284,4 +285,25 @@ public class Connection implements java.
         return null;
     }
 
+    // ---------------------------------------------------------- Java 7 methods
+    // Can't add @Override annotations since this code also has to compile with
+    // Java 6 for Tomcat 7.
+
+    public void setSchema(String schema) throws SQLException {
+    }
+
+    public String getSchema() throws SQLException {
+        return null;
+    }
+
+    public void abort(Executor executor) throws SQLException {
+    }
+
+    public void setNetworkTimeout(Executor executor, int milliseconds)
+            throws SQLException {
+    }
+
+    public int getNetworkTimeout() throws SQLException {
+        return 0;
+    }
 }

Modified: tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/Driver.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/Driver.java?rev=1360606&r1=1360605&r2=1360606&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/Driver.java
(original)
+++ tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/Driver.java
Thu Jul 12 09:56:17 2012
@@ -20,8 +20,10 @@ import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.DriverPropertyInfo;
 import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
 import java.util.Properties;
 import java.util.concurrent.atomic.AtomicInteger;
+import java.util.logging.Logger;
 
 public class Driver implements java.sql.Driver {
     public static final String url = "jdbc:tomcat:test";
@@ -75,4 +77,13 @@ public class Driver implements java.sql.
     public boolean jdbcCompliant() {
         return false;
     }
+
+    // ---------------------------------------------------------- Java 7 methods
+    // Can't add @Override annotations since this code also has to compile with
+    // Java 6 for Tomcat 7.
+
+    @Override
+    public Logger getParentLogger() throws SQLFeatureNotSupportedException {
+        return null;
+    }
 }

Modified: tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/ResultSet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/ResultSet.java?rev=1360606&r1=1360605&r2=1360606&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/ResultSet.java
(original)
+++ tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/ResultSet.java
Thu Jul 12 09:56:17 2012
@@ -1208,4 +1208,16 @@ public class ResultSet implements java.s
         return null;
     }
 
+    // ---------------------------------------------------------- Java 7 methods
+    // Can't add @Override annotations since this code also has to compile with
+    // Java 6 for Tomcat 7.
+
+    public <T> T getObject(int columnIndex, Class<T> type) throws SQLException
{
+        return null;
+    }
+
+    public <T> T getObject(String columnLabel, Class<T> type)
+            throws SQLException {
+        return null;
+    }
 }

Modified: tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/Statement.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/Statement.java?rev=1360606&r1=1360605&r2=1360606&view=diff
==============================================================================
--- tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/Statement.java
(original)
+++ tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/driver/Statement.java
Thu Jul 12 09:56:17 2012
@@ -1291,4 +1291,24 @@ public class Statement implements Callab
         return null;
     }
 
+    // ---------------------------------------------------------- Java 7 methods
+    // Can't add @Override annotations since this code also has to compile with
+    // Java 6 for Tomcat 7.
+
+    public void closeOnCompletion() throws SQLException {
+    }
+
+    public boolean isCloseOnCompletion() throws SQLException {
+        return false;
+    }
+
+    public <T> T getObject(int parameterIndex, Class<T> type)
+            throws SQLException {
+        return null;
+    }
+
+    public <T> T getObject(String parameterName, Class<T> type)
+            throws SQLException {
+        return null;
+    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message