com.mockobjects.sql

Class CommonMockDataSource

Implemented Interfaces:
DataSource, Verifiable
Known Direct Subclasses:
MockDataSource

public abstract class CommonMockDataSource
extends MockObject
implements DataSource

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:
javax.sql.DataSource

Method Summary

Connection
getConnection()
Returns connection instance passed by setupConnection, and increments the number of connect calls.
Connection
getConnection(String username, String password)
Calls notImplemented.
PrintWriter
getLogWriter()
Calls notImplemented.
int
getLoginTimeout()
Calls notImplemented.
void
setExpectedConnectCalls(int callCount)
Register the number of connections the test should make.
void
setLogWriter(PrintWriter out)
Calls notImplemented.
void
setLoginTimeout(int seconds)
Calls notImplemented.
void
setupConnection(Connection aConnection)
Pass the connection instance for use with tests.

Methods inherited from class com.mockobjects.MockObject

notImplemented, notYetImplemented, verify

Method Details

getConnection

public Connection getConnection()
Returns connection instance passed by setupConnection, and increments the number of connect calls.

getConnection

public Connection getConnection(String username,
                                String password)
Calls notImplemented. Returns null.

getLogWriter

public PrintWriter getLogWriter()
Calls notImplemented. Returns null.

getLoginTimeout

public int getLoginTimeout()
Calls notImplemented. Returns 0.

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.

setLogWriter

public void setLogWriter(PrintWriter out)
Calls notImplemented.

setLoginTimeout

public void setLoginTimeout(int seconds)
Calls notImplemented.

setupConnection

public void setupConnection(Connection aConnection)
Pass the connection instance for use with tests. This instance will be returned until replaced with another.

Copyright © 2002 Mock Objects. All Rights Reserved.