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 TypeMethodDescriptionvoid
void
addExpectedExecute
(String queryString, boolean success) void
addExpectedExecuteQuery
(String queryString, ResultSet resultSet) void
addExpectedExecuteUpdate
(String queryString, int updateCount) void
cancel()
void
void
void
close()
boolean
int[]
executeQuery
(String sql) int
executeUpdate
(String sql) int
int
int
int
boolean
int
int
int
int
void
setCursorName
(String name) void
setEscapeProcessing
(boolean enable) void
setExpectedCloseCalls
(int callCount) void
setFetchDirection
(int direction) void
setFetchSize
(int rows) void
setMaxFieldSize
(int max) void
setMaxRows
(int max) void
setQueryTimeout
(int seconds) void
setupConnection
(Connection conn) void
setupThrowExceptionOnExecute
(SQLException exception) void
setupUpdateCount
(int updateCount) Methods inherited from class com.mockobjects.MockObject
notImplemented, notYetImplemented, verify
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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, setPoolable
Methods 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceStatement
- Throws:
SQLException
-
execute
- Specified by:
execute
in interfaceStatement
- Throws:
SQLException
-
executeQuery
- Specified by:
executeQuery
in interfaceStatement
- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdate
in interfaceStatement
- Throws:
SQLException
-
getMaxFieldSize
- Specified by:
getMaxFieldSize
in interfaceStatement
- Throws:
SQLException
-
setMaxFieldSize
- Specified by:
setMaxFieldSize
in interfaceStatement
- Throws:
SQLException
-
getMaxRows
- Specified by:
getMaxRows
in interfaceStatement
- Throws:
SQLException
-
setMaxRows
- Specified by:
setMaxRows
in interfaceStatement
- Throws:
SQLException
-
setEscapeProcessing
- Specified by:
setEscapeProcessing
in interfaceStatement
- Throws:
SQLException
-
getQueryTimeout
- Specified by:
getQueryTimeout
in interfaceStatement
- Throws:
SQLException
-
setQueryTimeout
- Specified by:
setQueryTimeout
in interfaceStatement
- Throws:
SQLException
-
cancel
- Specified by:
cancel
in interfaceStatement
- Throws:
SQLException
-
getWarnings
- Specified by:
getWarnings
in interfaceStatement
- Throws:
SQLException
-
clearWarnings
- Specified by:
clearWarnings
in interfaceStatement
- Throws:
SQLException
-
setCursorName
- Specified by:
setCursorName
in interfaceStatement
- Throws:
SQLException
-
getResultSet
- Specified by:
getResultSet
in interfaceStatement
- Throws:
SQLException
-
getUpdateCount
- Specified by:
getUpdateCount
in interfaceStatement
- Throws:
SQLException
-
getMoreResults
- Specified by:
getMoreResults
in interfaceStatement
- Throws:
SQLException
-
setFetchDirection
- Specified by:
setFetchDirection
in interfaceStatement
- Throws:
SQLException
-
getFetchDirection
- Specified by:
getFetchDirection
in interfaceStatement
- Throws:
SQLException
-
setFetchSize
- Specified by:
setFetchSize
in interfaceStatement
- Throws:
SQLException
-
getFetchSize
- Specified by:
getFetchSize
in interfaceStatement
- Throws:
SQLException
-
getResultSetConcurrency
- Specified by:
getResultSetConcurrency
in interfaceStatement
- Throws:
SQLException
-
getResultSetType
- Specified by:
getResultSetType
in interfaceStatement
- Throws:
SQLException
-
addBatch
- Specified by:
addBatch
in interfaceStatement
- Throws:
SQLException
-
clearBatch
- Specified by:
clearBatch
in interfaceStatement
- Throws:
SQLException
-
executeBatch
- Specified by:
executeBatch
in interfaceStatement
- Throws:
SQLException
-
getConnection
- Specified by:
getConnection
in interfaceStatement
- Throws:
SQLException
-