From d415ba8353f502ff61e4a6d11c96ce3124067584 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Mon, 17 Mar 2014 11:07:34 +0100 Subject: [PATCH] Add @Override annotation where needed. Starting with Java 6, we can annotate with @Override a class method implementing a method from an interface. --- .../java/com/zaxxer/hikari/HikariConfig.java | 19 ++ .../com/zaxxer/hikari/HikariDataSource.java | 9 + .../java/com/zaxxer/hikari/HikariPool.java | 1 + .../zaxxer/hikari/proxy/ConnectionProxy.java | 29 +++ .../hikari/proxy/PreparedStatementProxy.java | 1 + .../zaxxer/hikari/proxy/StatementProxy.java | 5 + .../zaxxer/hikari/util/DriverDataSource.java | 1 + .../zaxxer/hikari/mocks/MockDataSource.java | 10 + .../hikari/mocks/StubBaseConnection.java | 2 + .../zaxxer/hikari/mocks/StubConnection.java | 52 +++++ .../zaxxer/hikari/mocks/StubDataSource.java | 9 + .../com/zaxxer/hikari/mocks/StubDriver.java | 7 + .../hikari/mocks/StubPreparedStatement.java | 96 +++++++++ .../zaxxer/hikari/mocks/StubResultSet.java | 191 ++++++++++++++++++ .../zaxxer/hikari/mocks/StubStatement.java | 44 ++++ 15 files changed, 476 insertions(+) diff --git a/src/main/java/com/zaxxer/hikari/HikariConfig.java b/src/main/java/com/zaxxer/hikari/HikariConfig.java index c8bee7d6..67660cc9 100644 --- a/src/main/java/com/zaxxer/hikari/HikariConfig.java +++ b/src/main/java/com/zaxxer/hikari/HikariConfig.java @@ -144,12 +144,14 @@ public class HikariConfig implements HikariConfigMBean } /** {@inheritDoc} */ + @Override public int getAcquireIncrement() { return acquireIncrement; } /** {@inheritDoc} */ + @Override public void setAcquireIncrement(int acquireIncrement) { if (acquireIncrement < 1) @@ -160,12 +162,14 @@ public class HikariConfig implements HikariConfigMBean } /** {@inheritDoc} */ + @Override public int getAcquireRetries() { return acquireRetries; } /** {@inheritDoc} */ + @Override public void setAcquireRetries(int acquireRetries) { if (acquireRetries < 0) @@ -176,12 +180,14 @@ public class HikariConfig implements HikariConfigMBean } /** {@inheritDoc} */ + @Override public long getAcquireRetryDelay() { return acquireRetryDelay; } /** {@inheritDoc} */ + @Override public void setAcquireRetryDelay(long acquireRetryDelayMs) { if (acquireRetryDelayMs < 0) @@ -280,12 +286,14 @@ public class HikariConfig implements HikariConfigMBean } /** {@inheritDoc} */ + @Override public long getConnectionTimeout() { return connectionTimeout; } /** {@inheritDoc} */ + @Override public void setConnectionTimeout(long connectionTimeoutMs) { if (connectionTimeoutMs == 0) @@ -363,12 +371,14 @@ public class HikariConfig implements HikariConfigMBean } /** {@inheritDoc} */ + @Override public long getIdleTimeout() { return idleTimeout; } /** {@inheritDoc} */ + @Override public void setIdleTimeout(long idleTimeoutMs) { this.idleTimeout = idleTimeoutMs; @@ -467,12 +477,14 @@ public class HikariConfig implements HikariConfigMBean } /** {@inheritDoc} */ + @Override public long getLeakDetectionThreshold() { return leakDetectionThreshold; } /** {@inheritDoc} */ + @Override public void setLeakDetectionThreshold(long leakDetectionThresholdMs) { this.leakDetectionThreshold = leakDetectionThresholdMs; @@ -484,24 +496,28 @@ public class HikariConfig implements HikariConfigMBean } /** {@inheritDoc} */ + @Override public long getMaxLifetime() { return maxLifetime; } /** {@inheritDoc} */ + @Override public void setMaxLifetime(long maxLifetimeMs) { this.maxLifetime = maxLifetimeMs; } /** {@inheritDoc} */ + @Override public int getMinimumPoolSize() { return minPoolSize; } /** {@inheritDoc} */ + @Override public void setMinimumPoolSize(int minPoolSize) { if (minPoolSize < 0) @@ -512,12 +528,14 @@ public class HikariConfig implements HikariConfigMBean } /** {@inheritDoc} */ + @Override public int getMaximumPoolSize() { return maxPoolSize; } /** {@inheritDoc} */ + @Override public void setMaximumPoolSize(int maxPoolSize) { if (maxPoolSize < 0) @@ -528,6 +546,7 @@ public class HikariConfig implements HikariConfigMBean } /** {@inheritDoc} */ + @Override public String getPoolName() { return poolName; diff --git a/src/main/java/com/zaxxer/hikari/HikariDataSource.java b/src/main/java/com/zaxxer/hikari/HikariDataSource.java index 5392ed93..171f1a94 100644 --- a/src/main/java/com/zaxxer/hikari/HikariDataSource.java +++ b/src/main/java/com/zaxxer/hikari/HikariDataSource.java @@ -67,6 +67,7 @@ public class HikariDataSource extends HikariConfig implements DataSource } /** {@inheritDoc} */ + @Override public Connection getConnection() throws SQLException { if (isShutdown) @@ -96,6 +97,7 @@ public class HikariDataSource extends HikariConfig implements DataSource } /** {@inheritDoc} */ + @Override public Connection getConnection(String username, String password) throws SQLException { LOGGER.warn("getConnection() with username and password is not supported, calling getConnection() instead"); @@ -104,12 +106,14 @@ public class HikariDataSource extends HikariConfig implements DataSource } /** {@inheritDoc} */ + @Override public PrintWriter getLogWriter() throws SQLException { return (pool.dataSource != null ? pool.dataSource.getLogWriter() : null); } /** {@inheritDoc} */ + @Override public void setLogWriter(PrintWriter out) throws SQLException { if (pool.dataSource != null) @@ -119,24 +123,28 @@ public class HikariDataSource extends HikariConfig implements DataSource } /** {@inheritDoc} */ + @Override public void setLoginTimeout(int seconds) throws SQLException { this.loginTimeout = seconds; } /** {@inheritDoc} */ + @Override public int getLoginTimeout() throws SQLException { return loginTimeout; } /** {@inheritDoc} */ + @Override public java.util.logging.Logger getParentLogger() throws SQLFeatureNotSupportedException { throw new SQLFeatureNotSupportedException(); } /** {@inheritDoc} */ + @Override public T unwrap(Class iface) throws SQLException { // TODO Auto-generated method stub @@ -144,6 +152,7 @@ public class HikariDataSource extends HikariConfig implements DataSource } /** {@inheritDoc} */ + @Override public boolean isWrapperFor(Class iface) throws SQLException { return (this.getClass().isAssignableFrom(iface)); diff --git a/src/main/java/com/zaxxer/hikari/HikariPool.java b/src/main/java/com/zaxxer/hikari/HikariPool.java index abdff829..f09fb615 100644 --- a/src/main/java/com/zaxxer/hikari/HikariPool.java +++ b/src/main/java/com/zaxxer/hikari/HikariPool.java @@ -503,6 +503,7 @@ public final class HikariPool implements HikariPoolMBean, IBagStateListener */ private class HouseKeeper extends TimerTask { + @Override public void run() { debug = LOGGER.isDebugEnabled(); diff --git a/src/main/java/com/zaxxer/hikari/proxy/ConnectionProxy.java b/src/main/java/com/zaxxer/hikari/proxy/ConnectionProxy.java index c0cf97b5..51885ed5 100644 --- a/src/main/java/com/zaxxer/hikari/proxy/ConnectionProxy.java +++ b/src/main/java/com/zaxxer/hikari/proxy/ConnectionProxy.java @@ -119,6 +119,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy // *********************************************************************** /** {@inheritDoc} */ + @Override public final void captureStack(long leakDetectionThreshold, Timer scheduler) { StackTraceElement[] trace = Thread.currentThread().getStackTrace(); @@ -130,6 +131,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy } /** {@inheritDoc} */ + @Override public final void checkException(SQLException sqle) { String sqlState = sqle.getSQLState(); @@ -148,30 +150,35 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy } /** {@inheritDoc} */ + @Override public final long getCreationTime() { return creationTime; } /** {@inheritDoc} */ + @Override public final long getLastAccess() { return lastAccess; } /** {@inheritDoc} */ + @Override public final boolean isBrokenConnection() { return forceClose; } /** {@inheritDoc} */ + @Override public final void realClose() throws SQLException { delegate.close(); } /** {@inheritDoc} */ + @Override public final void resetConnectionState() throws SQLException { if (!delegate.getAutoCommit()) @@ -207,12 +214,14 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy } /** {@inheritDoc} */ + @Override public final void unclose() { isClosed = false; } /** {@inheritDoc} */ + @Override public final void untrackStatement(Object statement) { // If the connection is not closed. If it is closed, it means this is being @@ -266,6 +275,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy // ********************************************************************** /** {@inheritDoc} */ + @Override public final void close() throws SQLException { if (!isClosed) @@ -314,12 +324,14 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy } /** {@inheritDoc} */ + @Override public final boolean isClosed() throws SQLException { return isClosed; } /** {@inheritDoc} */ + @Override public final Statement createStatement() throws SQLException { checkClosed(); @@ -336,6 +348,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy } /** {@inheritDoc} */ + @Override public final Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException { checkClosed(); @@ -352,6 +365,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy } /** {@inheritDoc} */ + @Override public final Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { checkClosed(); @@ -368,6 +382,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy } /** {@inheritDoc} */ + @Override public final CallableStatement prepareCall(String sql) throws SQLException { checkClosed(); @@ -384,6 +399,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy } /** {@inheritDoc} */ + @Override public final CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException { checkClosed(); @@ -400,6 +416,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy } /** {@inheritDoc} */ + @Override public final CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { checkClosed(); @@ -416,6 +433,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy } /** {@inheritDoc} */ + @Override public final PreparedStatement prepareStatement(String sql) throws SQLException { checkClosed(); @@ -432,6 +450,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy } /** {@inheritDoc} */ + @Override public final PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException { checkClosed(); @@ -448,6 +467,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy } /** {@inheritDoc} */ + @Override public final PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException { checkClosed(); @@ -464,6 +484,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy } /** {@inheritDoc} */ + @Override public final PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { checkClosed(); @@ -480,6 +501,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy } /** {@inheritDoc} */ + @Override public final PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException { checkClosed(); @@ -496,6 +518,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy } /** {@inheritDoc} */ + @Override public final PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException { checkClosed(); @@ -512,6 +535,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy } /** {@inheritDoc} */ + @Override public final boolean isValid(int timeout) throws SQLException { if (isClosed) @@ -531,6 +555,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy } /** {@inheritDoc} */ + @Override public final void setAutoCommit(boolean autoCommit) throws SQLException { checkClosed(); @@ -547,6 +572,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy } /** {@inheritDoc} */ + @Override public final void setReadOnly(boolean readOnly) throws SQLException { checkClosed(); @@ -563,6 +589,7 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy } /** {@inheritDoc} */ + @Override public final void setTransactionIsolation(int level) throws SQLException { checkClosed(); @@ -595,12 +622,14 @@ public abstract class ConnectionProxy implements IHikariConnectionProxy } /** {@inheritDoc} */ + @Override public final boolean isWrapperFor(Class iface) throws SQLException { return iface.isInstance(delegate); } /** {@inheritDoc} */ + @Override @SuppressWarnings("unchecked") public final T unwrap(Class iface) throws SQLException { diff --git a/src/main/java/com/zaxxer/hikari/proxy/PreparedStatementProxy.java b/src/main/java/com/zaxxer/hikari/proxy/PreparedStatementProxy.java index e9ca61ab..33ae93f4 100644 --- a/src/main/java/com/zaxxer/hikari/proxy/PreparedStatementProxy.java +++ b/src/main/java/com/zaxxer/hikari/proxy/PreparedStatementProxy.java @@ -37,6 +37,7 @@ public abstract class PreparedStatementProxy extends StatementProxy implements P // ********************************************************************** /** {@inheritDoc} */ + @Override public final ResultSet executeQuery() throws SQLException { try diff --git a/src/main/java/com/zaxxer/hikari/proxy/StatementProxy.java b/src/main/java/com/zaxxer/hikari/proxy/StatementProxy.java index a4e125a1..81a86154 100644 --- a/src/main/java/com/zaxxer/hikari/proxy/StatementProxy.java +++ b/src/main/java/com/zaxxer/hikari/proxy/StatementProxy.java @@ -50,6 +50,7 @@ public abstract class StatementProxy implements Statement // ********************************************************************** /** {@inheritDoc} */ + @Override public final void close() throws SQLException { if (isClosed) @@ -72,6 +73,7 @@ public abstract class StatementProxy implements Statement } /** {@inheritDoc} */ + @Override public final ResultSet executeQuery(String sql) throws SQLException { try @@ -86,6 +88,7 @@ public abstract class StatementProxy implements Statement } /** {@inheritDoc} */ + @Override public final ResultSet getResultSet() throws SQLException { try @@ -100,6 +103,7 @@ public abstract class StatementProxy implements Statement } /** {@inheritDoc} */ + @Override public final ResultSet getGeneratedKeys() throws SQLException { try @@ -114,6 +118,7 @@ public abstract class StatementProxy implements Statement } /** {@inheritDoc} */ + @Override public final Connection getConnection() throws SQLException { return connection; diff --git a/src/main/java/com/zaxxer/hikari/util/DriverDataSource.java b/src/main/java/com/zaxxer/hikari/util/DriverDataSource.java index 2e6fb882..9f58c76b 100644 --- a/src/main/java/com/zaxxer/hikari/util/DriverDataSource.java +++ b/src/main/java/com/zaxxer/hikari/util/DriverDataSource.java @@ -84,6 +84,7 @@ public final class DriverDataSource implements DataSource return loginTimeout; } + @Override public java.util.logging.Logger getParentLogger() throws SQLFeatureNotSupportedException { throw new SQLFeatureNotSupportedException(); diff --git a/src/test/java/com/zaxxer/hikari/mocks/MockDataSource.java b/src/test/java/com/zaxxer/hikari/mocks/MockDataSource.java index 407f26be..6a346556 100644 --- a/src/test/java/com/zaxxer/hikari/mocks/MockDataSource.java +++ b/src/test/java/com/zaxxer/hikari/mocks/MockDataSource.java @@ -44,44 +44,53 @@ import org.mockito.stubbing.Answer; */ public class MockDataSource implements DataSource { + @Override public Connection getConnection() throws SQLException { return createMockConnection(); } + @Override public Connection getConnection(String username, String password) throws SQLException { return getConnection(); } + @Override public PrintWriter getLogWriter() throws SQLException { return null; } + @Override public void setLogWriter(PrintWriter out) throws SQLException { } + @Override public void setLoginTimeout(int seconds) throws SQLException { } + @Override public int getLoginTimeout() throws SQLException { return 0; } + @Override public Logger getParentLogger() throws SQLFeatureNotSupportedException { return null; } + @Override public T unwrap(Class iface) throws SQLException { return null; } + @Override public boolean isWrapperFor(Class iface) throws SQLException { return false; @@ -110,6 +119,7 @@ public class MockDataSource implements DataSource when(mockConnection.prepareStatement(anyString(), anyInt(), anyInt())).thenReturn(mockPreparedStatement); when(mockConnection.prepareStatement(anyString(), anyInt(), anyInt(), anyInt())).thenReturn(mockPreparedStatement); doAnswer(new Answer() { + @Override public Void answer(InvocationOnMock invocation) throws Throwable { return null; diff --git a/src/test/java/com/zaxxer/hikari/mocks/StubBaseConnection.java b/src/test/java/com/zaxxer/hikari/mocks/StubBaseConnection.java index cd7f8989..ee1d64eb 100644 --- a/src/test/java/com/zaxxer/hikari/mocks/StubBaseConnection.java +++ b/src/test/java/com/zaxxer/hikari/mocks/StubBaseConnection.java @@ -8,12 +8,14 @@ import java.sql.Statement; public abstract class StubBaseConnection implements Connection { /** {@inheritDoc} */ + @Override public Statement createStatement() throws SQLException { return new StubStatement(this); } /** {@inheritDoc} */ + @Override public PreparedStatement prepareStatement(String sql) throws SQLException { return new StubPreparedStatement(this); diff --git a/src/test/java/com/zaxxer/hikari/mocks/StubConnection.java b/src/test/java/com/zaxxer/hikari/mocks/StubConnection.java index f020cb0c..a44b6658 100644 --- a/src/test/java/com/zaxxer/hikari/mocks/StubConnection.java +++ b/src/test/java/com/zaxxer/hikari/mocks/StubConnection.java @@ -52,301 +52,353 @@ public class StubConnection extends StubBaseConnection implements Connection } /** {@inheritDoc} */ + @Override public T unwrap(Class iface) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public boolean isWrapperFor(Class iface) throws SQLException { return false; } /** {@inheritDoc} */ + @Override public CallableStatement prepareCall(String sql) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public String nativeSQL(String sql) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public void setAutoCommit(boolean autoCommit) throws SQLException { this.autoCommit = autoCommit; } /** {@inheritDoc} */ + @Override public boolean getAutoCommit() throws SQLException { return autoCommit; } /** {@inheritDoc} */ + @Override public void commit() throws SQLException { } /** {@inheritDoc} */ + @Override public void rollback() throws SQLException { } /** {@inheritDoc} */ + @Override public void close() throws SQLException { } /** {@inheritDoc} */ + @Override public boolean isClosed() throws SQLException { return false; } /** {@inheritDoc} */ + @Override public DatabaseMetaData getMetaData() throws SQLException { return null; } /** {@inheritDoc} */ + @Override public void setReadOnly(boolean readOnly) throws SQLException { } /** {@inheritDoc} */ + @Override public boolean isReadOnly() throws SQLException { return false; } /** {@inheritDoc} */ + @Override public void setCatalog(String catalog) throws SQLException { this.catalog = catalog; } /** {@inheritDoc} */ + @Override public String getCatalog() throws SQLException { return catalog; } /** {@inheritDoc} */ + @Override public void setTransactionIsolation(int level) throws SQLException { this.isolation = level; } /** {@inheritDoc} */ + @Override public int getTransactionIsolation() throws SQLException { return isolation; } /** {@inheritDoc} */ + @Override public SQLWarning getWarnings() throws SQLException { return null; } /** {@inheritDoc} */ + @Override public void clearWarnings() throws SQLException { } /** {@inheritDoc} */ + @Override public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException { return new StubPreparedStatement(this); } /** {@inheritDoc} */ + @Override public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public Map> getTypeMap() throws SQLException { return null; } /** {@inheritDoc} */ + @Override public void setTypeMap(Map> map) throws SQLException { } /** {@inheritDoc} */ + @Override public void setHoldability(int holdability) throws SQLException { } /** {@inheritDoc} */ + @Override public int getHoldability() throws SQLException { return (int) foo; } /** {@inheritDoc} */ + @Override public Savepoint setSavepoint() throws SQLException { return null; } /** {@inheritDoc} */ + @Override public Savepoint setSavepoint(String name) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public void rollback(Savepoint savepoint) throws SQLException { } /** {@inheritDoc} */ + @Override public void releaseSavepoint(Savepoint savepoint) throws SQLException { } /** {@inheritDoc} */ + @Override public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { return new StubPreparedStatement(this); } /** {@inheritDoc} */ + @Override public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException { return new StubPreparedStatement(this); } /** {@inheritDoc} */ + @Override public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException { return new StubPreparedStatement(this); } /** {@inheritDoc} */ + @Override public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException { return new StubPreparedStatement(this); } /** {@inheritDoc} */ + @Override public Clob createClob() throws SQLException { return null; } /** {@inheritDoc} */ + @Override public Blob createBlob() throws SQLException { return null; } /** {@inheritDoc} */ + @Override public NClob createNClob() throws SQLException { return null; } /** {@inheritDoc} */ + @Override public SQLXML createSQLXML() throws SQLException { return null; } /** {@inheritDoc} */ + @Override public boolean isValid(int timeout) throws SQLException { return true; } /** {@inheritDoc} */ + @Override public void setClientInfo(String name, String value) throws SQLClientInfoException { } /** {@inheritDoc} */ + @Override public void setClientInfo(Properties properties) throws SQLClientInfoException { } /** {@inheritDoc} */ + @Override public String getClientInfo(String name) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public Properties getClientInfo() throws SQLException { return null; } /** {@inheritDoc} */ + @Override public Array createArrayOf(String typeName, Object[] elements) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public Struct createStruct(String typeName, Object[] attributes) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public void setSchema(String schema) throws SQLException { } /** {@inheritDoc} */ + @Override public String getSchema() throws SQLException { return null; } /** {@inheritDoc} */ + @Override public void abort(Executor executor) throws SQLException { } /** {@inheritDoc} */ + @Override public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException { } /** {@inheritDoc} */ + @Override public int getNetworkTimeout() throws SQLException { return 0; diff --git a/src/test/java/com/zaxxer/hikari/mocks/StubDataSource.java b/src/test/java/com/zaxxer/hikari/mocks/StubDataSource.java index d20d3516..7ab5a9a3 100644 --- a/src/test/java/com/zaxxer/hikari/mocks/StubDataSource.java +++ b/src/test/java/com/zaxxer/hikari/mocks/StubDataSource.java @@ -55,53 +55,62 @@ public class StubDataSource implements DataSource } /** {@inheritDoc} */ + @Override public PrintWriter getLogWriter() throws SQLException { return logWriter; } /** {@inheritDoc} */ + @Override public void setLogWriter(PrintWriter out) throws SQLException { this.logWriter = out; } /** {@inheritDoc} */ + @Override public void setLoginTimeout(int seconds) throws SQLException { } /** {@inheritDoc} */ + @Override public int getLoginTimeout() throws SQLException { return 0; } /** {@inheritDoc} */ + @Override public Logger getParentLogger() throws SQLFeatureNotSupportedException { return null; } /** {@inheritDoc} */ + @Override public T unwrap(Class iface) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public boolean isWrapperFor(Class iface) throws SQLException { return false; } /** {@inheritDoc} */ + @Override public Connection getConnection() throws SQLException { return new StubConnection(); } /** {@inheritDoc} */ + @Override public Connection getConnection(String username, String password) throws SQLException { return new StubConnection(); diff --git a/src/test/java/com/zaxxer/hikari/mocks/StubDriver.java b/src/test/java/com/zaxxer/hikari/mocks/StubDriver.java index aff1bfae..9c16028f 100644 --- a/src/test/java/com/zaxxer/hikari/mocks/StubDriver.java +++ b/src/test/java/com/zaxxer/hikari/mocks/StubDriver.java @@ -47,42 +47,49 @@ public class StubDriver implements Driver } /** {@inheritDoc} */ + @Override public Connection connect(String url, Properties info) throws SQLException { return new StubConnection(); } /** {@inheritDoc} */ + @Override public boolean acceptsURL(String url) throws SQLException { return true; } /** {@inheritDoc} */ + @Override public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public int getMajorVersion() { return 0; } /** {@inheritDoc} */ + @Override public int getMinorVersion() { return 0; } /** {@inheritDoc} */ + @Override public boolean jdbcCompliant() { return true; } /** {@inheritDoc} */ + @Override public Logger getParentLogger() throws SQLFeatureNotSupportedException { return null; diff --git a/src/test/java/com/zaxxer/hikari/mocks/StubPreparedStatement.java b/src/test/java/com/zaxxer/hikari/mocks/StubPreparedStatement.java index 0046580f..5d6e91a3 100644 --- a/src/test/java/com/zaxxer/hikari/mocks/StubPreparedStatement.java +++ b/src/test/java/com/zaxxer/hikari/mocks/StubPreparedStatement.java @@ -51,95 +51,112 @@ public class StubPreparedStatement extends StubStatement implements PreparedStat } /** {@inheritDoc} */ + @Override public ResultSet executeQuery(String sql) throws SQLException { return new StubResultSet(); } /** {@inheritDoc} */ + @Override public int executeUpdate(String sql) throws SQLException { return 0; } /** {@inheritDoc} */ + @Override public int getMaxFieldSize() throws SQLException { throw new SQLException("No reason", "08999"); } /** {@inheritDoc} */ + @Override public void setMaxFieldSize(int max) throws SQLException { } /** {@inheritDoc} */ + @Override public int getMaxRows() throws SQLException { return 0; } /** {@inheritDoc} */ + @Override public void setMaxRows(int max) throws SQLException { } /** {@inheritDoc} */ + @Override public void setEscapeProcessing(boolean enable) throws SQLException { } /** {@inheritDoc} */ + @Override public int getQueryTimeout() throws SQLException { return 0; } /** {@inheritDoc} */ + @Override public void setQueryTimeout(int seconds) throws SQLException { } /** {@inheritDoc} */ + @Override public void cancel() throws SQLException { } /** {@inheritDoc} */ + @Override public SQLWarning getWarnings() throws SQLException { return null; } /** {@inheritDoc} */ + @Override public void clearWarnings() throws SQLException { } /** {@inheritDoc} */ + @Override public void setCursorName(String name) throws SQLException { } /** {@inheritDoc} */ + @Override public boolean execute(String sql) throws SQLException { return false; } /** {@inheritDoc} */ + @Override public ResultSet getResultSet() throws SQLException { return new StubResultSet(); } /** {@inheritDoc} */ + @Override public int getUpdateCount() throws SQLException { return 0; } /** {@inheritDoc} */ + @Override public boolean getMoreResults() throws SQLException { if (isClosed()) @@ -150,419 +167,498 @@ public class StubPreparedStatement extends StubStatement implements PreparedStat } /** {@inheritDoc} */ + @Override public void setFetchDirection(int direction) throws SQLException { } /** {@inheritDoc} */ + @Override public int getFetchDirection() throws SQLException { return 0; } /** {@inheritDoc} */ + @Override public void setFetchSize(int rows) throws SQLException { } /** {@inheritDoc} */ + @Override public int getFetchSize() throws SQLException { return 0; } /** {@inheritDoc} */ + @Override public int getResultSetConcurrency() throws SQLException { return 0; } /** {@inheritDoc} */ + @Override public int getResultSetType() throws SQLException { return 0; } /** {@inheritDoc} */ + @Override public void addBatch(String sql) throws SQLException { } /** {@inheritDoc} */ + @Override public void clearBatch() throws SQLException { } /** {@inheritDoc} */ + @Override public int[] executeBatch() throws SQLException { return null; } /** {@inheritDoc} */ + @Override public boolean getMoreResults(int current) throws SQLException { return false; } /** {@inheritDoc} */ + @Override public ResultSet getGeneratedKeys() throws SQLException { return new StubResultSet(); } /** {@inheritDoc} */ + @Override public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException { return 0; } /** {@inheritDoc} */ + @Override public int executeUpdate(String sql, int[] columnIndexes) throws SQLException { return 0; } /** {@inheritDoc} */ + @Override public int executeUpdate(String sql, String[] columnNames) throws SQLException { return 0; } /** {@inheritDoc} */ + @Override public boolean execute(String sql, int autoGeneratedKeys) throws SQLException { return false; } /** {@inheritDoc} */ + @Override public boolean execute(String sql, int[] columnIndexes) throws SQLException { return false; } /** {@inheritDoc} */ + @Override public boolean execute(String sql, String[] columnNames) throws SQLException { return false; } /** {@inheritDoc} */ + @Override public int getResultSetHoldability() throws SQLException { return 0; } /** {@inheritDoc} */ + @Override public void setPoolable(boolean poolable) throws SQLException { } /** {@inheritDoc} */ + @Override public boolean isPoolable() throws SQLException { return false; } /** {@inheritDoc} */ + @Override public void closeOnCompletion() throws SQLException { } /** {@inheritDoc} */ + @Override public boolean isCloseOnCompletion() throws SQLException { return false; } /** {@inheritDoc} */ + @Override public T unwrap(Class iface) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public boolean isWrapperFor(Class iface) throws SQLException { return false; } /** {@inheritDoc} */ + @Override public ResultSet executeQuery() throws SQLException { return new StubResultSet(); } /** {@inheritDoc} */ + @Override public int executeUpdate() throws SQLException { return 0; } /** {@inheritDoc} */ + @Override public void setNull(int parameterIndex, int sqlType) throws SQLException { } /** {@inheritDoc} */ + @Override public void setBoolean(int parameterIndex, boolean x) throws SQLException { } /** {@inheritDoc} */ + @Override public void setByte(int parameterIndex, byte x) throws SQLException { } /** {@inheritDoc} */ + @Override public void setShort(int parameterIndex, short x) throws SQLException { } /** {@inheritDoc} */ + @Override public void setInt(int parameterIndex, int x) throws SQLException { } /** {@inheritDoc} */ + @Override public void setLong(int parameterIndex, long x) throws SQLException { } /** {@inheritDoc} */ + @Override public void setFloat(int parameterIndex, float x) throws SQLException { } /** {@inheritDoc} */ + @Override public void setDouble(int parameterIndex, double x) throws SQLException { } /** {@inheritDoc} */ + @Override public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException { } /** {@inheritDoc} */ + @Override public void setString(int parameterIndex, String x) throws SQLException { } /** {@inheritDoc} */ + @Override public void setBytes(int parameterIndex, byte[] x) throws SQLException { } /** {@inheritDoc} */ + @Override public void setDate(int parameterIndex, Date x) throws SQLException { } /** {@inheritDoc} */ + @Override public void setTime(int parameterIndex, Time x) throws SQLException { } /** {@inheritDoc} */ + @Override public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException { } /** {@inheritDoc} */ + @Override public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException { } /** {@inheritDoc} */ + @Override public void setUnicodeStream(int parameterIndex, InputStream x, int length) throws SQLException { } /** {@inheritDoc} */ + @Override public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException { } /** {@inheritDoc} */ + @Override public void clearParameters() throws SQLException { } /** {@inheritDoc} */ + @Override public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException { } /** {@inheritDoc} */ + @Override public void setObject(int parameterIndex, Object x) throws SQLException { } /** {@inheritDoc} */ + @Override public boolean execute() throws SQLException { return false; } /** {@inheritDoc} */ + @Override public void addBatch() throws SQLException { } /** {@inheritDoc} */ + @Override public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException { } /** {@inheritDoc} */ + @Override public void setRef(int parameterIndex, Ref x) throws SQLException { } /** {@inheritDoc} */ + @Override public void setBlob(int parameterIndex, Blob x) throws SQLException { } /** {@inheritDoc} */ + @Override public void setClob(int parameterIndex, Clob x) throws SQLException { } /** {@inheritDoc} */ + @Override public void setArray(int parameterIndex, Array x) throws SQLException { } /** {@inheritDoc} */ + @Override public ResultSetMetaData getMetaData() throws SQLException { return null; } /** {@inheritDoc} */ + @Override public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException { } /** {@inheritDoc} */ + @Override public void setTime(int parameterIndex, Time x, Calendar cal) throws SQLException { } /** {@inheritDoc} */ + @Override public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) throws SQLException { } /** {@inheritDoc} */ + @Override public void setNull(int parameterIndex, int sqlType, String typeName) throws SQLException { } /** {@inheritDoc} */ + @Override public void setURL(int parameterIndex, URL x) throws SQLException { } /** {@inheritDoc} */ + @Override public ParameterMetaData getParameterMetaData() throws SQLException { return null; } /** {@inheritDoc} */ + @Override public void setRowId(int parameterIndex, RowId x) throws SQLException { } /** {@inheritDoc} */ + @Override public void setNString(int parameterIndex, String value) throws SQLException { } /** {@inheritDoc} */ + @Override public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException { } /** {@inheritDoc} */ + @Override public void setNClob(int parameterIndex, NClob value) throws SQLException { } /** {@inheritDoc} */ + @Override public void setClob(int parameterIndex, Reader reader, long length) throws SQLException { } /** {@inheritDoc} */ + @Override public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException { } /** {@inheritDoc} */ + @Override public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException { } /** {@inheritDoc} */ + @Override public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException { } /** {@inheritDoc} */ + @Override public void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength) throws SQLException { } /** {@inheritDoc} */ + @Override public void setAsciiStream(int parameterIndex, InputStream x, long length) throws SQLException { } /** {@inheritDoc} */ + @Override public void setBinaryStream(int parameterIndex, InputStream x, long length) throws SQLException { } /** {@inheritDoc} */ + @Override public void setCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException { } /** {@inheritDoc} */ + @Override public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException { } /** {@inheritDoc} */ + @Override public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException { } /** {@inheritDoc} */ + @Override public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException { } /** {@inheritDoc} */ + @Override public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException { } /** {@inheritDoc} */ + @Override public void setClob(int parameterIndex, Reader reader) throws SQLException { } /** {@inheritDoc} */ + @Override public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException { } /** {@inheritDoc} */ + @Override public void setNClob(int parameterIndex, Reader reader) throws SQLException { } diff --git a/src/test/java/com/zaxxer/hikari/mocks/StubResultSet.java b/src/test/java/com/zaxxer/hikari/mocks/StubResultSet.java index 4cb05695..0560d6f3 100644 --- a/src/test/java/com/zaxxer/hikari/mocks/StubResultSet.java +++ b/src/test/java/com/zaxxer/hikari/mocks/StubResultSet.java @@ -48,6 +48,7 @@ public class StubResultSet implements ResultSet private boolean closed; /** {@inheritDoc} */ + @Override public T unwrap(Class iface) throws SQLException { @@ -55,1046 +56,1236 @@ public class StubResultSet implements ResultSet } /** {@inheritDoc} */ + @Override public boolean isWrapperFor(Class iface) throws SQLException { return false; } /** {@inheritDoc} */ + @Override public boolean next() throws SQLException { return (counter > 100000); } /** {@inheritDoc} */ + @Override public void close() throws SQLException { closed = true; } /** {@inheritDoc} */ + @Override public boolean wasNull() throws SQLException { return false; } /** {@inheritDoc} */ + @Override public String getString(int columnIndex) throws SQLException { return "aString"; } /** {@inheritDoc} */ + @Override public boolean getBoolean(int columnIndex) throws SQLException { return false; } /** {@inheritDoc} */ + @Override public byte getByte(int columnIndex) throws SQLException { return 0; } /** {@inheritDoc} */ + @Override public short getShort(int columnIndex) throws SQLException { return 0; } /** {@inheritDoc} */ + @Override public int getInt(int columnIndex) throws SQLException { return ++counter; } /** {@inheritDoc} */ + @Override public long getLong(int columnIndex) throws SQLException { return 0; } /** {@inheritDoc} */ + @Override public float getFloat(int columnIndex) throws SQLException { throw new SQLException("No reason", "08999"); } /** {@inheritDoc} */ + @Override public double getDouble(int columnIndex) throws SQLException { return 0; } /** {@inheritDoc} */ + @Override public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public byte[] getBytes(int columnIndex) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public Date getDate(int columnIndex) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public Time getTime(int columnIndex) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public Timestamp getTimestamp(int columnIndex) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public InputStream getAsciiStream(int columnIndex) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public InputStream getUnicodeStream(int columnIndex) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public InputStream getBinaryStream(int columnIndex) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public String getString(String columnLabel) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public boolean getBoolean(String columnLabel) throws SQLException { return false; } /** {@inheritDoc} */ + @Override public byte getByte(String columnLabel) throws SQLException { return 0; } /** {@inheritDoc} */ + @Override public short getShort(String columnLabel) throws SQLException { return 0; } /** {@inheritDoc} */ + @Override public int getInt(String columnLabel) throws SQLException { return 0; } /** {@inheritDoc} */ + @Override public long getLong(String columnLabel) throws SQLException { return 0; } /** {@inheritDoc} */ + @Override public float getFloat(String columnLabel) throws SQLException { return 0; } /** {@inheritDoc} */ + @Override public double getDouble(String columnLabel) throws SQLException { return 0; } /** {@inheritDoc} */ + @Override public BigDecimal getBigDecimal(String columnLabel, int scale) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public byte[] getBytes(String columnLabel) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public Date getDate(String columnLabel) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public Time getTime(String columnLabel) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public Timestamp getTimestamp(String columnLabel) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public InputStream getAsciiStream(String columnLabel) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public InputStream getUnicodeStream(String columnLabel) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public InputStream getBinaryStream(String columnLabel) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public SQLWarning getWarnings() throws SQLException { return null; } /** {@inheritDoc} */ + @Override public void clearWarnings() throws SQLException { } /** {@inheritDoc} */ + @Override public String getCursorName() throws SQLException { return null; } /** {@inheritDoc} */ + @Override public ResultSetMetaData getMetaData() throws SQLException { return null; } /** {@inheritDoc} */ + @Override public Object getObject(int columnIndex) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public Object getObject(String columnLabel) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public int findColumn(String columnLabel) throws SQLException { return 0; } /** {@inheritDoc} */ + @Override public Reader getCharacterStream(int columnIndex) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public Reader getCharacterStream(String columnLabel) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public BigDecimal getBigDecimal(int columnIndex) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public BigDecimal getBigDecimal(String columnLabel) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public boolean isBeforeFirst() throws SQLException { return false; } /** {@inheritDoc} */ + @Override public boolean isAfterLast() throws SQLException { return false; } /** {@inheritDoc} */ + @Override public boolean isFirst() throws SQLException { return false; } /** {@inheritDoc} */ + @Override public boolean isLast() throws SQLException { return false; } /** {@inheritDoc} */ + @Override public void beforeFirst() throws SQLException { } /** {@inheritDoc} */ + @Override public void afterLast() throws SQLException { } /** {@inheritDoc} */ + @Override public boolean first() throws SQLException { return false; } /** {@inheritDoc} */ + @Override public boolean last() throws SQLException { return false; } /** {@inheritDoc} */ + @Override public int getRow() throws SQLException { return 0; } /** {@inheritDoc} */ + @Override public boolean absolute(int row) throws SQLException { return false; } /** {@inheritDoc} */ + @Override public boolean relative(int rows) throws SQLException { return false; } /** {@inheritDoc} */ + @Override public boolean previous() throws SQLException { return false; } /** {@inheritDoc} */ + @Override public void setFetchDirection(int direction) throws SQLException { } /** {@inheritDoc} */ + @Override public int getFetchDirection() throws SQLException { return 0; } /** {@inheritDoc} */ + @Override public void setFetchSize(int rows) throws SQLException { } /** {@inheritDoc} */ + @Override public int getFetchSize() throws SQLException { return 0; } /** {@inheritDoc} */ + @Override public int getType() throws SQLException { return 0; } /** {@inheritDoc} */ + @Override public int getConcurrency() throws SQLException { return 0; } /** {@inheritDoc} */ + @Override public boolean rowUpdated() throws SQLException { return false; } /** {@inheritDoc} */ + @Override public boolean rowInserted() throws SQLException { return false; } /** {@inheritDoc} */ + @Override public boolean rowDeleted() throws SQLException { return false; } /** {@inheritDoc} */ + @Override public void updateNull(int columnIndex) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateBoolean(int columnIndex, boolean x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateByte(int columnIndex, byte x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateShort(int columnIndex, short x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateInt(int columnIndex, int x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateLong(int columnIndex, long x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateFloat(int columnIndex, float x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateDouble(int columnIndex, double x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateString(int columnIndex, String x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateBytes(int columnIndex, byte[] x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateDate(int columnIndex, Date x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateTime(int columnIndex, Time x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateTimestamp(int columnIndex, Timestamp x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateBinaryStream(int columnIndex, InputStream x, int length) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateObject(int columnIndex, Object x, int scaleOrLength) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateObject(int columnIndex, Object x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateNull(String columnLabel) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateBoolean(String columnLabel, boolean x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateByte(String columnLabel, byte x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateShort(String columnLabel, short x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateInt(String columnLabel, int x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateLong(String columnLabel, long x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateFloat(String columnLabel, float x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateDouble(String columnLabel, double x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateBigDecimal(String columnLabel, BigDecimal x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateString(String columnLabel, String x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateBytes(String columnLabel, byte[] x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateDate(String columnLabel, Date x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateTime(String columnLabel, Time x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateTimestamp(String columnLabel, Timestamp x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateAsciiStream(String columnLabel, InputStream x, int length) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateBinaryStream(String columnLabel, InputStream x, int length) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateCharacterStream(String columnLabel, Reader reader, int length) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateObject(String columnLabel, Object x, int scaleOrLength) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateObject(String columnLabel, Object x) throws SQLException { } /** {@inheritDoc} */ + @Override public void insertRow() throws SQLException { } /** {@inheritDoc} */ + @Override public void updateRow() throws SQLException { } /** {@inheritDoc} */ + @Override public void deleteRow() throws SQLException { } /** {@inheritDoc} */ + @Override public void refreshRow() throws SQLException { } /** {@inheritDoc} */ + @Override public void cancelRowUpdates() throws SQLException { } /** {@inheritDoc} */ + @Override public void moveToInsertRow() throws SQLException { } /** {@inheritDoc} */ + @Override public void moveToCurrentRow() throws SQLException { } /** {@inheritDoc} */ + @Override public Statement getStatement() throws SQLException { return null; } /** {@inheritDoc} */ + @Override public Object getObject(int columnIndex, Map> map) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public Ref getRef(int columnIndex) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public Blob getBlob(int columnIndex) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public Clob getClob(int columnIndex) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public Array getArray(int columnIndex) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public Object getObject(String columnLabel, Map> map) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public Ref getRef(String columnLabel) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public Blob getBlob(String columnLabel) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public Clob getClob(String columnLabel) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public Array getArray(String columnLabel) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public Date getDate(int columnIndex, Calendar cal) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public Date getDate(String columnLabel, Calendar cal) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public Time getTime(int columnIndex, Calendar cal) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public Time getTime(String columnLabel, Calendar cal) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public Timestamp getTimestamp(String columnLabel, Calendar cal) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public URL getURL(int columnIndex) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public URL getURL(String columnLabel) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public void updateRef(int columnIndex, Ref x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateRef(String columnLabel, Ref x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateBlob(int columnIndex, Blob x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateBlob(String columnLabel, Blob x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateClob(int columnIndex, Clob x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateClob(String columnLabel, Clob x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateArray(int columnIndex, Array x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateArray(String columnLabel, Array x) throws SQLException { } /** {@inheritDoc} */ + @Override public RowId getRowId(int columnIndex) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public RowId getRowId(String columnLabel) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public void updateRowId(int columnIndex, RowId x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateRowId(String columnLabel, RowId x) throws SQLException { } /** {@inheritDoc} */ + @Override public int getHoldability() throws SQLException { return 0; } /** {@inheritDoc} */ + @Override public boolean isClosed() throws SQLException { return closed; } /** {@inheritDoc} */ + @Override public void updateNString(int columnIndex, String nString) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateNString(String columnLabel, String nString) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateNClob(int columnIndex, NClob nClob) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateNClob(String columnLabel, NClob nClob) throws SQLException { } /** {@inheritDoc} */ + @Override public NClob getNClob(int columnIndex) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public NClob getNClob(String columnLabel) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public SQLXML getSQLXML(int columnIndex) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public SQLXML getSQLXML(String columnLabel) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException { } /** {@inheritDoc} */ + @Override public String getNString(int columnIndex) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public String getNString(String columnLabel) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public Reader getNCharacterStream(int columnIndex) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public Reader getNCharacterStream(String columnLabel) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public void updateNCharacterStream(int columnIndex, Reader x, long length) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateNCharacterStream(String columnLabel, Reader reader, long length) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateAsciiStream(int columnIndex, InputStream x, long length) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateBinaryStream(int columnIndex, InputStream x, long length) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateCharacterStream(int columnIndex, Reader x, long length) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateAsciiStream(String columnLabel, InputStream x, long length) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateBinaryStream(String columnLabel, InputStream x, long length) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateCharacterStream(String columnLabel, Reader reader, long length) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateClob(int columnIndex, Reader reader, long length) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateClob(String columnLabel, Reader reader, long length) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateNClob(String columnLabel, Reader reader, long length) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateNCharacterStream(int columnIndex, Reader x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateAsciiStream(int columnIndex, InputStream x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateBinaryStream(int columnIndex, InputStream x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateCharacterStream(int columnIndex, Reader x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateAsciiStream(String columnLabel, InputStream x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateBinaryStream(String columnLabel, InputStream x) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateCharacterStream(String columnLabel, Reader reader) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateClob(int columnIndex, Reader reader) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateClob(String columnLabel, Reader reader) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateNClob(int columnIndex, Reader reader) throws SQLException { } /** {@inheritDoc} */ + @Override public void updateNClob(String columnLabel, Reader reader) throws SQLException { } /** {@inheritDoc} */ + @Override public T getObject(int columnIndex, Class type) throws SQLException { return null; } /** {@inheritDoc} */ + @Override public T getObject(String columnLabel, Class type) throws SQLException { return null; diff --git a/src/test/java/com/zaxxer/hikari/mocks/StubStatement.java b/src/test/java/com/zaxxer/hikari/mocks/StubStatement.java index 5db6c618..e909c33f 100644 --- a/src/test/java/com/zaxxer/hikari/mocks/StubStatement.java +++ b/src/test/java/com/zaxxer/hikari/mocks/StubStatement.java @@ -37,6 +37,7 @@ public class StubStatement implements Statement } /** {@inheritDoc} */ + @Override public T unwrap(Class iface) throws SQLException { checkClosed(); @@ -44,6 +45,7 @@ public class StubStatement implements Statement } /** {@inheritDoc} */ + @Override public boolean isWrapperFor(Class iface) throws SQLException { checkClosed(); @@ -51,6 +53,7 @@ public class StubStatement implements Statement } /** {@inheritDoc} */ + @Override public ResultSet executeQuery(String sql) throws SQLException { checkClosed(); @@ -59,6 +62,7 @@ public class StubStatement implements Statement } /** {@inheritDoc} */ + @Override public int executeUpdate(String sql) throws SQLException { checkClosed(); @@ -66,12 +70,14 @@ public class StubStatement implements Statement } /** {@inheritDoc} */ + @Override public void close() throws SQLException { closed = true; } /** {@inheritDoc} */ + @Override public int getMaxFieldSize() throws SQLException { checkClosed(); @@ -79,12 +85,14 @@ public class StubStatement implements Statement } /** {@inheritDoc} */ + @Override public void setMaxFieldSize(int max) throws SQLException { checkClosed(); } /** {@inheritDoc} */ + @Override public int getMaxRows() throws SQLException { checkClosed(); @@ -92,18 +100,21 @@ public class StubStatement implements Statement } /** {@inheritDoc} */ + @Override public void setMaxRows(int max) throws SQLException { checkClosed(); } /** {@inheritDoc} */ + @Override public void setEscapeProcessing(boolean enable) throws SQLException { checkClosed(); } /** {@inheritDoc} */ + @Override public int getQueryTimeout() throws SQLException { checkClosed(); @@ -111,18 +122,21 @@ public class StubStatement implements Statement } /** {@inheritDoc} */ + @Override public void setQueryTimeout(int seconds) throws SQLException { checkClosed(); } /** {@inheritDoc} */ + @Override public void cancel() throws SQLException { checkClosed(); } /** {@inheritDoc} */ + @Override public SQLWarning getWarnings() throws SQLException { checkClosed(); @@ -130,18 +144,21 @@ public class StubStatement implements Statement } /** {@inheritDoc} */ + @Override public void clearWarnings() throws SQLException { checkClosed(); } /** {@inheritDoc} */ + @Override public void setCursorName(String name) throws SQLException { checkClosed(); } /** {@inheritDoc} */ + @Override public boolean execute(String sql) throws SQLException { checkClosed(); @@ -149,6 +166,7 @@ public class StubStatement implements Statement } /** {@inheritDoc} */ + @Override public ResultSet getResultSet() throws SQLException { checkClosed(); @@ -156,6 +174,7 @@ public class StubStatement implements Statement } /** {@inheritDoc} */ + @Override public int getUpdateCount() throws SQLException { checkClosed(); @@ -163,6 +182,7 @@ public class StubStatement implements Statement } /** {@inheritDoc} */ + @Override public boolean getMoreResults() throws SQLException { checkClosed(); @@ -170,12 +190,14 @@ public class StubStatement implements Statement } /** {@inheritDoc} */ + @Override public void setFetchDirection(int direction) throws SQLException { checkClosed(); } /** {@inheritDoc} */ + @Override public int getFetchDirection() throws SQLException { checkClosed(); @@ -183,12 +205,14 @@ public class StubStatement implements Statement } /** {@inheritDoc} */ + @Override public void setFetchSize(int rows) throws SQLException { checkClosed(); } /** {@inheritDoc} */ + @Override public int getFetchSize() throws SQLException { checkClosed(); @@ -196,6 +220,7 @@ public class StubStatement implements Statement } /** {@inheritDoc} */ + @Override public int getResultSetConcurrency() throws SQLException { checkClosed(); @@ -203,6 +228,7 @@ public class StubStatement implements Statement } /** {@inheritDoc} */ + @Override public int getResultSetType() throws SQLException { checkClosed(); @@ -210,18 +236,21 @@ public class StubStatement implements Statement } /** {@inheritDoc} */ + @Override public void addBatch(String sql) throws SQLException { checkClosed(); } /** {@inheritDoc} */ + @Override public void clearBatch() throws SQLException { checkClosed(); } /** {@inheritDoc} */ + @Override public int[] executeBatch() throws SQLException { checkClosed(); @@ -229,6 +258,7 @@ public class StubStatement implements Statement } /** {@inheritDoc} */ + @Override public Connection getConnection() throws SQLException { checkClosed(); @@ -236,6 +266,7 @@ public class StubStatement implements Statement } /** {@inheritDoc} */ + @Override public boolean getMoreResults(int current) throws SQLException { checkClosed(); @@ -243,6 +274,7 @@ public class StubStatement implements Statement } /** {@inheritDoc} */ + @Override public ResultSet getGeneratedKeys() throws SQLException { checkClosed(); @@ -250,6 +282,7 @@ public class StubStatement implements Statement } /** {@inheritDoc} */ + @Override public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException { checkClosed(); @@ -257,6 +290,7 @@ public class StubStatement implements Statement } /** {@inheritDoc} */ + @Override public int executeUpdate(String sql, int[] columnIndexes) throws SQLException { checkClosed(); @@ -264,6 +298,7 @@ public class StubStatement implements Statement } /** {@inheritDoc} */ + @Override public int executeUpdate(String sql, String[] columnNames) throws SQLException { checkClosed(); @@ -271,6 +306,7 @@ public class StubStatement implements Statement } /** {@inheritDoc} */ + @Override public boolean execute(String sql, int autoGeneratedKeys) throws SQLException { checkClosed(); @@ -278,6 +314,7 @@ public class StubStatement implements Statement } /** {@inheritDoc} */ + @Override public boolean execute(String sql, int[] columnIndexes) throws SQLException { checkClosed(); @@ -285,6 +322,7 @@ public class StubStatement implements Statement } /** {@inheritDoc} */ + @Override public boolean execute(String sql, String[] columnNames) throws SQLException { checkClosed(); @@ -292,6 +330,7 @@ public class StubStatement implements Statement } /** {@inheritDoc} */ + @Override public int getResultSetHoldability() throws SQLException { checkClosed(); @@ -299,18 +338,21 @@ public class StubStatement implements Statement } /** {@inheritDoc} */ + @Override public boolean isClosed() throws SQLException { return closed; } /** {@inheritDoc} */ + @Override public void setPoolable(boolean poolable) throws SQLException { checkClosed(); } /** {@inheritDoc} */ + @Override public boolean isPoolable() throws SQLException { checkClosed(); @@ -318,12 +360,14 @@ public class StubStatement implements Statement } /** {@inheritDoc} */ + @Override public void closeOnCompletion() throws SQLException { checkClosed(); } /** {@inheritDoc} */ + @Override public boolean isCloseOnCompletion() throws SQLException { checkClosed();