org.dbunit.database
Class MockDatabaseConnection

java.lang.Object
  extended by org.dbunit.database.MockDatabaseConnection
All Implemented Interfaces:
com.mockobjects.Verifiable, IDatabaseConnection

public class MockDatabaseConnection
extends Object
implements IDatabaseConnection, com.mockobjects.Verifiable

Since:
Mar 16, 2002
Version:
$Revision: 841 $
Author:
Manuel Laflamme

Constructor Summary
MockDatabaseConnection()
           
 
Method Summary
 void close()
           
 IDataSet createDataSet()
           
 IDataSet createDataSet(String[] tableNames)
           
 ITable createQueryTable(String resultName, String sql)
           
 ITable createTable(String tableName)
           
 DatabaseConfig getConfig()
           
 Connection getConnection()
           
 int getRowCount(String tableName)
           
 int getRowCount(String tableName, String whereClause)
           
 String getSchema()
           
 IStatementFactory getStatementFactory()
           
 void setExpectedCloseCalls(int callsCount)
           
 void setupConnection(Connection connection)
           
 void setupDataSet(IDataSet dataSet)
           
 void setupDataSet(ITable table)
           
 void setupDataSet(ITable[] tables)
           
 void setupSchema(String schema)
           
 void setupStatementFactory(IStatementFactory statementFactory)
           
 void verify()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockDatabaseConnection

public MockDatabaseConnection()
Method Detail

setupSchema

public void setupSchema(String schema)

setupConnection

public void setupConnection(Connection connection)

setupDataSet

public void setupDataSet(IDataSet dataSet)

setupDataSet

public void setupDataSet(ITable table)
                  throws AmbiguousTableNameException
Throws:
AmbiguousTableNameException

setupDataSet

public void setupDataSet(ITable[] tables)
                  throws AmbiguousTableNameException
Throws:
AmbiguousTableNameException

setupStatementFactory

public void setupStatementFactory(IStatementFactory statementFactory)

setExpectedCloseCalls

public void setExpectedCloseCalls(int callsCount)

verify

public void verify()
Specified by:
verify in interface com.mockobjects.Verifiable

getConnection

public Connection getConnection()
                         throws SQLException
Specified by:
getConnection in interface IDatabaseConnection
Throws:
SQLException

getSchema

public String getSchema()
Specified by:
getSchema in interface IDatabaseConnection

close

public void close()
           throws SQLException
Specified by:
close in interface IDatabaseConnection
Throws:
SQLException

createDataSet

public IDataSet createDataSet()
                       throws SQLException
Specified by:
createDataSet in interface IDatabaseConnection
Throws:
SQLException

createDataSet

public IDataSet createDataSet(String[] tableNames)
                       throws SQLException,
                              AmbiguousTableNameException
Specified by:
createDataSet in interface IDatabaseConnection
Throws:
SQLException
AmbiguousTableNameException

createQueryTable

public ITable createQueryTable(String resultName,
                               String sql)
                        throws DataSetException,
                               SQLException
Specified by:
createQueryTable in interface IDatabaseConnection
Throws:
DataSetException
SQLException

createTable

public ITable createTable(String tableName)
                   throws DataSetException,
                          SQLException
Specified by:
createTable in interface IDatabaseConnection
Throws:
DataSetException
SQLException

getRowCount

public int getRowCount(String tableName)
                throws SQLException
Specified by:
getRowCount in interface IDatabaseConnection
Throws:
SQLException

getRowCount

public int getRowCount(String tableName,
                       String whereClause)
                throws SQLException
Specified by:
getRowCount in interface IDatabaseConnection
Throws:
SQLException

getStatementFactory

public IStatementFactory getStatementFactory()
Specified by:
getStatementFactory in interface IDatabaseConnection

getConfig

public DatabaseConfig getConfig()
Specified by:
getConfig in interface IDatabaseConnection


Copyright © 2002-2012. All Rights Reserved.