Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TesterPreparedStatement.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TesterPreparedStatement.java?rev=1099879&r1=1099878&r2=1099879&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TesterPreparedStatement.java (original) +++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TesterPreparedStatement.java Thu May 5 17:19:01 2011 @@ -76,6 +76,7 @@ public class TesterPreparedStatement ext return _catalog; } + @Override public ResultSet executeQuery(String sql) throws SQLException { checkOpen(); if("null".equals(sql)) { @@ -85,11 +86,13 @@ public class TesterPreparedStatement ext } } + @Override public int executeUpdate(String sql) throws SQLException { checkOpen(); return _rowsUpdated; } + @Override public ResultSet executeQuery() throws SQLException { checkOpen(); if("null".equals(_sql)) { @@ -99,267 +102,330 @@ public class TesterPreparedStatement ext } } + @Override public int executeUpdate() throws SQLException { checkOpen(); return _rowsUpdated; } + @Override public void setNull(int parameterIndex, int sqlType) throws SQLException { checkOpen(); } + @Override public void setBoolean(int parameterIndex, boolean x) throws SQLException { checkOpen(); } + @Override public void setByte(int parameterIndex, byte x) throws SQLException { checkOpen(); } + @Override public void setShort(int parameterIndex, short x) throws SQLException { checkOpen(); } + @Override public void setInt(int parameterIndex, int x) throws SQLException { checkOpen(); } + @Override public void setLong(int parameterIndex, long x) throws SQLException { checkOpen(); } + @Override public void setFloat(int parameterIndex, float x) throws SQLException { checkOpen(); } + @Override public void setDouble(int parameterIndex, double x) throws SQLException { checkOpen(); } + @Override public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException { checkOpen(); } + @Override public void setString(int parameterIndex, String x) throws SQLException { checkOpen(); } + @Override public void setBytes(int parameterIndex, byte x[]) throws SQLException { checkOpen(); } + @Override public void setDate(int parameterIndex, java.sql.Date x) throws SQLException { checkOpen(); } + @Override public void setTime(int parameterIndex, java.sql.Time x) throws SQLException { checkOpen(); } + @Override public void setTimestamp(int parameterIndex, java.sql.Timestamp x) throws SQLException { checkOpen(); } + @Override public void setAsciiStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException { checkOpen(); } /** @deprecated */ + @Override public void setUnicodeStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException { checkOpen(); } + @Override public void setBinaryStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException { checkOpen(); } + @Override public void clearParameters() throws SQLException { checkOpen(); } + @Override public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException { checkOpen(); } + @Override public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException { checkOpen(); } + @Override public void setObject(int parameterIndex, Object x) throws SQLException { checkOpen(); } + @Override public boolean execute() throws SQLException { checkOpen(); return true; } + @Override public void addBatch() throws SQLException { checkOpen(); } + @Override public void setCharacterStream(int parameterIndex, java.io.Reader reader, int length) throws SQLException { checkOpen(); } + @Override public void setRef (int i, Ref x) throws SQLException { checkOpen(); } + @Override public void setBlob (int i, Blob x) throws SQLException { checkOpen(); } + @Override public void setClob (int i, Clob x) throws SQLException { checkOpen(); } + @Override public void setArray (int i, Array x) throws SQLException { checkOpen(); } + @Override public ResultSetMetaData getMetaData() throws SQLException { checkOpen(); return _resultSetMetaData; } + @Override public void setDate(int parameterIndex, java.sql.Date x, Calendar cal) throws SQLException { checkOpen(); } + @Override public void setTime(int parameterIndex, java.sql.Time x, Calendar cal) throws SQLException { checkOpen(); } + @Override public void setTimestamp(int parameterIndex, java.sql.Timestamp x, Calendar cal) throws SQLException { checkOpen(); } + @Override public void setNull (int paramIndex, int sqlType, String typeName) throws SQLException { checkOpen(); } + @Override public boolean getMoreResults(int current) throws SQLException { throw new SQLException("Not implemented."); } + @Override public ResultSet getGeneratedKeys() throws SQLException { return new TesterResultSet(this, null, _resultSetType, _resultSetConcurrency); } + @Override public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException { checkOpen(); return 0; } + @Override public int executeUpdate(String sql, int columnIndexes[]) throws SQLException { checkOpen(); return 0; } + @Override public int executeUpdate(String sql, String columnNames[]) throws SQLException { checkOpen(); return 0; } + @Override public boolean execute(String sql, int autoGeneratedKeys) throws SQLException { checkOpen(); return true; } + @Override public boolean execute(String sl, int columnIndexes[]) throws SQLException { checkOpen(); return true; } + @Override public boolean execute(String sql, String columnNames[]) throws SQLException { checkOpen(); return true; } + @Override public int getResultSetHoldability() throws SQLException { throw new SQLException("Not implemented."); } + @Override public void setURL(int parameterIndex, java.net.URL x) throws SQLException { throw new SQLException("Not implemented."); } + @Override public java.sql.ParameterMetaData getParameterMetaData() throws SQLException { throw new SQLException("Not implemented."); } /* JDBC_4_ANT_KEY_BEGIN */ + @Override public void setRowId(int parameterIndex, RowId value) throws SQLException { throw new SQLException("Not implemented."); } + @Override public void setNString(int parameterIndex, String value) throws SQLException { throw new SQLException("Not implemented."); } + @Override public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException { throw new SQLException("Not implemented."); } + @Override public void setNClob(int parameterIndex, NClob value) throws SQLException { throw new SQLException("Not implemented."); } + @Override public void setClob(int parameterIndex, Reader reader, long length) throws SQLException { throw new SQLException("Not implemented."); } + @Override public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException { throw new SQLException("Not implemented."); } + @Override public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException { throw new SQLException("Not implemented."); } + @Override public void setSQLXML(int parameterIndex, SQLXML value) throws SQLException { throw new SQLException("Not implemented."); } + @Override public void setAsciiStream(int parameterIndex, InputStream inputStream, long length) throws SQLException { throw new SQLException("Not implemented."); } + @Override public void setBinaryStream(int parameterIndex, InputStream inputStream, long length) throws SQLException { throw new SQLException("Not implemented."); } + @Override public void setCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException { throw new SQLException("Not implemented."); } + @Override public void setAsciiStream(int parameterIndex, InputStream inputStream) throws SQLException { throw new SQLException("Not implemented."); } + @Override public void setBinaryStream(int parameterIndex, InputStream inputStream) throws SQLException { throw new SQLException("Not implemented."); } + @Override public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException { throw new SQLException("Not implemented."); } + @Override public void setNCharacterStream(int parameterIndex, Reader reader) throws SQLException { throw new SQLException("Not implemented."); } + @Override public void setClob(int parameterIndex, Reader reader) throws SQLException { throw new SQLException("Not implemented."); } + @Override public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException { throw new SQLException("Not implemented."); } + @Override public void setNClob(int parameterIndex, Reader reader) throws SQLException { throw new SQLException("Not implemented."); }
Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TesterResultSet.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TesterResultSet.java?rev=1099879&r1=1099878&r2=1099879&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TesterResultSet.java (original) +++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TesterResultSet.java Thu May 5 17:19:01 2011 @@ -70,6 +70,7 @@ public class TesterResultSet implements protected int _rowsLeft = 2; protected boolean _open = true; + @Override public boolean next() throws SQLException { checkOpen(); if (_data != null) { @@ -85,6 +86,7 @@ public class TesterResultSet implements } } + @Override public void close() throws SQLException { if (!_open) { return; @@ -98,11 +100,13 @@ public class TesterResultSet implements _open = false; } + @Override public boolean wasNull() throws SQLException { checkOpen(); return false; } + @Override public String getString(int columnIndex) throws SQLException { checkOpen(); if (columnIndex == -1) { @@ -114,184 +118,220 @@ public class TesterResultSet implements return "String" + columnIndex; } + @Override public boolean getBoolean(int columnIndex) throws SQLException { checkOpen(); return true; } + @Override public byte getByte(int columnIndex) throws SQLException { checkOpen(); return (byte)columnIndex; } + @Override public short getShort(int columnIndex) throws SQLException { checkOpen(); return (short)columnIndex; } + @Override public int getInt(int columnIndex) throws SQLException { checkOpen(); return (short)columnIndex; } + @Override public long getLong(int columnIndex) throws SQLException { checkOpen(); return columnIndex; } + @Override public float getFloat(int columnIndex) throws SQLException { checkOpen(); return columnIndex; } + @Override public double getDouble(int columnIndex) throws SQLException { checkOpen(); return columnIndex; } /** @deprecated */ + @Override public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException { checkOpen(); return new BigDecimal(columnIndex); } + @Override public byte[] getBytes(int columnIndex) throws SQLException { checkOpen(); return new byte[] { (byte)columnIndex }; } + @Override public java.sql.Date getDate(int columnIndex) throws SQLException { checkOpen(); return null; } + @Override public java.sql.Time getTime(int columnIndex) throws SQLException { checkOpen(); return null; } + @Override public java.sql.Timestamp getTimestamp(int columnIndex) throws SQLException { checkOpen(); return null; } + @Override public java.io.InputStream getAsciiStream(int columnIndex) throws SQLException { checkOpen(); return null; } /** @deprecated */ + @Override public java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException { checkOpen(); return null; } + @Override public java.io.InputStream getBinaryStream(int columnIndex) throws SQLException { checkOpen(); return null; } + @Override public String getString(String columnName) throws SQLException { checkOpen(); return columnName; } + @Override public boolean getBoolean(String columnName) throws SQLException { checkOpen(); return true; } + @Override public byte getByte(String columnName) throws SQLException { checkOpen(); return (byte)(columnName.hashCode()); } + @Override public short getShort(String columnName) throws SQLException { checkOpen(); return (short)(columnName.hashCode()); } + @Override public int getInt(String columnName) throws SQLException { checkOpen(); return (columnName.hashCode()); } + @Override public long getLong(String columnName) throws SQLException { checkOpen(); return columnName.hashCode(); } + @Override public float getFloat(String columnName) throws SQLException { checkOpen(); return columnName.hashCode(); } + @Override public double getDouble(String columnName) throws SQLException { checkOpen(); return columnName.hashCode(); } /** @deprecated */ + @Override public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException { checkOpen(); return new BigDecimal(columnName.hashCode()); } + @Override public byte[] getBytes(String columnName) throws SQLException { checkOpen(); return columnName.getBytes(); } + @Override public java.sql.Date getDate(String columnName) throws SQLException { checkOpen(); return null; } + @Override public java.sql.Time getTime(String columnName) throws SQLException { checkOpen(); return null; } + @Override public java.sql.Timestamp getTimestamp(String columnName) throws SQLException { checkOpen(); return null; } + @Override public java.io.InputStream getAsciiStream(String columnName) throws SQLException { checkOpen(); return null; } /** @deprecated */ + @Override public java.io.InputStream getUnicodeStream(String columnName) throws SQLException { checkOpen(); return null; } + @Override public java.io.InputStream getBinaryStream(String columnName) throws SQLException { checkOpen(); return null; } - public SQLWarning getWarnings() throws SQLException { + @Override +public SQLWarning getWarnings() throws SQLException { checkOpen(); return null; } + @Override public void clearWarnings() throws SQLException { checkOpen(); } + @Override public String getCursorName() throws SQLException { checkOpen(); return null; } + @Override public ResultSetMetaData getMetaData() throws SQLException { checkOpen(); return null; } + @Override public Object getObject(int columnIndex) throws SQLException { checkOpen(); if (_data != null) { @@ -300,256 +340,312 @@ public class TesterResultSet implements return new Object(); } + @Override public Object getObject(String columnName) throws SQLException { checkOpen(); return columnName; } + @Override public int findColumn(String columnName) throws SQLException { checkOpen(); return 1; } + @Override public java.io.Reader getCharacterStream(int columnIndex) throws SQLException { checkOpen(); return null; } + @Override public java.io.Reader getCharacterStream(String columnName) throws SQLException { checkOpen(); return null; } + @Override public BigDecimal getBigDecimal(int columnIndex) throws SQLException { checkOpen(); return new BigDecimal(columnIndex); } + @Override public BigDecimal getBigDecimal(String columnName) throws SQLException { checkOpen(); return new BigDecimal(columnName.hashCode()); } + @Override public boolean isBeforeFirst() throws SQLException { checkOpen(); return _rowsLeft == 2; } + @Override public boolean isAfterLast() throws SQLException { checkOpen(); return _rowsLeft < 0; } + @Override public boolean isFirst() throws SQLException { checkOpen(); return _rowsLeft == 1; } + @Override public boolean isLast() throws SQLException { checkOpen(); return _rowsLeft == 0; } + @Override public void beforeFirst() throws SQLException { checkOpen(); } + @Override public void afterLast() throws SQLException { checkOpen(); } + @Override public boolean first() throws SQLException { checkOpen(); return false; } + @Override public boolean last() throws SQLException { checkOpen(); return false; } + @Override public int getRow() throws SQLException { checkOpen(); return 3 - _rowsLeft; } + @Override public boolean absolute( int row ) throws SQLException { checkOpen(); return false; } + @Override public boolean relative( int rows ) throws SQLException { checkOpen(); return false; } + @Override public boolean previous() throws SQLException { checkOpen(); return false; } + @Override public void setFetchDirection(int direction) throws SQLException { checkOpen(); } + @Override public int getFetchDirection() throws SQLException { checkOpen(); return 1; } + @Override public void setFetchSize(int rows) throws SQLException { checkOpen(); } + @Override public int getFetchSize() throws SQLException { checkOpen(); return 2; } + @Override public int getType() throws SQLException { return this._type; } + @Override public int getConcurrency() throws SQLException { return this._concurrency; } + @Override public boolean rowUpdated() throws SQLException { checkOpen(); return false; } + @Override public boolean rowInserted() throws SQLException { checkOpen(); return false; } + @Override public boolean rowDeleted() throws SQLException { checkOpen(); return false; } + @Override public void updateNull(int columnIndex) throws SQLException { checkOpen(); } + @Override public void updateBoolean(int columnIndex, boolean x) throws SQLException { checkOpen(); } + @Override public void updateByte(int columnIndex, byte x) throws SQLException { checkOpen(); } + @Override public void updateShort(int columnIndex, short x) throws SQLException { checkOpen(); } + @Override public void updateInt(int columnIndex, int x) throws SQLException { checkOpen(); } + @Override public void updateLong(int columnIndex, long x) throws SQLException { checkOpen(); } + @Override public void updateFloat(int columnIndex, float x) throws SQLException { checkOpen(); } + @Override public void updateDouble(int columnIndex, double x) throws SQLException { checkOpen(); } + @Override public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException { checkOpen(); } + @Override public void updateString(int columnIndex, String x) throws SQLException { checkOpen(); } + @Override public void updateBytes(int columnIndex, byte x[]) throws SQLException { checkOpen(); } + @Override public void updateDate(int columnIndex, java.sql.Date x) throws SQLException { checkOpen(); } + @Override public void updateTime(int columnIndex, java.sql.Time x) throws SQLException { checkOpen(); } + @Override public void updateTimestamp(int columnIndex, java.sql.Timestamp x) throws SQLException { checkOpen(); } + @Override public void updateAsciiStream(int columnIndex, java.io.InputStream x, int length) throws SQLException { checkOpen(); } + @Override public void updateBinaryStream(int columnIndex, java.io.InputStream x, int length) throws SQLException { checkOpen(); } + @Override public void updateCharacterStream(int columnIndex, java.io.Reader x, int length) throws SQLException { checkOpen(); } + @Override public void updateObject(int columnIndex, Object x, int scale) throws SQLException { checkOpen(); } + @Override public void updateObject(int columnIndex, Object x) throws SQLException { checkOpen(); } + @Override public void updateNull(String columnName) throws SQLException { checkOpen(); } + @Override public void updateBoolean(String columnName, boolean x) throws SQLException { checkOpen(); } + @Override public void updateByte(String columnName, byte x) throws SQLException { checkOpen(); } + @Override public void updateShort(String columnName, short x) throws SQLException { checkOpen(); } + @Override public void updateInt(String columnName, int x) throws SQLException { checkOpen(); } + @Override public void updateLong(String columnName, long x) throws SQLException { checkOpen(); } + @Override public void updateFloat(String columnName, float x) throws SQLException { checkOpen(); } + @Override public void updateDouble(String columnName, double x) throws SQLException { checkOpen(); } + @Override public void updateBigDecimal(String columnName, BigDecimal x) throws SQLException { checkOpen(); } + @Override public void updateString(String columnName, String x) throws SQLException { checkOpen(); } Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TesterStatement.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TesterStatement.java?rev=1099879&r1=1099878&r2=1099879&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TesterStatement.java (original) +++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TesterStatement.java Thu May 5 17:19:01 2011 @@ -56,6 +56,7 @@ public class TesterStatement implements protected int _resultSetType = 1; protected ResultSet _resultSet = null; + @Override public ResultSet executeQuery(String sql) throws SQLException { checkOpen(); if("null".equals(sql)) { @@ -80,11 +81,13 @@ public class TesterStatement implements } } + @Override public int executeUpdate(String sql) throws SQLException { checkOpen(); return _rowsUpdated; } + @Override public void close() throws SQLException { // calling close twice has no effect if (!_open) { @@ -98,59 +101,71 @@ public class TesterStatement implements } } + @Override public int getMaxFieldSize() throws SQLException { checkOpen(); return _maxFieldSize; } + @Override public void setMaxFieldSize(int max) throws SQLException { checkOpen(); _maxFieldSize = max; } + @Override public int getMaxRows() throws SQLException { checkOpen(); return _maxRows; } + @Override public void setMaxRows(int max) throws SQLException { checkOpen(); _maxRows = max; } + @Override public void setEscapeProcessing(boolean enable) throws SQLException { checkOpen(); _escapeProcessing = enable; } + @Override public int getQueryTimeout() throws SQLException { checkOpen(); return _queryTimeout; } + @Override public void setQueryTimeout(int seconds) throws SQLException { checkOpen(); _queryTimeout = seconds; } + @Override public void cancel() throws SQLException { checkOpen(); } + @Override public SQLWarning getWarnings() throws SQLException { checkOpen(); return null; } + @Override public void clearWarnings() throws SQLException { checkOpen(); } + @Override public void setCursorName(String name) throws SQLException { checkOpen(); _cursorName = name; } + @Override public boolean execute(String sql) throws SQLException { checkOpen(); if("invalid".equals(sql)) { @@ -159,6 +174,7 @@ public class TesterStatement implements return _executeResponse; } + @Override public ResultSet getResultSet() throws SQLException { checkOpen(); if (_resultSet == null) { @@ -167,59 +183,71 @@ public class TesterStatement implements return _resultSet; } + @Override public int getUpdateCount() throws SQLException { checkOpen(); return _rowsUpdated; } + @Override public boolean getMoreResults() throws SQLException { checkOpen(); return false; } + @Override public void setFetchDirection(int direction) throws SQLException { checkOpen(); _fetchDirection = direction; } + @Override public int getFetchDirection() throws SQLException { checkOpen(); return _fetchDirection; } + @Override public void setFetchSize(int rows) throws SQLException { checkOpen(); _fetchSize = rows; } + @Override public int getFetchSize() throws SQLException { checkOpen(); return _fetchSize; } + @Override public int getResultSetConcurrency() throws SQLException { checkOpen(); return _resultSetConcurrency; } + @Override public int getResultSetType() throws SQLException { checkOpen(); return _resultSetType; } + @Override public void addBatch(String sql) throws SQLException { checkOpen(); } + @Override public void clearBatch() throws SQLException { checkOpen(); } + @Override public int[] executeBatch() throws SQLException { checkOpen(); return new int[0]; } + @Override public Connection getConnection() throws SQLException { checkOpen(); return _connection; @@ -231,44 +259,53 @@ public class TesterStatement implements } } + @Override public boolean getMoreResults(int current) throws SQLException { throw new SQLException("Not implemented."); } + @Override public ResultSet getGeneratedKeys() throws SQLException { return new TesterResultSet(this); } + @Override public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException { throw new SQLException("Not implemented."); } + @Override public int executeUpdate(String sql, int columnIndexes[]) throws SQLException { throw new SQLException("Not implemented."); } + @Override public int executeUpdate(String sql, String columnNames[]) throws SQLException { throw new SQLException("Not implemented."); } + @Override public boolean execute(String sql, int autoGeneratedKeys) throws SQLException { throw new SQLException("Not implemented."); } + @Override public boolean execute(String sql, int columnIndexes[]) throws SQLException { throw new SQLException("Not implemented."); } + @Override public boolean execute(String sql, String columnNames[]) throws SQLException { throw new SQLException("Not implemented."); } + @Override public int getResultSetHoldability() throws SQLException { checkOpen(); throw new SQLException("Not implemented."); @@ -276,22 +313,27 @@ public class TesterStatement implements /* JDBC_4_ANT_KEY_BEGIN */ + @Override public boolean isWrapperFor(Class<?> iface) throws SQLException { throw new SQLException("Not implemented."); } + @Override public <T> T unwrap(Class<T> iface) throws SQLException { throw new SQLException("Not implemented."); } + @Override public boolean isClosed() throws SQLException { throw new SQLException("Not implemented."); } + @Override public void setPoolable(boolean poolable) throws SQLException { throw new SQLException("Not implemented."); } + @Override public boolean isPoolable() throws SQLException { throw new SQLException("Not implemented."); } Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/cpdsadapter/TestDriverAdapterCPDS.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/cpdsadapter/TestDriverAdapterCPDS.java?rev=1099879&r1=1099878&r2=1099879&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/cpdsadapter/TestDriverAdapterCPDS.java (original) +++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/cpdsadapter/TestDriverAdapterCPDS.java Thu May 5 17:19:01 2011 @@ -44,6 +44,7 @@ public class TestDriverAdapterCPDS exten private DriverAdapterCPDS pcds; + @Override public void setUp() throws Exception { pcds = new DriverAdapterCPDS(); pcds.setDriver("org.apache.commons.dbcp2.TesterDriver"); Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/ConnectionPoolDataSourceProxy.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/ConnectionPoolDataSourceProxy.java?rev=1099879&r1=1099878&r2=1099879&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/ConnectionPoolDataSourceProxy.java (original) +++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/ConnectionPoolDataSourceProxy.java Thu May 5 17:19:01 2011 @@ -40,10 +40,12 @@ public class ConnectionPoolDataSourcePro return delegate; } + @Override public int getLoginTimeout() throws SQLException { return delegate.getLoginTimeout(); } + @Override public PrintWriter getLogWriter() throws SQLException { return delegate.getLogWriter(); } @@ -51,6 +53,7 @@ public class ConnectionPoolDataSourcePro /** * Return a TesterPooledConnection with notifyOnClose turned on */ + @Override public PooledConnection getPooledConnection() throws SQLException { return wrapPooledConnection(delegate.getPooledConnection()); } @@ -58,15 +61,18 @@ public class ConnectionPoolDataSourcePro /** * Return a TesterPooledConnection with notifyOnClose turned on */ + @Override public PooledConnection getPooledConnection(String user, String password) throws SQLException { return wrapPooledConnection(delegate.getPooledConnection(user, password)); } + @Override public void setLoginTimeout(int seconds) throws SQLException { delegate.setLoginTimeout(seconds); } + @Override public void setLogWriter(PrintWriter out) throws SQLException { delegate.setLogWriter(out); } Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/PooledConnectionProxy.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/PooledConnectionProxy.java?rev=1099879&r1=1099878&r2=1099879&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/PooledConnectionProxy.java (original) +++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/PooledConnectionProxy.java Thu May 5 17:19:01 2011 @@ -62,6 +62,7 @@ public class PooledConnectionProxy imple /** * If notifyOnClose is on, notify listeners */ + @Override public void close() throws SQLException { delegate.close(); if (isNotifyOnClose()) { @@ -69,6 +70,7 @@ public class PooledConnectionProxy imple } } + @Override public Connection getConnection() throws SQLException { return delegate.getConnection(); } @@ -76,11 +78,13 @@ public class PooledConnectionProxy imple /** * Remove event listeners. */ + @Override public void removeConnectionEventListener(ConnectionEventListener listener) { eventListeners.remove(listener); } /* JDBC_4_ANT_KEY_BEGIN */ + @Override public void removeStatementEventListener(StatementEventListener listener) { eventListeners.remove(listener); } @@ -108,6 +112,7 @@ public class PooledConnectionProxy imple /** * Add event listeners. */ + @Override public void addConnectionEventListener(ConnectionEventListener listener) { if (!eventListeners.contains(listener)) { eventListeners.add(listener); @@ -115,6 +120,7 @@ public class PooledConnectionProxy imple } /* JDBC_4_ANT_KEY_BEGIN */ + @Override public void addStatementEventListener(StatementEventListener listener) { if (!eventListeners.contains(listener)) { eventListeners.add(listener); @@ -125,6 +131,7 @@ public class PooledConnectionProxy imple /** * Pass closed events on to listeners */ + @Override public void connectionClosed(ConnectionEvent event) { notifyListeners(); } @@ -132,6 +139,7 @@ public class PooledConnectionProxy imple /** * Pass error events on to listeners */ + @Override public void connectionErrorOccurred(ConnectionEvent event) { Object[] listeners = eventListeners.toArray(); for (int i = 0; i < listeners.length; i++) { Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestCPDSConnectionFactory.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestCPDSConnectionFactory.java?rev=1099879&r1=1099878&r2=1099879&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestCPDSConnectionFactory.java (original) +++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestCPDSConnectionFactory.java Thu May 5 17:19:01 2011 @@ -45,6 +45,7 @@ public class TestCPDSConnectionFactory e return new TestSuite(TestCPDSConnectionFactory.class); } + @Override public void setUp() throws Exception { cpds = new ConnectionPoolDataSourceProxy(new DriverAdapterCPDS()); DriverAdapterCPDS delegate = (DriverAdapterCPDS) cpds.getDelegate(); Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestInstanceKeyDataSource.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestInstanceKeyDataSource.java?rev=1099879&r1=1099878&r2=1099879&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestInstanceKeyDataSource.java (original) +++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestInstanceKeyDataSource.java Thu May 5 17:19:01 2011 @@ -39,6 +39,7 @@ public class TestInstanceKeyDataSource e } + @Override public void setUp() throws Exception { } @@ -74,6 +75,7 @@ public class TestInstanceKeyDataSource e ThrowOnSetupDefaultsDataSource() { super(); } + @Override protected void setupDefaults(Connection con, String username) throws SQLException { throw new SQLException("bang!"); Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestKeyedCPDSConnectionFactory.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestKeyedCPDSConnectionFactory.java?rev=1099879&r1=1099878&r2=1099879&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestKeyedCPDSConnectionFactory.java (original) +++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestKeyedCPDSConnectionFactory.java Thu May 5 17:19:01 2011 @@ -45,6 +45,7 @@ public class TestKeyedCPDSConnectionFact return new TestSuite(TestKeyedCPDSConnectionFactory.class); } + @Override public void setUp() throws Exception { cpds = new ConnectionPoolDataSourceProxy(new DriverAdapterCPDS()); DriverAdapterCPDS delegate = (DriverAdapterCPDS) cpds.getDelegate(); Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestPerUserPoolDataSource.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestPerUserPoolDataSource.java?rev=1099879&r1=1099878&r2=1099879&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestPerUserPoolDataSource.java (original) +++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestPerUserPoolDataSource.java Thu May 5 17:19:01 2011 @@ -49,12 +49,14 @@ public class TestPerUserPoolDataSource e return new TestSuite(TestPerUserPoolDataSource.class); } + @Override protected Connection getConnection() throws SQLException { return ds.getConnection("foo","bar"); } private DataSource ds; + @Override public void setUp() throws Exception { super.setUp(); DriverAdapterCPDS pcds = new DriverAdapterCPDS(); @@ -76,6 +78,7 @@ public class TestPerUserPoolDataSource e ds = tds; } + @Override public void testBackPointers() throws Exception { // todo disabled until a wrapping issuen in PerUserPoolDataSource are resolved } @@ -130,6 +133,7 @@ public class TestPerUserPoolDataSource e } + @Override public void testSimple() throws Exception { Connection conn = ds.getConnection(); @@ -190,6 +194,7 @@ public class TestPerUserPoolDataSource e } } + @Override public void testSimple2() throws Exception { @@ -247,6 +252,7 @@ public class TestPerUserPoolDataSource e conn = null; } + @Override public void testOpening() throws Exception { @@ -268,6 +274,7 @@ public class TestPerUserPoolDataSource e } } + @Override public void testClosing() throws Exception { @@ -291,6 +298,7 @@ public class TestPerUserPoolDataSource e } } + @Override public void testMaxActive() throws Exception { Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestSharedPoolDataSource.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestSharedPoolDataSource.java?rev=1099879&r1=1099878&r2=1099879&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestSharedPoolDataSource.java (original) +++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestSharedPoolDataSource.java Thu May 5 17:19:01 2011 @@ -45,6 +45,7 @@ public class TestSharedPoolDataSource ex return new TestSuite(TestSharedPoolDataSource.class); } + @Override protected Connection getConnection() throws Exception { return ds.getConnection("foo","bar"); } @@ -52,6 +53,7 @@ public class TestSharedPoolDataSource ex private DriverAdapterCPDS pcds; private DataSource ds; + @Override public void setUp() throws Exception { super.setUp(); pcds = new DriverAdapterCPDS(); @@ -73,6 +75,7 @@ public class TestSharedPoolDataSource ex } + @Override public void testBackPointers() throws Exception { // todo disabled until a wrapping issuen in SharedPoolDataSource are resolved } @@ -132,6 +135,7 @@ public class TestSharedPoolDataSource ex } + @Override public void testSimple() throws Exception { Connection conn = ds.getConnection(); @@ -192,6 +196,7 @@ public class TestSharedPoolDataSource ex } } + @Override public void testSimple2() throws Exception { @@ -249,6 +254,7 @@ public class TestSharedPoolDataSource ex conn = null; } + @Override public void testOpening() throws Exception { @@ -270,6 +276,7 @@ public class TestSharedPoolDataSource ex } } + @Override public void testClosing() throws Exception { @@ -305,6 +312,7 @@ public class TestSharedPoolDataSource ex tds.close(); } + @Override public void testMaxActive() throws Exception { @@ -437,31 +445,37 @@ public class TestSharedPoolDataSource ex abstract PreparedStatement getPreparedStatement() throws SQLException; } private static class PscbString extends PrepareStatementCallback { + @Override PreparedStatement getPreparedStatement() throws SQLException { return conn.prepareStatement("select * from dual"); } } private static class PscbStringIntInt extends PrepareStatementCallback { + @Override PreparedStatement getPreparedStatement() throws SQLException { return conn.prepareStatement("select * from dual",0,0); } } private static class PscbStringInt extends PrepareStatementCallback { + @Override PreparedStatement getPreparedStatement() throws SQLException { return conn.prepareStatement("select * from dual",0); } } private static class PscbStringIntArray extends PrepareStatementCallback { + @Override PreparedStatement getPreparedStatement() throws SQLException { return conn.prepareStatement("select * from dual", new int[0]); } } private static class PscbStringStringArray extends PrepareStatementCallback { + @Override PreparedStatement getPreparedStatement() throws SQLException { return conn.prepareStatement("select * from dual",new String[0]); } } private static class PscbStringIntIntInt extends PrepareStatementCallback { + @Override PreparedStatement getPreparedStatement() throws SQLException { return conn.prepareStatement("select * from dual",0,0,0); } Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/managed/TestBasicManagedDataSource.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/managed/TestBasicManagedDataSource.java?rev=1099879&r1=1099878&r2=1099879&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/managed/TestBasicManagedDataSource.java (original) +++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/managed/TestBasicManagedDataSource.java Thu May 5 17:19:01 2011 @@ -36,12 +36,14 @@ public class TestBasicManagedDataSource return new TestSuite(TestBasicManagedDataSource.class); } + @Override protected BasicDataSource createDataSource() throws Exception { BasicManagedDataSource basicManagedDataSource = new BasicManagedDataSource(); basicManagedDataSource.setTransactionManager(new TransactionManagerImpl()); return basicManagedDataSource; } + @Override public void testHashCode() throws Exception { // TODO reenable... hashcode doesn't work when accessToUnderlyingConnectionAllowed is false } Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/managed/TestManagedDataSource.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/managed/TestManagedDataSource.java?rev=1099879&r1=1099878&r2=1099879&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/managed/TestManagedDataSource.java (original) +++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/managed/TestManagedDataSource.java Thu May 5 17:19:01 2011 @@ -49,6 +49,7 @@ public class TestManagedDataSource exten return new TestSuite(TestManagedDataSource.class); } + @Override protected Connection getConnection() throws Exception { return ds.getConnection(); } @@ -57,6 +58,7 @@ public class TestManagedDataSource exten private GenericObjectPool pool = null; protected TransactionManager transactionManager; + @Override public void setUp() throws Exception { super.setUp(); @@ -86,6 +88,7 @@ public class TestManagedDataSource exten ds.setAccessToUnderlyingConnectionAllowed(true); } + @Override public void tearDown() throws Exception { pool.close(); super.tearDown(); @@ -241,6 +244,7 @@ public class TestManagedDataSource exten super(connFactory, pool, null, null, true, true); } + @Override synchronized public Object makeObject() throws Exception { return _connFactory.createConnection(); } Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/managed/TestManagedDataSourceInTx.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/managed/TestManagedDataSourceInTx.java?rev=1099879&r1=1099878&r2=1099879&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/managed/TestManagedDataSourceInTx.java (original) +++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/managed/TestManagedDataSourceInTx.java Thu May 5 17:19:01 2011 @@ -46,12 +46,14 @@ public class TestManagedDataSourceInTx e return new TestSuite(TestManagedDataSourceInTx.class); } + @Override public void setUp() throws Exception { super.setUp(); transactionManager.begin(); } + @Override public void tearDown() throws Exception { if (transactionManager.getTransaction() != null) { transactionManager.commit(); @@ -62,12 +64,14 @@ public class TestManagedDataSourceInTx e /** * @see #testSharedConnection() */ + @Override public void testManagedConnectionEqualsFail() throws Exception { // this test is invalid for managed conections since because // two connections to the same datasource are supposed to share // a single connection } + @Override public void testConnectionsAreDistinct() throws Exception { Connection[] conn = new Connection[getMaxActive()]; for(int i=0;i<conn.length;i++) { @@ -84,6 +88,7 @@ public class TestManagedDataSourceInTx e } } + @Override public void testHashCode() throws Exception { Connection conn1 = newConnection(); assertNotNull(conn1); @@ -94,6 +99,7 @@ public class TestManagedDataSourceInTx e assertEquals(conn1.hashCode(), conn2.hashCode()); } + @Override public void testMaxActive() throws Exception { Transaction[] transactions = new Transaction[getMaxActive()]; Connection[] c = new Connection[getMaxActive()]; @@ -124,6 +130,7 @@ public class TestManagedDataSourceInTx e } } + @Override public void testClearWarnings() throws Exception { // open a connection Connection connection = newConnection(); @@ -151,6 +158,7 @@ public class TestManagedDataSourceInTx e sharedConnection.close(); } + @Override public void testSharedConnection() throws Exception { DelegatingConnection connectionA = (DelegatingConnection) newConnection(); DelegatingConnection connectionB = (DelegatingConnection) newConnection(); @@ -230,6 +238,7 @@ public class TestManagedDataSourceInTx e assertTrue("Connection should be closed", connection.isClosed()); } + @Override public void testAutoCommitBehavior() throws Exception { Connection connection = newConnection(); @@ -307,6 +316,7 @@ public class TestManagedDataSourceInTx e } // can't actually test close in a transaction + @Override protected void assertBackPointers(Connection conn, Statement statement) throws SQLException { assertFalse(conn.isClosed()); assertFalse(isClosed(statement)); Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/jocl2/TestJOCLContentHandler.java URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/jocl2/TestJOCLContentHandler.java?rev=1099879&r1=1099878&r2=1099879&view=diff ============================================================================== --- commons/proper/dbcp/trunk/src/test/org/apache/commons/jocl2/TestJOCLContentHandler.java (original) +++ commons/proper/dbcp/trunk/src/test/org/apache/commons/jocl2/TestJOCLContentHandler.java Thu May 5 17:19:01 2011 @@ -55,6 +55,7 @@ public class TestJOCLContentHandler exte private JOCLContentHandler jocl = null; + @Override public void setUp() { jocl = new JOCLContentHandler(); }
