Package de.hybris.platform.jdbcwrapper
Class JUnitConnectionErrorCheckingJDBCConnectionPool
- java.lang.Object
-
- de.hybris.platform.jdbcwrapper.JDBCConnectionPool
-
- de.hybris.platform.jdbcwrapper.ConnectionErrorCheckingJDBCConnectionPool
-
- de.hybris.platform.jdbcwrapper.JUnitConnectionErrorCheckingJDBCConnectionPool
-
- All Implemented Interfaces:
JUnitJDBCConnectionPool
public class JUnitConnectionErrorCheckingJDBCConnectionPool extends ConnectionErrorCheckingJDBCConnectionPool implements JUnitJDBCConnectionPool
For testing error handling when- all connections fail
- single connections fail
- the pool reports connection errors in general
-
-
Constructor Summary
Constructors Constructor Description JUnitConnectionErrorCheckingJDBCConnectionPool(JUnitJDBCConnectionFactory factory, org.apache.commons.pool2.impl.GenericObjectPoolConfig cfg, JUnitConnectionStatus connectionStatus)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFailingConnection(java.sql.Connection con)Allows manually marking a connection to fail validation upon nextJDBCConnectionPool.returnConnection(Connection).protected booleanmayTestAgain(int intervalSeconds)Don't wait for testing.booleanmustValidate(java.sql.Connection con)voidremoveFailingConnection(java.sql.Connection con)Removes a connection from failing set.voidresetTestMode()voidsetAllConnectionsFail(boolean allFail)Allows to manually cause all connections to fail upon validate.voidsetPoolHasConnectionErrors(boolean hasErrors)Allows manual activating / deActivating of connection error flag held by his pool.-
Methods inherited from class de.hybris.platform.jdbcwrapper.ConnectionErrorCheckingJDBCConnectionPool
borrowConnection, cannotConnect
-
Methods inherited from class de.hybris.platform.jdbcwrapper.JDBCConnectionPool
close, disableOracleStatementCaching, enableOracleStatementCaching, getMaxActive, getMaxPhysicalOpen, getNumActive, getNumIdle, getNumPhysicalOpen, invalidateConnection, isPoolClosed, resetOracleStatementCaching, resetStats, returnConnection, setDumpStackOnConnectionError, toString
-
-
-
-
Constructor Detail
-
JUnitConnectionErrorCheckingJDBCConnectionPool
public JUnitConnectionErrorCheckingJDBCConnectionPool(JUnitJDBCConnectionFactory factory, org.apache.commons.pool2.impl.GenericObjectPoolConfig cfg, JUnitConnectionStatus connectionStatus)
-
-
Method Detail
-
mustValidate
public boolean mustValidate(java.sql.Connection con)
-
setPoolHasConnectionErrors
public void setPoolHasConnectionErrors(boolean hasErrors)
Allows manual activating / deActivating of connection error flag held by his pool.- Parameters:
hasErrors-
-
addFailingConnection
public void addFailingConnection(java.sql.Connection con)
Allows manually marking a connection to fail validation upon nextJDBCConnectionPool.returnConnection(Connection).- Specified by:
addFailingConnectionin interfaceJUnitJDBCConnectionPool- Parameters:
con-
-
removeFailingConnection
public void removeFailingConnection(java.sql.Connection con)
Removes a connection from failing set.- Specified by:
removeFailingConnectionin interfaceJUnitJDBCConnectionPool- Parameters:
con-- See Also:
addFailingConnection(Connection)
-
setAllConnectionsFail
public void setAllConnectionsFail(boolean allFail)
Allows to manually cause all connections to fail upon validate.- Specified by:
setAllConnectionsFailin interfaceJUnitJDBCConnectionPool- Parameters:
allFail-
-
resetTestMode
public void resetTestMode()
- Specified by:
resetTestModein interfaceJUnitJDBCConnectionPool
-
mayTestAgain
protected boolean mayTestAgain(int intervalSeconds)
Don't wait for testing. Otherwise we have hard times testing.- Overrides:
mayTestAgainin classConnectionErrorCheckingJDBCConnectionPool
-
-