Package com.mockobjects.sql
Class MockStatement
java.lang.Object
com.mockobjects.MockObject
com.mockobjects.sql.MockStatement
- All Implemented Interfaces:
Verifiable,AutoCloseable,Statement,Wrapper
-
Field Summary
Fields inherited from interface java.sql.Statement
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddExpectedExecute(String queryString, boolean success) voidaddExpectedExecuteQuery(String queryString, ResultSet resultSet) voidaddExpectedExecuteUpdate(String queryString, int updateCount) voidcancel()voidvoidvoidclose()booleanint[]executeQuery(String sql) intexecuteUpdate(String sql) intintintintbooleanintintintintvoidsetCursorName(String name) voidsetEscapeProcessing(boolean enable) voidsetExpectedCloseCalls(int callCount) voidsetFetchDirection(int direction) voidsetFetchSize(int rows) voidsetMaxFieldSize(int max) voidsetMaxRows(int max) voidsetQueryTimeout(int seconds) voidsetupConnection(Connection conn) voidsetupThrowExceptionOnExecute(SQLException exception) voidsetupUpdateCount(int updateCount) 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 java.sql.Statement
closeOnCompletion, enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, execute, execute, execute, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeUpdate, executeUpdate, executeUpdate, getGeneratedKeys, getLargeMaxRows, getLargeUpdateCount, getMoreResults, getResultSetHoldability, isClosed, isCloseOnCompletion, isPoolable, isSimpleIdentifier, setLargeMaxRows, setPoolableMethods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
-
Constructor Details
-
MockStatement
public MockStatement()
-
-
Method Details
-
addExpectedExecuteQuery
-
addExpectedExecuteUpdate
-
addExpectedExecute
-
setExpectedCloseCalls
public void setExpectedCloseCalls(int callCount) -
setupConnection
-
setupThrowExceptionOnExecute
-
setupUpdateCount
public void setupUpdateCount(int updateCount) -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceStatement- Throws:
SQLException
-
execute
- Specified by:
executein interfaceStatement- Throws:
SQLException
-
executeQuery
- Specified by:
executeQueryin interfaceStatement- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdatein interfaceStatement- Throws:
SQLException
-
getMaxFieldSize
- Specified by:
getMaxFieldSizein interfaceStatement- Throws:
SQLException
-
setMaxFieldSize
- Specified by:
setMaxFieldSizein interfaceStatement- Throws:
SQLException
-
getMaxRows
- Specified by:
getMaxRowsin interfaceStatement- Throws:
SQLException
-
setMaxRows
- Specified by:
setMaxRowsin interfaceStatement- Throws:
SQLException
-
setEscapeProcessing
- Specified by:
setEscapeProcessingin interfaceStatement- Throws:
SQLException
-
getQueryTimeout
- Specified by:
getQueryTimeoutin interfaceStatement- Throws:
SQLException
-
setQueryTimeout
- Specified by:
setQueryTimeoutin interfaceStatement- Throws:
SQLException
-
cancel
- Specified by:
cancelin interfaceStatement- Throws:
SQLException
-
getWarnings
- Specified by:
getWarningsin interfaceStatement- Throws:
SQLException
-
clearWarnings
- Specified by:
clearWarningsin interfaceStatement- Throws:
SQLException
-
setCursorName
- Specified by:
setCursorNamein interfaceStatement- Throws:
SQLException
-
getResultSet
- Specified by:
getResultSetin interfaceStatement- Throws:
SQLException
-
getUpdateCount
- Specified by:
getUpdateCountin interfaceStatement- Throws:
SQLException
-
getMoreResults
- Specified by:
getMoreResultsin interfaceStatement- Throws:
SQLException
-
setFetchDirection
- Specified by:
setFetchDirectionin interfaceStatement- Throws:
SQLException
-
getFetchDirection
- Specified by:
getFetchDirectionin interfaceStatement- Throws:
SQLException
-
setFetchSize
- Specified by:
setFetchSizein interfaceStatement- Throws:
SQLException
-
getFetchSize
- Specified by:
getFetchSizein interfaceStatement- Throws:
SQLException
-
getResultSetConcurrency
- Specified by:
getResultSetConcurrencyin interfaceStatement- Throws:
SQLException
-
getResultSetType
- Specified by:
getResultSetTypein interfaceStatement- Throws:
SQLException
-
addBatch
- Specified by:
addBatchin interfaceStatement- Throws:
SQLException
-
clearBatch
- Specified by:
clearBatchin interfaceStatement- Throws:
SQLException
-
executeBatch
- Specified by:
executeBatchin interfaceStatement- Throws:
SQLException
-
getConnection
- Specified by:
getConnectionin interfaceStatement- Throws:
SQLException
-