net.sourceforge.sqlunit.test.mock
Interface IMockDatabase

All Known Implementing Classes:
AbstractMockDatabase, SQLUnitMockDatabase

public interface IMockDatabase

Provides a convenient abstraction of what a mock database should look like for SQLUnit mock testing.

Version:
$Revision: 1.2 $
Author:
Sujit Pal (spal@users.sourceforge.net)

Method Summary
 com.mockrunner.mock.jdbc.MockResultSet getResultSet(java.lang.String methodName, int resultSetId)
          Returns a MockResultSet given the method name to query and the resultset id desired.
 

Method Detail

getResultSet

com.mockrunner.mock.jdbc.MockResultSet getResultSet(java.lang.String methodName,
                                                    int resultSetId)
                                                    throws java.lang.Exception
Returns a MockResultSet given the method name to query and the resultset id desired. Note that this method is implemented in the AbstractMockDatabase class. Subclasses will need to provide a set of private methods that will actually return the mock resultset object. This method essentially delegates to the named method at runtime. Named methods must have the following signature: public MockResultSet method(Integer resultsetId);

Parameters:
methodName - the name of the private method.
resultSetId - which resultset to return in case of multiple resultsets. The index is 1-based, the default for this parameter is 1.
Returns:
a MockResultSet object.
Throws:
java.lang.Exception - if one is thrown in the delegated method.