On October 25, 2019 5:40:43 PM UTC, Phil Steitz <phil.ste...@gmail.com> wrote: >Sorry I missed all of these things. Is there a checkstyle or eclipse >config somewhere that I can use to make sure the next batch is clean?
No need to apologise. This is as much personal whim as anything else. There are some standard Eclipse settings in res/ide-support/eclipse (or something like that). The aim is to get to zero earnings when configured with Java 6 but we aren't quite there yet. Mark > >Phil > >On 10/25/19 11:12 AM, ma...@apache.org wrote: >> This is an automated email from the ASF dual-hosted git repository. >> >> markt pushed a commit to branch 7.0.x >> in repository https://gitbox.apache.org/repos/asf/tomcat.git >> >> commit 9e612f96ecfd96e3e96f2ea95ce9500d03f96691 >> Author: Mark Thomas <ma...@apache.org> >> AuthorDate: Fri Oct 25 13:13:06 2019 +0200 >> >> Fix warnings with Java 6 caused by missing @Override annotations >> --- >> .../dbcp/dbcp/AbstractConnectionPoolTest.java | 90 +++++----- >> .../tomcat/dbcp/dbcp/TestBasicDataSource.java | 112 >++++++------ >> .../tomcat/dbcp/dbcp/TesterCallableStatement.java | 111 >++++++++++++ >> .../apache/tomcat/dbcp/dbcp/TesterConnection.java | 49 ++++++ >> .../tomcat/dbcp/dbcp/TesterDatabaseMetaData.java | 174 >+++++++++++++++++++ >> test/org/apache/tomcat/dbcp/dbcp/TesterDriver.java | 6 + >> .../tomcat/dbcp/dbcp/TesterPreparedStatement.java | 74 +++++++- >> .../apache/tomcat/dbcp/dbcp/TesterResultSet.java | 191 >++++++++++++++++++++- >> .../apache/tomcat/dbcp/dbcp/TesterStatement.java | 42 +++++ >> 9 files changed, 747 insertions(+), 102 deletions(-) >> >> diff --git >a/test/org/apache/tomcat/dbcp/dbcp/AbstractConnectionPoolTest.java >b/test/org/apache/tomcat/dbcp/dbcp/AbstractConnectionPoolTest.java >> index 758f4e5..7a5db76 100644 >> --- >a/test/org/apache/tomcat/dbcp/dbcp/AbstractConnectionPoolTest.java >> +++ >b/test/org/apache/tomcat/dbcp/dbcp/AbstractConnectionPoolTest.java >> @@ -5,9 +5,9 @@ >> * The ASF licenses this file to You under the Apache License, >Version 2.0 >> * (the "License"); you may not use this file except in compliance >with >> * the License. You may obtain a copy of the License at >> - * >> + * >> * http://www.apache.org/licenses/LICENSE-2.0 >> - * >> + * >> * Unless required by applicable law or agreed to in writing, >software >> * distributed under the License is distributed on an "AS IS" >BASIS, >> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or >implied. >> @@ -35,7 +35,7 @@ import junit.framework.TestCase; >> >> /** >> * Base test suite for DBCP pools. >> - * >> + * >> * @author Rodney Waldhoff >> * @author Sean C. Sullivan >> * @author John McNally >> @@ -47,6 +47,7 @@ public abstract class AbstractConnectionPoolTest >extends TestCase { >> super(testName); >> } >> >> + @Override >> public void tearDown() throws Exception { >> super.tearDown(); >> // Close any connections opened by the test >> @@ -54,7 +55,7 @@ public abstract class AbstractConnectionPoolTest >extends TestCase { >> Connection conn = (Connection) connections.pop(); >> try { >> conn.close(); >> - } catch (Exception ex) { >> + } catch (Exception ex) { >> // ignore >> } finally { >> conn = null; >> @@ -63,18 +64,18 @@ public abstract class AbstractConnectionPoolTest >extends TestCase { >> } >> >> protected abstract Connection getConnection() throws Exception; >> - >> + >> protected int getMaxActive() { >> return 10; >> } >> - >> + >> protected long getMaxWait() { >> return 100L; >> } >> - >> + >> /** Connections opened during the course of a test */ >> protected Stack<Connection> connections = new >Stack<Connection>(); >> - >> + >> /** Acquire a connection and push it onto the connections stack >*/ >> protected Connection newConnection() throws Exception { >> Connection connection = getConnection(); >> @@ -82,7 +83,7 @@ public abstract class AbstractConnectionPoolTest >extends TestCase { >> return connection; >> } >> >> - // ----------- Utility Methods --------------------------------- >> + // ----------- Utility Methods --------------------------------- >> >> protected String getUsername(Connection conn) throws >SQLException { >> Statement stmt = conn.createStatement(); >> @@ -93,14 +94,14 @@ public abstract class AbstractConnectionPoolTest >extends TestCase { >> return null; >> } >> >> - // ----------- tests --------------------------------- >> + // ----------- tests --------------------------------- >> >> public void testClearWarnings() throws Exception { >> Connection[] c = new Connection[getMaxActive()]; >> for (int i = 0; i < c.length; i++) { >> c[i] = newConnection(); >> assertTrue(c[i] != null); >> - >> + >> // generate SQLWarning on connection >> c[i].prepareCall("warning"); >> } >> @@ -112,10 +113,10 @@ public abstract class >AbstractConnectionPoolTest extends TestCase { >> for (int i = 0; i < c.length; i++) { >> c[i].close(); >> } >> - >> + >> for (int i = 0; i < c.length; i++) { >> c[i] = newConnection(); >> - } >> + } >> >> for (int i = 0; i < c.length; i++) { >> // warnings should have been cleared by putting the >connection back in the pool >> @@ -390,7 +391,7 @@ public abstract class AbstractConnectionPoolTest >extends TestCase { >> conn = null; >> } >> >> - public void testPooling() throws Exception { >> + public void testPooling() throws Exception { >> // Grab a maximal set of open connections from the pool >> Connection[] c = new Connection[getMaxActive()]; >> Connection[] u = new Connection[getMaxActive()]; >> @@ -402,15 +403,15 @@ public abstract class >AbstractConnectionPoolTest extends TestCase { >> for (int j = 0; j <= i; j++) { >> c[j].close(); >> } >> - return; // skip this test >> + return; // skip this test >> } >> - } >> + } >> // Close connections one at a time and get new ones, making >sure >> // the new ones come from the pool >> for (int i = 0; i < c.length; i++) { >> c[i].close(); >> Connection con = newConnection(); >> - Connection underCon = >> + Connection underCon = >> ((DelegatingConnection) >con).getInnermostDelegate(); >> assertTrue("Failed to get connection", underCon != >null); >> boolean found = false; >> @@ -424,25 +425,25 @@ public abstract class >AbstractConnectionPoolTest extends TestCase { >> con.close(); >> } >> } >> - >> + >> public void testAutoCommitBehavior() throws Exception { >> Connection conn = newConnection(); >> assertNotNull(conn); >> assertTrue(conn.getAutoCommit()); >> conn.setAutoCommit(false); >> conn.close(); >> - >> + >> Connection conn2 = newConnection(); >> assertTrue( conn2.getAutoCommit() ); >> - >> + >> Connection conn3 = newConnection(); >> assertTrue( conn3.getAutoCommit() ); >> >> conn2.close(); >> - >> + >> conn3.close(); >> } >> - >> + >> /** @see >"http://issues.apache.org/bugzilla/show_bug.cgi?id=12400" */ >> public void testConnectionsAreDistinct() throws Exception { >> Connection[] conn = new Connection[getMaxActive()]; >> @@ -513,10 +514,10 @@ public abstract class >AbstractConnectionPoolTest extends TestCase { >> c[i].close(); >> } >> } >> - >> + >> /** >> * DBCP-128: BasicDataSource.getConnection() >> - * Connections don't work as hashtable keys >> + * Connections don't work as hashtable keys >> */ >> public void testHashing() throws Exception { >> Connection con = getConnection(); >> @@ -524,7 +525,7 @@ public abstract class AbstractConnectionPoolTest >extends TestCase { >> hash.put(con, "test"); >> assertEquals("test", hash.get(con)); >> assertTrue(hash.containsKey(con)); >> - assertTrue(hash.contains("test")); >> + assertTrue(hash.contains("test")); >> hash.clear(); >> con.close(); >> } >> @@ -577,6 +578,7 @@ public abstract class AbstractConnectionPoolTest >extends TestCase { >> return _failed; >> } >> >> + @Override >> public void run() { >> for(int i=0;i<_iter;i++) { >> try { >> @@ -611,23 +613,23 @@ public abstract class >AbstractConnectionPoolTest extends TestCase { >> } >> } >> >> - // Bugzilla Bug 24328: PooledConnectionImpl ignores >resultsetType >> + // Bugzilla Bug 24328: PooledConnectionImpl ignores >resultsetType >> // and Concurrency if statement pooling is not enabled >> // http://issues.apache.org/bugzilla/show_bug.cgi?id=24328 >> - public void testPrepareStatementOptions() throws Exception >> + public void testPrepareStatementOptions() throws Exception >> { >> Connection conn = newConnection(); >> assertNotNull(conn); >> - PreparedStatement stmt = conn.prepareStatement("select * >from dual", >> + PreparedStatement stmt = conn.prepareStatement("select * >from dual", >> ResultSet.TYPE_SCROLL_SENSITIVE, >ResultSet.CONCUR_UPDATABLE); >> assertNotNull(stmt); >> ResultSet rset = stmt.executeQuery(); >> assertNotNull(rset); >> assertTrue(rset.next()); >> - >> + >> assertEquals(ResultSet.TYPE_SCROLL_SENSITIVE, >rset.getType()); >> assertEquals(ResultSet.CONCUR_UPDATABLE, >rset.getConcurrency()); >> - >> + >> rset.close(); >> stmt.close(); >> conn.close(); >> @@ -646,7 +648,7 @@ public abstract class AbstractConnectionPoolTest >extends TestCase { >> stmt.close(); >> conn.close(); >> } >> - >> + >> // Bugzilla Bug 26966: Connectionpool's connections always >returns same >> public void testHashCode() throws Exception { >> Connection conn1 = newConnection(); >> @@ -688,19 +690,19 @@ public abstract class >AbstractConnectionPoolTest extends TestCase { >> // To pass this to a Maven test, use: >> // mvn test >-DargLine="-DTestConnectionPool.display.thread.details=true" >> // @see http://jira.codehaus.org/browse/SUREFIRE-121 >> - >> + >> /** >> * Launches a group of 2 * getMaxActive() threads, each of >which will attempt to obtain a connection >> * from the pool, hold it for <holdTime> ms, and then return it >to the pool. If <loopOnce> is false, >> * threads will continue this process indefinitely. If ><expectError> is true, exactly 1/2 of the >> * threads are expected to either throw exceptions or fail to >complete. If <expectError> is false, >> * all threads are expected to complete successfully. >> - * >> + * >> * @param holdTime time in ms that a thread holds a connection >before returning it to the pool >> * @param expectError whether or not an error is expected >> * @param loopOnce whether threads should complete the borrow - >hold - return cycle only once, or loop indefinitely >> * @param maxWait passed in by client - has no impact on the >test itself, but does get reported >> - * >> + * >> * @throws Exception >> */ >> protected void multipleThreads(final int holdTime, final >boolean expectError, final boolean loopOnce, final long maxWait) >> @@ -709,6 +711,7 @@ public abstract class AbstractConnectionPoolTest >extends TestCase { >> final PoolTest[] pts = new PoolTest[2 * >getMaxActive()]; >> // Catch Exception so we can stop all threads if >one fails >> ThreadGroup threadGroup = new ThreadGroup("foo") { >> + @Override >> public void uncaughtException(Thread t, >Throwable e) { >> for (int i = 0; i < pts.length; i++) { >> pts[i].stop(); >> @@ -717,11 +720,11 @@ public abstract class >AbstractConnectionPoolTest extends TestCase { >> }; >> // Create all the threads >> for (int i = 0; i < pts.length; i++) { >> - pts[i] = new PoolTest(threadGroup, holdTime, >expectError, loopOnce); >> + pts[i] = new PoolTest(threadGroup, holdTime, >expectError, loopOnce); >> } >> // Start all the threads >> for (int i = 0; i < pts.length; i++) { >> - pts[i].start(); >> + pts[i].start(); >> } >> >> // Give all threads a chance to start and succeed >> @@ -730,8 +733,8 @@ public abstract class AbstractConnectionPoolTest >extends TestCase { >> // Stop threads >> for (int i = 0; i < pts.length; i++) { >> pts[i].stop(); >> - } >> - >> + } >> + >> /* >> * Wait for all threads to terminate. >> * This is essential to ensure that all threads >have a chance to update success[0] >> @@ -760,7 +763,7 @@ public abstract class AbstractConnectionPoolTest >extends TestCase { >> } >> } >> } >> - >> + >> long time = timeStamp() - startTime; >> System.out.println("Multithread test time = " + >time >> + " ms. Threads: " + pts.length >> @@ -791,7 +794,7 @@ public abstract class AbstractConnectionPoolTest >extends TestCase { >> + ". thrown: "+ pt.thrown >> + "." >> ); >> - } >> + } >> } >> if (didNotRun > 0){ >> System.out.println("NOTE: some threads did >not run the code: "+didNotRun); >> @@ -833,7 +836,7 @@ public abstract class AbstractConnectionPoolTest >extends TestCase { >> private int connHash = 0; // Connection identity hashCode >(to see which one is reused) >> >> private final boolean stopOnException; // If true, don't >rethrow Exception >> - >> + >> private final boolean loopOnce; // If true, don't repeat >loop >> >> public PoolTest(ThreadGroup threadGroup, int connHoldTime, >boolean isStopOnException) { >> @@ -856,6 +859,7 @@ public abstract class AbstractConnectionPoolTest >extends TestCase { >> thread.start(); >> } >> >> + @Override >> public void run() { >> started = timeStamp(); >> try { >> @@ -895,7 +899,7 @@ public abstract class AbstractConnectionPoolTest >extends TestCase { >> throw new RuntimeException(); >> } >> } finally { >> - ended = timeStamp(); >> + ended = timeStamp(); >> } >> } >> >> @@ -909,6 +913,6 @@ public abstract class AbstractConnectionPoolTest >extends TestCase { >> } >> >> long timeStamp() { >> - return System.currentTimeMillis();// JVM 1.5+ >System.nanoTime() / 1000000; >> + return System.currentTimeMillis();// JVM 1.5+ >System.nanoTime() / 1000000; >> } >> } >> diff --git >a/test/org/apache/tomcat/dbcp/dbcp/TestBasicDataSource.java >b/test/org/apache/tomcat/dbcp/dbcp/TestBasicDataSource.java >> index 79e5d76..39f30d7 100644 >> --- a/test/org/apache/tomcat/dbcp/dbcp/TestBasicDataSource.java >> +++ b/test/org/apache/tomcat/dbcp/dbcp/TestBasicDataSource.java >> @@ -5,9 +5,9 @@ >> * The ASF licenses this file to You under the Apache License, >Version 2.0 >> * (the "License"); you may not use this file except in compliance >with >> * the License. You may obtain a copy of the License at >> - * >> + * >> * http://www.apache.org/licenses/LICENSE-2.0 >> - * >> + * >> * Unless required by applicable law or agreed to in writing, >software >> * distributed under the License is distributed on an "AS IS" >BASIS, >> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or >implied. >> @@ -30,7 +30,7 @@ import junit.framework.TestSuite; >> >> /** >> * TestSuite for BasicDataSource >> - * >> + * >> * @author Dirk Verbeeck >> * @version $Revision$ $Date$ >> */ >> @@ -43,6 +43,7 @@ public class TestBasicDataSource extends >AbstractConnectionPoolTest { >> return new TestSuite(TestBasicDataSource.class); >> } >> >> + @Override >> protected Connection getConnection() throws Exception { >> return ds.getConnection(); >> } >> @@ -50,6 +51,7 @@ public class TestBasicDataSource extends >AbstractConnectionPoolTest { >> protected BasicDataSource ds = null; >> private static final String CATALOG = "test catalog"; >> >> + @Override >> public void setUp() throws Exception { >> super.setUp(); >> ds = createDataSource(); >> @@ -72,6 +74,7 @@ public class TestBasicDataSource extends >AbstractConnectionPoolTest { >> return new BasicDataSource(); >> } >> >> + @Override >> public void tearDown() throws Exception { >> super.tearDown(); >> ds.close(); >> @@ -113,7 +116,7 @@ public class TestBasicDataSource extends >AbstractConnectionPoolTest { >> // both wrapper and raw active connection should be closed >> assertTrue(activeConnection.isClosed()); >> assertTrue(rawActiveConnection.isClosed()); >> - >> + >> // Verify SQLException on getConnection after close >> try { >> getConnection(); >> @@ -121,10 +124,10 @@ public class TestBasicDataSource extends >AbstractConnectionPoolTest { >> } catch (SQLException ex) { >> // Expected >> } >> - >> + >> // Redundant close is OK >> ds.close(); >> - >> + >> } >> >> public void testSetProperties() throws Exception { >> @@ -177,39 +180,40 @@ public class TestBasicDataSource extends >AbstractConnectionPoolTest { >> // expected >> } >> } >> - >> + >> public void testTransactionIsolationBehavior() throws Exception >{ >> Connection conn = getConnection(); >> assertNotNull(conn); >> assertEquals(Connection.TRANSACTION_READ_COMMITTED, >conn.getTransactionIsolation()); >> >conn.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED); >> conn.close(); >> - >> + >> Connection conn2 = getConnection(); >> assertEquals(Connection.TRANSACTION_READ_COMMITTED, >conn2.getTransactionIsolation()); >> - >> + >> Connection conn3 = getConnection(); >> assertEquals(Connection.TRANSACTION_READ_COMMITTED, >conn3.getTransactionIsolation()); >> >> conn2.close(); >> - >> + >> conn3.close(); >> } >> >> + @Override >> public void testPooling() throws Exception { >> // this also needs access to the underlying connection >> ds.setAccessToUnderlyingConnectionAllowed(true); >> super.testPooling(); >> - } >> - >> + } >> + >> public void testNoAccessToUnderlyingConnectionAllowed() throws >Exception { >> // default: false >> assertEquals(false, >ds.isAccessToUnderlyingConnectionAllowed()); >> - >> + >> Connection conn = getConnection(); >> Connection dconn = ((DelegatingConnection) >conn).getDelegate(); >> assertNull(dconn); >> - >> + >> dconn = ((DelegatingConnection) >conn).getInnermostDelegate(); >> assertNull(dconn); >> } >> @@ -217,20 +221,20 @@ public class TestBasicDataSource extends >AbstractConnectionPoolTest { >> public void testAccessToUnderlyingConnectionAllowed() throws >Exception { >> ds.setAccessToUnderlyingConnectionAllowed(true); >> assertEquals(true, >ds.isAccessToUnderlyingConnectionAllowed()); >> - >> + >> Connection conn = getConnection(); >> Connection dconn = ((DelegatingConnection) >conn).getDelegate(); >> assertNotNull(dconn); >> - >> + >> dconn = ((DelegatingConnection) >conn).getInnermostDelegate(); >> assertNotNull(dconn); >> - >> + >> assertTrue(dconn instanceof TesterConnection); >> } >> - >> + >> public void testEmptyValidationQuery() throws Exception { >> assertNotNull(ds.getValidationQuery()); >> - >> + >> ds.setValidationQuery(""); >> assertNull(ds.getValidationQuery()); >> >> @@ -250,7 +254,7 @@ public class TestBasicDataSource extends >AbstractConnectionPoolTest { >> } >> } >> } >> - >> + >> public void testValidationQueryTimoutFail() { >> ds.setTestOnBorrow(true); >> ds.setValidationQueryTimeout(3); // Too fast for >TesterStatement >> @@ -263,7 +267,7 @@ public class TestBasicDataSource extends >AbstractConnectionPoolTest { >> } >> } >> } >> - >> + >> public void testValidationQueryTimeoutZero() throws Exception { >> ds.setTestOnBorrow(true); >> ds.setTestOnReturn(true); >> @@ -271,7 +275,7 @@ public class TestBasicDataSource extends >AbstractConnectionPoolTest { >> Connection con = ds.getConnection(); >> con.close(); >> } >> - >> + >> public void testValidationQueryTimeoutNegative() throws >Exception { >> ds.setTestOnBorrow(true); >> ds.setTestOnReturn(true); >> @@ -279,7 +283,7 @@ public class TestBasicDataSource extends >AbstractConnectionPoolTest { >> Connection con = ds.getConnection(); >> con.close(); >> } >> - >> + >> public void testValidationQueryTimeoutSucceed() throws >Exception { >> ds.setTestOnBorrow(true); >> ds.setTestOnReturn(true); >> @@ -337,7 +341,7 @@ public class TestBasicDataSource extends >AbstractConnectionPoolTest { >> ds.setTestOnReturn(true); >> ds.setTestWhileIdle(true); >> ds.setValidationQuery(""); >> - >> + >> Connection conn = ds.getConnection(); >> conn.close(); >> >> @@ -345,35 +349,35 @@ public class TestBasicDataSource extends >AbstractConnectionPoolTest { >> assertEquals(false, ds.getTestOnReturn()); >> assertEquals(false, ds.getTestWhileIdle()); >> } >> - >> + >> public void testDefaultCatalog() throws Exception { >> Connection[] c = new Connection[getMaxActive()]; >> for (int i = 0; i < c.length; i++) { >> c[i] = getConnection(); >> assertTrue(c[i] != null); >> - assertEquals(CATALOG, c[i].getCatalog()); >> + assertEquals(CATALOG, c[i].getCatalog()); >> } >> >> for (int i = 0; i < c.length; i++) { >> c[i].setCatalog("error"); >> c[i].close(); >> } >> - >> + >> for (int i = 0; i < c.length; i++) { >> c[i] = getConnection(); >> assertTrue(c[i] != null); >> - assertEquals(CATALOG, c[i].getCatalog()); >> - } >> + assertEquals(CATALOG, c[i].getCatalog()); >> + } >> >> for (int i = 0; i < c.length; i++) { >> c[i].close(); >> } >> } >> - >> + >> public void testSetAutoCommitTrueOnClose() throws Exception { >> ds.setAccessToUnderlyingConnectionAllowed(true); >> ds.setDefaultAutoCommit(false); >> - >> + >> Connection conn = getConnection(); >> assertNotNull(conn); >> assertEquals(false, conn.getAutoCommit()); >> @@ -401,17 +405,17 @@ public class TestBasicDataSource extends >AbstractConnectionPoolTest { >> } >> >> // Bugzilla Bug 28251: Returning dead database connections to >BasicDataSource >> - // isClosed() failure blocks returning a connection to the pool >> + // isClosed() failure blocks returning a connection to the pool >> public void testIsClosedFailure() throws SQLException { >> ds.setAccessToUnderlyingConnectionAllowed(true); >> Connection conn = ds.getConnection(); >> assertNotNull(conn); >> assertEquals(1, ds.getNumActive()); >> - >> + >> // set an IO failure causing the isClosed mathod to fail >> TesterConnection tconn = (TesterConnection) >((DelegatingConnection)conn).getInnermostDelegate(); >> tconn.setFailure(new IOException("network error")); >> - >> + >> try { >> conn.close(); >> fail("Expected SQLException"); >> @@ -420,40 +424,40 @@ public class TestBasicDataSource extends >AbstractConnectionPoolTest { >> >> assertEquals(0, ds.getNumActive()); >> } >> - >> - /** >> - * Bugzilla Bug 29054: >> - * The BasicDataSource.setTestOnReturn(boolean) is not carried >through to >> + >> + /** >> + * Bugzilla Bug 29054: >> + * The BasicDataSource.setTestOnReturn(boolean) is not carried >through to >> * the GenericObjectPool variable _testOnReturn. >> - */ >> + */ >> public void testPropertyTestOnReturn() throws Exception { >> ds.setValidationQuery("select 1 from dual"); >> ds.setTestOnBorrow(false); >> ds.setTestWhileIdle(false); >> ds.setTestOnReturn(true); >> - >> + >> Connection conn = ds.getConnection(); >> assertNotNull(conn); >> - >> + >> assertEquals(false, ds.connectionPool.getTestOnBorrow()); >> assertEquals(false, ds.connectionPool.getTestWhileIdle()); >> assertEquals(true, ds.connectionPool.getTestOnReturn()); >> } >> - >> + >> /** >> * Bugzilla Bug 29055: AutoCommit and ReadOnly >> - * The DaffodilDB driver throws an SQLException if >> - * trying to commit or rollback a readOnly connection. >> + * The DaffodilDB driver throws an SQLException if >> + * trying to commit or rollback a readOnly connection. >> */ >> public void testRollbackReadOnly() throws Exception { >> ds.setDefaultReadOnly(true); >> ds.setDefaultAutoCommit(false); >> - >> + >> Connection conn = ds.getConnection(); >> assertNotNull(conn); >> conn.close(); >> } >> - >> + >> /** >> * Bugzilla Bug 29832: Broken behaviour for >BasicDataSource.setMaxActive(0) >> * MaxActive == 0 should throw SQLException on getConnection. >> @@ -461,12 +465,12 @@ public class TestBasicDataSource extends >AbstractConnectionPoolTest { >> */ >> public void testMaxActiveZero() throws Exception { >> ds.setMaxActive(0); >> - >> + >> try { >> Connection conn = ds.getConnection(); >> assertNotNull(conn); >> fail("SQLException expected"); >> - >> + >> } catch (SQLException e) { >> // test OK >> } >> @@ -504,10 +508,10 @@ public class TestBasicDataSource extends >AbstractConnectionPoolTest { >> // Allow one extra thread for JRockit compatibility >> assertTrue(Thread.activeCount() <= threadCount + 1); >> } >> - >> + >> /** >> * JIRA DBCP-333: Check that a custom class loader is used. >> - * @throws Exception >> + * @throws Exception >> */ >> public void testDriverClassLoader() throws Exception { >> getConnection(); >> @@ -516,7 +520,7 @@ public class TestBasicDataSource extends >AbstractConnectionPoolTest { >> assertTrue(cl instanceof TesterClassLoader); >> assertTrue(((TesterClassLoader) >cl).didLoad(ds.getDriverClassName())); >> } >> - >> + >> /** >> * JIRA: DBCP-342, DBCP-93 >> * Verify that when errors occur during BasicDataSource >initialization, GenericObjectPool >> @@ -538,7 +542,7 @@ public class TestBasicDataSource extends >AbstractConnectionPoolTest { >> // Set min idle > 0, so evictor will try to make connection >as many as idle count >> ds.setMinIdle(2); >> >> - // Prevent concurrent execution of threads executing test >subclasses >> + // Prevent concurrent execution of threads executing test >subclasses >> synchronized (TesterConnRequestCountDriver.class) { >> TesterConnRequestCountDriver.initConnRequestCount(); >> >> @@ -551,14 +555,14 @@ public class TestBasicDataSource extends >AbstractConnectionPoolTest { >> // Ignore >> } >> } >> - >> + >> // sleep 1000ms. evictor will be invoked 10 times if >running. >> Thread.sleep(1000); >> >> // Make sure there have been no Evictor-generated requests >(count should be 10, from requests above) >> assertEquals(10, >TesterConnRequestCountDriver.getConnectionRequestCount()); >> } >> - >> + >> // make sure cleanup is complete >> assertNull(ds.connectionPool); >> } >> diff --git >a/test/org/apache/tomcat/dbcp/dbcp/TesterCallableStatement.java >b/test/org/apache/tomcat/dbcp/dbcp/TesterCallableStatement.java >> index 4b9601b..0c5a4dd 100644 >> --- a/test/org/apache/tomcat/dbcp/dbcp/TesterCallableStatement.java >> +++ b/test/org/apache/tomcat/dbcp/dbcp/TesterCallableStatement.java >> @@ -59,44 +59,55 @@ public class TesterCallableStatement extends >TesterPreparedStatement implements >> super(conn, sql, resultSetType, resultSetConcurrency); >> } >> >> + @Override >> public void registerOutParameter(int parameterIndex, int >sqlType) throws SQLException { >> } >> >> + @Override >> public void registerOutParameter(int parameterIndex, int >sqlType, int scale) throws SQLException { >> } >> >> + @Override >> public boolean wasNull() throws SQLException { >> return false; >> } >> >> + @Override >> public String getString(int parameterIndex) throws SQLException >{ >> return null; >> } >> >> + @Override >> public boolean getBoolean(int parameterIndex) throws >SQLException { >> return false; >> } >> >> + @Override >> public byte getByte(int parameterIndex) throws SQLException { >> return 0; >> } >> >> + @Override >> public short getShort(int parameterIndex) throws SQLException { >> return 0; >> } >> >> + @Override >> public int getInt(int parameterIndex) throws SQLException { >> return 0; >> } >> >> + @Override >> public long getLong(int parameterIndex) throws SQLException { >> return 0; >> } >> >> + @Override >> public float getFloat(int parameterIndex) throws SQLException { >> return 0; >> } >> >> + @Override >> public double getDouble(int parameterIndex) throws SQLException >{ >> return 0; >> } >> @@ -104,355 +115,455 @@ public class TesterCallableStatement extends >TesterPreparedStatement implements >> /** >> * @deprecated >> */ >> + @Override >> public BigDecimal getBigDecimal(int parameterIndex, int scale) >throws SQLException { >> return null; >> } >> >> + @Override >> public byte[] getBytes(int parameterIndex) throws SQLException >{ >> return new byte[0]; >> } >> >> + @Override >> public Date getDate(int parameterIndex) throws SQLException { >> return null; >> } >> >> + @Override >> public Time getTime(int parameterIndex) throws SQLException { >> return null; >> } >> >> + @Override >> public Timestamp getTimestamp(int parameterIndex) throws >SQLException { >> return null; >> } >> >> + @Override >> public Object getObject(int parameterIndex) throws SQLException >{ >> return null; >> } >> >> + @Override >> public BigDecimal getBigDecimal(int parameterIndex) throws >SQLException { >> return null; >> } >> >> + @Override >> public Object getObject(int i, Map<String,Class<?>> map) throws >SQLException { >> return null; >> } >> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org