Package com.mockobjects.sql
Class CommonMockDataSource
java.lang.Object
com.mockobjects.MockObject
com.mockobjects.sql.CommonMockDataSource
- All Implemented Interfaces:
Verifiable,Wrapper,CommonDataSource,DataSource
- Direct Known Subclasses:
MockDataSource
Abstract DataSource for use with mock testing.
Only the connection methods have been implemented here.
If testing of the log methods is needed, please submit a patch.
- Version:
- $Revision: 1.1 $ $Date: 2002/08/27 16:34:04 $
- Author:
- Ted Husted
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns connection instance passed by setupConnection, and increments the number of connect calls.getConnection(String username, String password) Calls notImplemented.intCalls notImplemented.Calls notImplemented.voidsetExpectedConnectCalls(int callCount) Register the number of connections the test should make.voidsetLoginTimeout(int seconds) Calls notImplemented.voidsetLogWriter(PrintWriter out) Calls notImplemented.voidsetupConnection(Connection aConnection) Pass the connection instance for use with tests.Methods inherited from class com.mockobjects.MockObject
notImplemented, notYetImplemented, verifyMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilder, getParentLoggerMethods inherited from interface javax.sql.DataSource
createConnectionBuilderMethods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
-
Constructor Details
-
CommonMockDataSource
public CommonMockDataSource()
-
-
Method Details
-
setExpectedConnectCalls
public void setExpectedConnectCalls(int callCount) Register the number of connections the test should make. The valid method will report any discrepancy with the actual count. -
setupConnection
Pass the connection instance for use with tests. This instance will be returned until replaced with another. -
getConnection
Returns connection instance passed by setupConnection, and increments the number of connect calls.- Specified by:
getConnectionin interfaceDataSource
-
getConnection
Calls notImplemented. Returns null.- Specified by:
getConnectionin interfaceDataSource
-
getLoginTimeout
public int getLoginTimeout()Calls notImplemented. Returns 0.- Specified by:
getLoginTimeoutin interfaceCommonDataSource- Specified by:
getLoginTimeoutin interfaceDataSource
-
getLogWriter
Calls notImplemented. Returns null.- Specified by:
getLogWriterin interfaceCommonDataSource- Specified by:
getLogWriterin interfaceDataSource
-
setLoginTimeout
public void setLoginTimeout(int seconds) Calls notImplemented.- Specified by:
setLoginTimeoutin interfaceCommonDataSource- Specified by:
setLoginTimeoutin interfaceDataSource
-
setLogWriter
Calls notImplemented.- Specified by:
setLogWriterin interfaceCommonDataSource- Specified by:
setLogWriterin interfaceDataSource
-