public class MockConnection extends MockObject
MockConnection2| Constructor and Description |
|---|
MockConnection()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addExpectedAutoCommit(boolean autoCommit)
Register the anticipated value for autoCommit during testing.
|
void |
addExpectedPreparedStatementString(java.lang.String sql)
Deprecated.
Add an SQL string to use with a prepared staement.
|
void |
clearWarnings()
Calls notImplemented.
|
void |
close()
Will throw the CloseException if it has been set,
or otherwise increment the number or close calls.
|
void |
commit()
Increments the number of commit calls.
|
java.sql.Statement |
createStatement()
Will throw either of the statement exceptions if one has been
set,
or otherwise return the Statement passed to
setupStatement.
|
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency)
Calls notImplemented.
|
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
boolean |
getAutoCommit() |
java.lang.String |
getCatalog()
Calls notImplemented.
|
int |
getHoldability() |
java.sql.DatabaseMetaData |
getMetaData()
Returns the DatabaseMetaData instance passed to setupMetaData.
|
int |
getTransactionIsolation()
Calls notImplemented.
|
java.util.Map |
getTypeMap()
Calls notImplemented.
|
java.sql.SQLWarning |
getWarnings()
Calls notImplemented.
|
boolean |
isClosed()
Throw the isClosedException if it has been set,
or otherwise return the value passed to setupIsClosed.
|
boolean |
isReadOnly()
Calls notImplemented.
|
java.lang.String |
nativeSQL(java.lang.String sql)
Calls notImplemented.
|
java.sql.CallableStatement |
prepareCall(java.lang.String sql)
Calls notImplemented.
|
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
Calls notImplemented.
|
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql)
Throws a statement exception if one has been registered
(@see throwStatementExceptionIfAny)
or returns the next PreparedStatement instance passed to
setupAddPreparedStatement.
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int autoGeneratedKeys) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int[] columnIndexes) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
Calls notImplemented.
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
java.lang.String[] columnNames) |
void |
rollback()
Increments the number of roll back calls.
|
void |
setAutoCommit(boolean autoCommit)
Stores the value passed for comparison with the value passed
to setupAutoCommit.
|
void |
setCatalog(java.lang.String catalog)
Calls notImplemented.
|
void |
setExpectedCloseCalls(int callCount)
Register the number of close calls the test should make.
|
void |
setExpectedCommitCalls(int callCount)
Register the number of commit calls the test should make.
|
void |
setExpectedCreateStatementCalls(int calls)
Register the number of create statement calls the test should make.
|
void |
setExpectedResultSetConcurrency(int resultSetConcurrency)
Sets expectations about the possible value of the
resultSetConcurrency parameter of
createStatement() calls. |
void |
setExpectedResultSetType(int resultSetType)
Sets expectations about the possible value of the
resultSetType parameter of
createStatement() calls. |
void |
setExpectedRollbackCalls(int callCount)
Register the number of roll back calls the test should make.
|
void |
setHoldability(int holdability) |
void |
setReadOnly(boolean readOnly)
Calls notImplemented.
|
void |
setTransactionIsolation(int level)
Calls notImplemented.
|
void |
setTypeMap(java.util.Map map)
Calls notImplemented.
|
void |
setupAddPreparedStatement(java.sql.PreparedStatement prepared)
Deprecated.
Adds a PreparedStatement to be return by prepareStatement
|
void |
setupAutoCommit(boolean autoCommitToReturn) |
void |
setupCloseException(java.sql.SQLException aCloseException)
Pass the SQL exception to throw if close is called
during a test.
|
void |
setupIsClose(boolean aIsClosed)
Deprecated.
Use setupIsClosed
|
void |
setupIsClosed(boolean aIsClosed)
Pass the value to return if isClosed is called during a test.
|
void |
setupIsClosedException(java.sql.SQLException aIsClosedException)
Pass the SQL exception instance to throw if isClosed
is called during a test.
|
void |
setupMetaData(java.sql.DatabaseMetaData metaData)
Pass the DataBaseMetaData instance for use with tests.
|
void |
setupStatement(java.sql.Statement statement)
Pass the Statement instance for use with tests.
|
void |
setupThrowExceptionOnPrepareOrCreate(java.sql.SQLException exception)
Pass the SQL exception to throw if preparedStatement or createStatement
is called during a test.
|
notImplemented, notYetImplemented, verifyequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitabort, createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStruct, getClientInfo, getClientInfo, getNetworkTimeout, getSchema, isValid, releaseSavepoint, rollback, setClientInfo, setClientInfo, setNetworkTimeout, setSavepoint, setSavepoint, setSchemapublic void addExpectedPreparedStatementString(java.lang.String sql)
public void addExpectedAutoCommit(boolean autoCommit)
public void setExpectedCloseCalls(int callCount)
public void setExpectedCommitCalls(int callCount)
public void setExpectedCreateStatementCalls(int calls)
public void setExpectedRollbackCalls(int callCount)
public void setExpectedResultSetConcurrency(int resultSetConcurrency)
resultSetConcurrency parameter of
createStatement() calls.resultSetConcurrency - One of the constants starting with CONCUR
in ResultSet.public void setExpectedResultSetType(int resultSetType)
resultSetType parameter of
createStatement() calls.resultSetType - One of the constants starting with TYPE
in ResultSet.public void setupAddPreparedStatement(java.sql.PreparedStatement prepared)
CommonMockConnection2public void setupCloseException(java.sql.SQLException aCloseException)
public void setupIsClose(boolean aIsClosed)
public void setupIsClosed(boolean aIsClosed)
public void setupIsClosedException(java.sql.SQLException aIsClosedException)
public void setupMetaData(java.sql.DatabaseMetaData metaData)
public void setupStatement(java.sql.Statement statement)
public void setupThrowExceptionOnPrepareOrCreate(java.sql.SQLException exception)
public void setupAutoCommit(boolean autoCommitToReturn)
public void close()
throws java.sql.SQLException
close in interface java.lang.AutoCloseableclose in interface java.sql.Connectionjava.sql.SQLExceptionpublic void commit()
throws java.sql.SQLException
commit in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.Statement createStatement()
throws java.sql.SQLException
createStatement in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.DatabaseMetaData getMetaData()
throws java.sql.SQLException
getMetaData in interface java.sql.Connectionjava.sql.SQLExceptionpublic boolean isClosed()
throws java.sql.SQLException
isClosed in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.PreparedStatement prepareStatement(java.lang.String sql)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLExceptionpublic void rollback()
throws java.sql.SQLException
rollback in interface java.sql.Connectionjava.sql.SQLExceptionpublic void setAutoCommit(boolean autoCommit)
throws java.sql.SQLException
setAutoCommit in interface java.sql.Connectionjava.sql.SQLExceptionpublic void clearWarnings()
throws java.sql.SQLException
clearWarnings in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.Statement createStatement(int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
createStatement in interface java.sql.Connectionjava.sql.SQLExceptionpublic boolean getAutoCommit()
throws java.sql.SQLException
getAutoCommit in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.lang.String getCatalog()
throws java.sql.SQLException
getCatalog in interface java.sql.Connectionjava.sql.SQLExceptionpublic int getTransactionIsolation()
throws java.sql.SQLException
getTransactionIsolation in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.util.Map getTypeMap()
throws java.sql.SQLException
getTypeMap in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.SQLWarning getWarnings()
throws java.sql.SQLException
getWarnings in interface java.sql.Connectionjava.sql.SQLExceptionpublic boolean isReadOnly()
throws java.sql.SQLException
isReadOnly in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.lang.String nativeSQL(java.lang.String sql)
throws java.sql.SQLException
nativeSQL in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.CallableStatement prepareCall(java.lang.String sql)
throws java.sql.SQLException
prepareCall in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.CallableStatement prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
prepareCall in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLExceptionpublic void setCatalog(java.lang.String catalog)
throws java.sql.SQLException
setCatalog in interface java.sql.Connectionjava.sql.SQLExceptionpublic void setReadOnly(boolean readOnly)
throws java.sql.SQLException
setReadOnly in interface java.sql.Connectionjava.sql.SQLExceptionpublic void setTransactionIsolation(int level)
throws java.sql.SQLException
setTransactionIsolation in interface java.sql.Connectionjava.sql.SQLExceptionpublic void setTypeMap(java.util.Map map)
throws java.sql.SQLException
setTypeMap in interface java.sql.Connectionjava.sql.SQLExceptionpublic void setHoldability(int holdability)
throws java.sql.SQLException
setHoldability in interface java.sql.Connectionjava.sql.SQLExceptionpublic int getHoldability()
throws java.sql.SQLException
getHoldability in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.Statement createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws java.sql.SQLException
createStatement in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.CallableStatement prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
throws java.sql.SQLException
prepareCall in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int autoGeneratedKeys)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.PreparedStatement prepareStatement(java.lang.String sql,
int[] columnIndexes)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLExceptionpublic java.sql.PreparedStatement prepareStatement(java.lang.String sql,
java.lang.String[] columnNames)
throws java.sql.SQLException
prepareStatement in interface java.sql.Connectionjava.sql.SQLExceptionCopyright © 2002 Mock Objects. All Rights Reserved.