public class DuckTypeConnection extends Object
Constructor and Description |
---|
DuckTypeConnection() |
Modifier and Type | Method and Description |
---|---|
void |
assertAllExpectedStatementsWereRun() |
void |
commit() |
Iterable<ResultRow> |
getQueryResults(String sql) |
int |
getUpdateResults(String sql) |
void |
onSqlListener(String sql,
Runnable action) |
PreparedStatement |
prepareStatement(String sql) |
void |
reset() |
protected void |
runSqlQueryAction(String sql) |
void |
setAutoCommit(boolean autoCommit) |
void |
setDefaultQueryResult(Iterable<ResultRow> defaultQueryResult) |
void |
setDefaultUpdateResult(int defaultUpdateResult) |
void |
setQueryResults(String sql,
Iterable<ResultRow> expectedResults) |
void |
setUpdateResults(String sql,
int rowCount)
Sets the expected results for a SQL statement.
|
void |
setUpdateResults(String sql,
java.util.function.Supplier<RuntimeException> exFactory)
Sets an expected SQL statement to throw an exception.
|
String |
toString() |
public void reset()
public PreparedStatement prepareStatement(String sql)
public void setAutoCommit(boolean autoCommit)
public void commit()
public void setUpdateResults(String sql, int rowCount)
sql
- the expected SQL statementrowCount
- what to return for the number of affected rowspublic void setUpdateResults(String sql, java.util.function.Supplier<RuntimeException> exFactory)
sql
- the expected SQL statementexFactory
- a factory that supplies the runtime exception to be thrown for that SQLpublic int getUpdateResults(String sql)
public void setDefaultUpdateResult(int defaultUpdateResult)
public void assertAllExpectedStatementsWereRun()
protected void runSqlQueryAction(String sql)
Copyright © 2002-2019 Atlassian. All Rights Reserved.