public class DataSourceAssertMatchers extends Object
ProxyTestDataSourceAssertions,
QueryExecutionAssertions,
QueryHolderAssertions,
QueriesHolderAssertions,
BatchParameterHolderAssertions,
ParameterHolderAssertions,
OutParameterHolderAssertions| Constructor and Description |
|---|
DataSourceAssertMatchers() |
| Modifier and Type | Method and Description |
|---|---|
static org.hamcrest.Matcher<? super QueryExecution> |
batch()
Matcher to check
QueryExecution was a batch execution. |
static org.hamcrest.Matcher<? super BatchParameterHolder> |
batch(int index,
org.hamcrest.Matcher<? super ParameterHolder> parameterHolderMatcher)
Matcher to check the given index in batch matches with given parameter matcher.
|
static org.hamcrest.Matcher<? super QueryExecution> |
batchCallable()
Matcher to check
QueryExecution was a batch execution of CallableStatement. |
static org.hamcrest.Matcher<ProxyTestDataSource> |
batchCallableCount(int count)
Matcher to check the number of
CallableBatchExecution in ProxyTestDataSource. |
static org.hamcrest.Matcher<? super QueryExecution> |
batchPrepared()
Matcher to check
QueryExecution was a batch execution of PreparedStatement. |
static org.hamcrest.Matcher<ProxyTestDataSource> |
batchPreparedCount(int count)
Matcher to check the number of
PreparedBatchExecution in ProxyTestDataSource. |
static org.hamcrest.Matcher<? super BatchParameterHolder> |
batchSize(int batchSize)
Matcher to check the batch size.
|
static org.hamcrest.Matcher<? super QueryExecution> |
batchStatement()
Matcher to check
QueryExecution was a batch execution of Statement. |
static org.hamcrest.Matcher<ProxyTestDataSource> |
batchStatementCount(int count)
Matcher to check the number of
StatementBatchExecution in ProxyTestDataSource. |
static org.hamcrest.Matcher<? super QueryExecution> |
callable()
Matcher to check
QueryExecution was an execution of CallableStatement. |
static org.hamcrest.Matcher<ProxyTestDataSource> |
callableCount(int count)
Matcher to check the number of
CallableExecution in ProxyTestDataSource. |
static org.hamcrest.Matcher<? super QueryExecution> |
callableOrBatchCallable()
Matcher to check
QueryExecution was a normal or batch execution of CallableStatement. |
static org.hamcrest.Matcher<ProxyTestDataSource> |
callableOrBatchCallableCount(int count)
|
static org.hamcrest.Matcher<? super QueryHolder> |
delete()
Matcher to examine the query type is SELECT.
|
static org.hamcrest.Matcher<ProxyTestDataSource> |
deleteCount(int count)
Matcher to check the number of DELETE queries in
QueryExecution in ProxyTestDataSource. |
static org.hamcrest.Matcher<ProxyTestDataSource> |
executionCount(int count)
Matcher to check the number of
QueryExecution in ProxyTestDataSource. |
static org.hamcrest.Matcher<ProxyTestDataSource> |
executions(int index,
org.hamcrest.Matcher<? super QueryExecution> queryExecutionMatcher)
Matcher for
QueryExecution of given index. |
static org.hamcrest.Matcher<QueryExecution> |
failure()
Matcher to check
QueryExecution was failure. |
static org.hamcrest.Matcher<? super QueryHolder> |
insert()
Matcher to examine the query type is SELECT.
|
static org.hamcrest.Matcher<ProxyTestDataSource> |
insertCount(int count)
Matcher to check the number of INSERT queries in
QueryExecution in ProxyTestDataSource. |
static org.hamcrest.Matcher<? super QueryExecution> |
isBatch()
Matcher to check
QueryExecution was a batch execution. |
static org.hamcrest.Matcher<? super QueryExecution> |
isBatchCallable()
Matcher to check
QueryExecution was a batch execution of CallableStatement. |
static org.hamcrest.Matcher<? super QueryExecution> |
isBatchPrepared()
Matcher to check
QueryExecution was a batch execution of PreparedStatement. |
static org.hamcrest.Matcher<? super QueryExecution> |
isBatchStatement()
Matcher to check
QueryExecution was a batch execution of Statement. |
static org.hamcrest.Matcher<? super QueryExecution> |
isCallable()
Matcher to check
QueryExecution was an execution of CallableStatement. |
static org.hamcrest.Matcher<? super QueryExecution> |
isCallableOrBatchCallable()
Matcher to check
QueryExecution was a normal or batch execution of CallableStatement. |
static org.hamcrest.Matcher<? super QueryExecution> |
isPrepared()
Matcher to check
QueryExecution was an execution of PreparedStatement. |
static org.hamcrest.Matcher<? super QueryExecution> |
isPreparedOrBatchPrepared()
Matcher to check
QueryExecution was a normal or batch execution of PreparedStatement. |
static org.hamcrest.Matcher<? super QueryExecution> |
isStatement()
Matcher to check
QueryExecution was an execution of Statement. |
static org.hamcrest.Matcher<? super QueryExecution> |
isStatementOrBatchStatement()
Matcher to check
QueryExecution was a normal or batch execution of Statement. |
static org.hamcrest.Matcher<? super ParameterHolder> |
nullParam(int index)
Matcher to examine parameter by index is
setNull operation. |
static org.hamcrest.Matcher<? super ParameterHolder> |
nullParam(int index,
int sqlType)
Matcher to examine parameter by index is
setNull operation with given Types. |
static org.hamcrest.Matcher<? super ParameterHolder> |
nullParam(String name)
Matcher to examine parameter by name is
setNull operation. |
static org.hamcrest.Matcher<? super ParameterHolder> |
nullParam(String name,
int sqlType)
Matcher to examine parameter by name is
setNull operation with given Types. |
static org.hamcrest.Matcher<? super QueryHolder> |
other()
Matcher to examine the query type is SELECT.
|
static org.hamcrest.Matcher<ProxyTestDataSource> |
otherCount(int count)
Matcher to check the number of OTHER queries in
QueryExecution in ProxyTestDataSource. |
static org.hamcrest.Matcher<? super ParameterHolder> |
outParam(int index,
int sqlType)
Matcher to examine out-parameter by index and int sqlType.
|
static org.hamcrest.Matcher<? super ParameterHolder> |
outParam(int index,
SQLType sqlType)
Matcher to examine out-parameter by index and
SQLType. |
static org.hamcrest.Matcher<? super ParameterHolder> |
outParam(String paramName,
int sqlType)
Matcher to examine out-parameter by name and int sqlType.
|
static org.hamcrest.Matcher<? super ParameterHolder> |
outParam(String paramName,
SQLType sqlType)
Matcher to examine out-parameter by name and
SQLType. |
static org.hamcrest.Matcher<? super ParameterHolder> |
outParamIndexes(org.hamcrest.Matcher<? super Collection<Integer>> collectionMatcher)
Matcher to examine out-parameter indexes as a
Collection of Integer. |
static org.hamcrest.Matcher<? super ParameterHolder> |
outParamNames(org.hamcrest.Matcher<? super Collection<String>> collectionMatcher)
Matcher to examine out-parameter names as a
Collection of String. |
static <T> org.hamcrest.Matcher<? super ParameterHolder> |
param(int index,
Class<T> clazz,
org.hamcrest.Matcher<? super T> matcher)
Matcher to examine parameter by index with given class type value.
|
static org.hamcrest.Matcher<? super ParameterHolder> |
param(Integer index,
org.hamcrest.Matcher<Object> matcher)
Matcher to examine parameter by index.
|
static <T> org.hamcrest.Matcher<? super ParameterHolder> |
param(String name,
Class<T> clazz,
org.hamcrest.Matcher<? super T> matcher)
Matcher to examine parameter by name with given class type value.
|
static org.hamcrest.Matcher<? super ParameterHolder> |
param(String name,
org.hamcrest.Matcher<Object> matcher)
Matcher to examine parameter by name.
|
static org.hamcrest.Matcher<? super ParameterHolder> |
paramAsArray(Integer index,
org.hamcrest.Matcher<? super Array> matcher)
Matcher to examine parameter by index with value as
Array. |
static org.hamcrest.Matcher<? super ParameterHolder> |
paramAsArray(String name,
org.hamcrest.Matcher<? super Array> matcher)
Matcher to examine parameter by name with value as
Array. |
static org.hamcrest.Matcher<? super ParameterHolder> |
paramAsBigDecimal(Integer index,
org.hamcrest.Matcher<? super BigDecimal> matcher)
Matcher to examine parameter by index with value as
BigDecimal. |
static org.hamcrest.Matcher<? super ParameterHolder> |
paramAsBigDecimal(String name,
org.hamcrest.Matcher<? super BigDecimal> matcher)
Matcher to examine parameter by name with value as
BigDecimal. |
static org.hamcrest.Matcher<? super ParameterHolder> |
paramAsBoolean(Integer index,
org.hamcrest.Matcher<? super Boolean> matcher)
Matcher to examine parameter by index with value as
Boolean. |
static org.hamcrest.Matcher<? super ParameterHolder> |
paramAsBoolean(String name,
org.hamcrest.Matcher<? super Boolean> matcher)
Matcher to examine parameter by name with value as
Boolean. |
static org.hamcrest.Matcher<? super ParameterHolder> |
paramAsByte(Integer index,
org.hamcrest.Matcher<? super Byte> matcher)
Matcher to examine parameter by index with value as
Byte. |
static org.hamcrest.Matcher<? super ParameterHolder> |
paramAsByte(String name,
org.hamcrest.Matcher<? super Byte> matcher)
Matcher to examine parameter by name with value as
byte[]. |
static org.hamcrest.Matcher<? super ParameterHolder> |
paramAsBytes(Integer index,
org.hamcrest.Matcher<? super byte[]> matcher)
Matcher to examine parameter by index with value as
byte[]. |
static org.hamcrest.Matcher<? super ParameterHolder> |
paramAsBytes(String name,
org.hamcrest.Matcher<? super byte[]> matcher)
Matcher to examine parameter by name with value as
byte[]. |
static org.hamcrest.Matcher<? super ParameterHolder> |
paramAsDate(Integer index,
org.hamcrest.Matcher<? super Date> matcher)
Matcher to examine parameter by index with value as
Date. |
static org.hamcrest.Matcher<? super ParameterHolder> |
paramAsDate(String name,
org.hamcrest.Matcher<? super Date> matcher)
Matcher to examine parameter by name with value as
Time. |
static org.hamcrest.Matcher<? super ParameterHolder> |
paramAsDouble(Integer index,
org.hamcrest.Matcher<? super Double> matcher)
Matcher to examine parameter by index with value as
Double. |
static org.hamcrest.Matcher<? super ParameterHolder> |
paramAsDouble(String name,
org.hamcrest.Matcher<? super Double> matcher)
Matcher to examine parameter by name with value as
Double. |
static org.hamcrest.Matcher<? super ParameterHolder> |
paramAsFloat(Integer index,
org.hamcrest.Matcher<? super Float> matcher)
Matcher to examine parameter by index with value as
Float. |
static org.hamcrest.Matcher<? super ParameterHolder> |
paramAsFloat(String name,
org.hamcrest.Matcher<? super Float> matcher)
Matcher to examine parameter by name with value as
Float. |
static org.hamcrest.Matcher<? super ParameterHolder> |
paramAsInteger(Integer index,
org.hamcrest.Matcher<? super Integer> matcher)
Matcher to examine parameter by index with value as
Integer. |
static org.hamcrest.Matcher<? super ParameterHolder> |
paramAsInteger(String name,
org.hamcrest.Matcher<? super Integer> matcher)
Matcher to examine parameter by name with value as
Integer. |
static org.hamcrest.Matcher<? super ParameterHolder> |
paramAsLong(Integer index,
org.hamcrest.Matcher<? super Long> matcher)
Matcher to examine parameter by index with value as
Long. |
static org.hamcrest.Matcher<? super ParameterHolder> |
paramAsLong(String name,
org.hamcrest.Matcher<? super Long> matcher)
Matcher to examine parameter by name with value as
Long. |
static org.hamcrest.Matcher<? super ParameterHolder> |
paramAsShort(Integer index,
org.hamcrest.Matcher<? super Short> matcher)
Matcher to examine parameter by index with value as
Short. |
static org.hamcrest.Matcher<? super ParameterHolder> |
paramAsShort(String name,
org.hamcrest.Matcher<? super Short> matcher)
Matcher to examine parameter by name with value as
Short. |
static org.hamcrest.Matcher<? super ParameterHolder> |
paramAsString(Integer index,
org.hamcrest.Matcher<? super String> matcher)
Matcher to examine parameter by index with value as
String. |
static org.hamcrest.Matcher<? super ParameterHolder> |
paramAsString(String name,
org.hamcrest.Matcher<? super String> matcher)
Matcher to examine parameter by name with value as
String. |
static org.hamcrest.Matcher<? super ParameterHolder> |
paramAsTime(Integer index,
org.hamcrest.Matcher<? super Time> matcher)
Matcher to examine parameter by index with value as
Time. |
static org.hamcrest.Matcher<? super ParameterHolder> |
paramAsTime(String name,
org.hamcrest.Matcher<? super Time> matcher)
Matcher to examine parameter by name with value as
Time. |
static org.hamcrest.Matcher<? super ParameterHolder> |
paramAsTimestamp(Integer index,
org.hamcrest.Matcher<? super Timestamp> matcher)
Matcher to examine parameter by index with value as
Timestamp. |
static org.hamcrest.Matcher<? super ParameterHolder> |
paramAsTimestamp(String name,
org.hamcrest.Matcher<? super Timestamp> matcher)
Matcher to examine parameter by name with value as
Timestamp. |
static org.hamcrest.Matcher<? super ParameterHolder> |
paramIndexes(Integer... indexes)
Matcher to examine parameter indexes.
|
static org.hamcrest.Matcher<? super ParameterHolder> |
paramIndexes(org.hamcrest.Matcher<? super Collection<Integer>> collectionMatcher)
Matcher to examine parameter indexes as a
Collection of Integer. |
static org.hamcrest.Matcher<? super ParameterHolder> |
paramNames(org.hamcrest.Matcher<? super Collection<String>> collectionMatcher)
Matcher to examine parameter names as a
Collection of String. |
static org.hamcrest.Matcher<? super ParameterHolder> |
paramNames(String... names)
Matcher to examine parameter names.
|
static org.hamcrest.Matcher<? super ParameterHolder> |
paramsByIndex(org.hamcrest.Matcher<Map<? extends Integer,?>> mapMatcher)
|
static org.hamcrest.Matcher<? super ParameterHolder> |
paramsByName(org.hamcrest.Matcher<Map<? extends String,?>> mapMatcher)
|
static org.hamcrest.Matcher<? super QueryExecution> |
prepared()
Matcher to check
QueryExecution was an execution of PreparedStatement. |
static org.hamcrest.Matcher<ProxyTestDataSource> |
preparedCount(int count)
Matcher to check the number of
PreparedExecution in ProxyTestDataSource. |
static org.hamcrest.Matcher<? super QueryExecution> |
preparedOrBatchPrepared()
Matcher to check
QueryExecution was a normal or batch execution of PreparedStatement. |
static org.hamcrest.Matcher<ProxyTestDataSource> |
preparedOrBatchPreparedCount(int count)
|
static org.hamcrest.Matcher<? super QueriesHolder> |
queries(int index,
org.hamcrest.Matcher<String> stringMatcher) |
static org.hamcrest.Matcher<? super QueriesHolder> |
queries(org.hamcrest.Matcher<? super Collection<String>> collectionMatcher) |
static org.hamcrest.Matcher<? super QueryHolder> |
query(org.hamcrest.Matcher<String> stringMatcher)
Matcher to examine the query with given
String matcher. |
static org.hamcrest.Matcher<? super QueryHolder> |
queryType(net.ttddyy.dsproxy.QueryType expectedType)
Matcher to examine the query type.
|
static org.hamcrest.Matcher<? super QueriesHolder> |
queryTypes(int index,
org.hamcrest.Matcher<? super QueryHolder> queryHolderMatcher) |
static org.hamcrest.Matcher<? super QueryHolder> |
select()
Matcher to examine the query type is SELECT.
|
static org.hamcrest.Matcher<ProxyTestDataSource> |
selectCount(int count)
Matcher to check the number of SELECT queries in
QueryExecution in ProxyTestDataSource. |
static org.hamcrest.Matcher<? super QueryExecution> |
statement()
Matcher to check
QueryExecution was an execution of Statement. |
static org.hamcrest.Matcher<ProxyTestDataSource> |
statementCount(int count)
Matcher to check the number of
StatementExecution in ProxyTestDataSource. |
static org.hamcrest.Matcher<? super QueryExecution> |
statementOrBatchStatement()
Matcher to check
QueryExecution was a normal or batch execution of Statement. |
static org.hamcrest.Matcher<ProxyTestDataSource> |
statementOrBatchStatementCount(int count)
Matcher to check the number of
StatementExecution or StatementBatchExecution in ProxyTestDataSource. |
static org.hamcrest.Matcher<QueryExecution> |
success()
Matcher to check
QueryExecution was successful. |
static org.hamcrest.Matcher<ProxyTestDataSource> |
totalQueryCount(int count)
Matcher to check the number of queries in
QueryExecution in ProxyTestDataSource. |
static org.hamcrest.Matcher<? super QueryHolder> |
update()
Matcher to examine the query type is SELECT.
|
static org.hamcrest.Matcher<ProxyTestDataSource> |
updateCount(int count)
Matcher to check the number of UPDATE queries in
QueryExecution in ProxyTestDataSource. |
public static org.hamcrest.Matcher<ProxyTestDataSource> executions(int index, org.hamcrest.Matcher<? super QueryExecution> queryExecutionMatcher)
QueryExecution of given index.
Example:
assertThat(ds, executions(0, statement())); assertThat(ds, executions(0, isPreparedOrBatchPrepared())); assertThat(ds, executions(0, is(success())));
index - indexqueryExecutionMatcher - matcher for QueryExecutionProxyTestDataSourcepublic static org.hamcrest.Matcher<ProxyTestDataSource> executionCount(int count)
QueryExecution in ProxyTestDataSource.
Example:
assertThat(ds, executionCount(3));
count - expected countProxyTestDataSourcepublic static org.hamcrest.Matcher<ProxyTestDataSource> statementCount(int count)
StatementExecution in ProxyTestDataSource.
Example:
assertThat(ds, statementCount(3));
count - countProxyTestDataSourcepublic static org.hamcrest.Matcher<ProxyTestDataSource> batchStatementCount(int count)
StatementBatchExecution in ProxyTestDataSource.
Example:
assertThat(ds, batchStatementCount(3));
count - countProxyTestDataSourcepublic static org.hamcrest.Matcher<ProxyTestDataSource> statementOrBatchStatementCount(int count)
StatementExecution or StatementBatchExecution in ProxyTestDataSource.
Example:
assertThat(ds, statementOrBatchStatementCount(3));
count - countProxyTestDataSourcepublic static org.hamcrest.Matcher<ProxyTestDataSource> preparedCount(int count)
PreparedExecution in ProxyTestDataSource.
Example:
assertThat(ds, preparedCount(3));
count - countProxyTestDataSourcepublic static org.hamcrest.Matcher<ProxyTestDataSource> batchPreparedCount(int count)
PreparedBatchExecution in ProxyTestDataSource.
Example:
assertThat(ds, batchPreparedCount(3));
count - countProxyTestDataSourcepublic static org.hamcrest.Matcher<ProxyTestDataSource> preparedOrBatchPreparedCount(int count)
PreparedExecution or PreparedBatchExecution in ProxyTestDataSource.
Example:
assertThat(ds, preparedOrBatchPreparedCount(3));
count - countProxyTestDataSourcepublic static org.hamcrest.Matcher<ProxyTestDataSource> callableCount(int count)
CallableExecution in ProxyTestDataSource.
Example:
assertThat(ds, callableCount(3));
count - countProxyTestDataSourcepublic static org.hamcrest.Matcher<ProxyTestDataSource> batchCallableCount(int count)
CallableBatchExecution in ProxyTestDataSource.
Example:
assertThat(ds, batchCallableCount(3));
count - countProxyTestDataSourcepublic static org.hamcrest.Matcher<ProxyTestDataSource> callableOrBatchCallableCount(int count)
CallableExecution or CallableBatchExecution in ProxyTestDataSource.
Example:
assertThat(ds, callableOrBatchCallableCount(3));
count - countProxyTestDataSourcepublic static org.hamcrest.Matcher<ProxyTestDataSource> totalQueryCount(int count)
QueryExecution in ProxyTestDataSource.
This matcher counts the number of queries whereas executionCount(int) counts the number of executions.
The number of queries and executions may differ when there is a Batch execution of Statement.
Single execution of Statement may contain multiple queries. Thus, executionCount(int)
count it as one, but this matcher may report more than one queries.
Example:
assertThat(ds, totalQueryCount(3));
count - countProxyTestDataSourceexecutionCount(int)public static org.hamcrest.Matcher<ProxyTestDataSource> selectCount(int count)
QueryExecution in ProxyTestDataSource.
Example:
assertThat(ds, selectCount(3));
count - countProxyTestDataSourcepublic static org.hamcrest.Matcher<ProxyTestDataSource> insertCount(int count)
QueryExecution in ProxyTestDataSource.
Example:
assertThat(ds, insertCount(3));
count - countProxyTestDataSourcepublic static org.hamcrest.Matcher<ProxyTestDataSource> updateCount(int count)
QueryExecution in ProxyTestDataSource.
Example:
assertThat(ds, updateCount(3));
count - countProxyTestDataSourcepublic static org.hamcrest.Matcher<ProxyTestDataSource> deleteCount(int count)
QueryExecution in ProxyTestDataSource.
Example:
assertThat(ds, deleteCount(3));
count - countProxyTestDataSourcepublic static org.hamcrest.Matcher<ProxyTestDataSource> otherCount(int count)
QueryExecution in ProxyTestDataSource.
Example:
assertThat(ds, otherCount(3));
count - countProxyTestDataSourcepublic static org.hamcrest.Matcher<QueryExecution> success()
QueryExecution was successful.
Example:
assertThat(qe, success());
QueryExecutionpublic static org.hamcrest.Matcher<QueryExecution> failure()
QueryExecution was failure.
Example:
assertThat(qe, failure());
QueryExecutionpublic static org.hamcrest.Matcher<? super QueryExecution> batch()
QueryExecution was a batch execution.
Example:
assertThat(qe, batch());
QueryExecutionpublic static org.hamcrest.Matcher<? super QueryExecution> statement()
QueryExecution was an execution of Statement.
Example:
assertThat(qe, statement());
QueryExecutionpublic static org.hamcrest.Matcher<? super QueryExecution> batchStatement()
QueryExecution was a batch execution of Statement.
Example:
assertThat(qe, batchStatement());
QueryExecutionpublic static org.hamcrest.Matcher<? super QueryExecution> statementOrBatchStatement()
QueryExecution was a normal or batch execution of Statement.
Example:
assertThat(qe, statementOrBatchStatement());
QueryExecutionpublic static org.hamcrest.Matcher<? super QueryExecution> prepared()
QueryExecution was an execution of PreparedStatement.
Example:
assertThat(qe, prepared());
QueryExecutionpublic static org.hamcrest.Matcher<? super QueryExecution> batchPrepared()
QueryExecution was a batch execution of PreparedStatement.
Example:
assertThat(qe, batchPrepared());
QueryExecutionpublic static org.hamcrest.Matcher<? super QueryExecution> preparedOrBatchPrepared()
QueryExecution was a normal or batch execution of PreparedStatement.
Example:
assertThat(qe, preparedOrBatchPrepared());
QueryExecutionpublic static org.hamcrest.Matcher<? super QueryExecution> callable()
QueryExecution was an execution of CallableStatement.
Example:
assertThat(qe, callable());
QueryExecutionpublic static org.hamcrest.Matcher<? super QueryExecution> batchCallable()
QueryExecution was a batch execution of CallableStatement.
Example:
assertThat(qe, batchCallable());
QueryExecutionpublic static org.hamcrest.Matcher<? super QueryExecution> callableOrBatchCallable()
QueryExecution was a normal or batch execution of CallableStatement.
Example:
assertThat(qe, callableOrBatchCallable());
QueryExecutionpublic static org.hamcrest.Matcher<? super QueryExecution> isBatch()
QueryExecution was a batch execution.
Alias of batch()
Example:
assertThat(qe, isBatch());
QueryExecutionpublic static org.hamcrest.Matcher<? super QueryExecution> isStatement()
QueryExecution was an execution of Statement.
Alias of statement()
Example:
assertThat(qe, isStatement());
QueryExecutionpublic static org.hamcrest.Matcher<? super QueryExecution> isBatchStatement()
QueryExecution was a batch execution of Statement.
Alias of batchStatement()
Example:
assertThat(qe, isBatchStatement());
QueryExecutionpublic static org.hamcrest.Matcher<? super QueryExecution> isStatementOrBatchStatement()
QueryExecution was a normal or batch execution of Statement.
Alias of statementOrBatchStatement()
Example:
assertThat(qe, isStatementOrBatchStatement());
QueryExecutionpublic static org.hamcrest.Matcher<? super QueryExecution> isPrepared()
QueryExecution was an execution of PreparedStatement.
Alias of prepared()
Example:
assertThat(qe, isPrepared());
QueryExecutionpublic static org.hamcrest.Matcher<? super QueryExecution> isBatchPrepared()
QueryExecution was a batch execution of PreparedStatement.
Alias of batchPrepared()
Example:
assertThat(qe, isBatchPrepared());
QueryExecutionpublic static org.hamcrest.Matcher<? super QueryExecution> isPreparedOrBatchPrepared()
QueryExecution was a normal or batch execution of PreparedStatement.
Alias of preparedOrBatchPrepared()
Example:
assertThat(qe, isPreparedOrBatchPrepared());
QueryExecutionpublic static org.hamcrest.Matcher<? super QueryExecution> isCallable()
QueryExecution was an execution of CallableStatement.
Alias of callable()
Example:
assertThat(qe, isCallable());
QueryExecutionpublic static org.hamcrest.Matcher<? super QueryExecution> isBatchCallable()
QueryExecution was a batch execution of CallableStatement.
Alias of batchCallable()
Example:
assertThat(qe, isBatchCallable());
QueryExecutionpublic static org.hamcrest.Matcher<? super QueryExecution> isCallableOrBatchCallable()
QueryExecution was a normal or batch execution of CallableStatement.
Alias of callableOrBatchCallable()
Example:
assertThat(qe, isCallableOrBatchCallable());
QueryExecutionpublic static org.hamcrest.Matcher<? super QueryHolder> query(org.hamcrest.Matcher<String> stringMatcher)
String matcher.
Example:
assertThat(qe, query(startsWith("select"))); stringMatcher - matcher for StringQueryHolderpublic static org.hamcrest.Matcher<? super QueryHolder> queryType(net.ttddyy.dsproxy.QueryType expectedType)
assertThat(qe, queryType(SELECT));
expectedType - expected QueryTypeQueryHolderpublic static org.hamcrest.Matcher<? super QueryHolder> select()
assertThat(qe, select());
QueryHolderpublic static org.hamcrest.Matcher<? super QueryHolder> insert()
assertThat(qe, insert());
QueryHolderpublic static org.hamcrest.Matcher<? super QueryHolder> update()
assertThat(qe, update());
QueryHolderpublic static org.hamcrest.Matcher<? super QueryHolder> delete()
assertThat(qe, delete());
QueryHolderpublic static org.hamcrest.Matcher<? super QueryHolder> other()
assertThat(qe, other());
QueryHolderpublic static org.hamcrest.Matcher<? super QueriesHolder> queries(int index, org.hamcrest.Matcher<String> stringMatcher)
public static org.hamcrest.Matcher<? super QueriesHolder> queries(org.hamcrest.Matcher<? super Collection<String>> collectionMatcher)
public static org.hamcrest.Matcher<? super QueriesHolder> queryTypes(int index, org.hamcrest.Matcher<? super QueryHolder> queryHolderMatcher)
public static org.hamcrest.Matcher<? super BatchParameterHolder> batchSize(int batchSize)
assertThat(ds.getBatchStatements(), batchSize(3));
batchSize - batch sizeBatchParameterHolderpublic static org.hamcrest.Matcher<? super BatchParameterHolder> batch(int index, org.hamcrest.Matcher<? super ParameterHolder> parameterHolderMatcher)
assertThat(ds.getBatchStatements(), batch(0, param(1, String.class, is("FOO")))); index - indexparameterHolderMatcher - matcher for ParameterHolderBatchParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> paramsByName(org.hamcrest.Matcher<Map<? extends String,?>> mapMatcher)
Map(key=String, value=Object).
Example:
assertThat(parameterByNameHolder, paramsByName(hasEntry("foo", (Object) "FOO"))); mapMatcher - a Map matcherParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> paramsByIndex(org.hamcrest.Matcher<Map<? extends Integer,?>> mapMatcher)
Map(key=Integer, value=Object).
Example:
assertThat(parameterByIndexHolder, paramsByName(paramsByIndex(1, (Object) "FOO")));
mapMatcher - a Map matcherParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> paramIndexes(org.hamcrest.Matcher<? super Collection<Integer>> collectionMatcher)
Collection of Integer.
Example:
assertThat(parameterByIndexHolder, paramIndexes(hasItem(1), hasItem(2)));
collectionMatcher - a Collection matcherParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> paramIndexes(Integer... indexes)
Example:
assertThat(parameterByIndexHolder, paramIndexes(1,2,3));
indexes - parameter indexesParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> paramNames(org.hamcrest.Matcher<? super Collection<String>> collectionMatcher)
Collection of String.
Example:
assertThat(parameterByNameHolder, paramNames(hasItem("foo"), hasItem("bar"))); collectionMatcher - a Collection matcherParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> paramNames(String... names)
Example:
assertThat(parameterByNameHolder, paramNames("foo","bar","baz")); names - parameter namesParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> param(String name, org.hamcrest.Matcher<Object> matcher)
Example:
assertThat(parameterByNameHolder, param("foo", is((Object) "FOO"))); name - parameter namematcher - matcherParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> param(Integer index, org.hamcrest.Matcher<Object> matcher)
Example:
assertThat(parameterByIndexHolder, param(1, is((Object) "FOO")));
index - parameter indexmatcher - matcherParameterHolderpublic static <T> org.hamcrest.Matcher<? super ParameterHolder> param(String name, Class<T> clazz, org.hamcrest.Matcher<? super T> matcher)
Example:
assertThat(parameterByNameHolder, param("foo", String.class, is("FOO"))); T - parameter typename - parameter nameclazz - value typematcher - matcher for <T>ParameterHolderpublic static <T> org.hamcrest.Matcher<? super ParameterHolder> param(int index, Class<T> clazz, org.hamcrest.Matcher<? super T> matcher)
Example:
assertThat(parameterByIndexHolder, param(1, String.class, is("FOO"))); T - parameter typeindex - parameter indexclazz - value typematcher - matcher for <T>ParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> paramAsString(Integer index, org.hamcrest.Matcher<? super String> matcher)
String.
Example:
assertThat(parameterByIndexHolder, paramAsString(1, is("FOO"))); index - parameter indexmatcher - type for StringParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> paramAsInteger(Integer index, org.hamcrest.Matcher<? super Integer> matcher)
Integer.
Example:
assertThat(parameterByIndexHolder, paramAsInteger(1, is(100)));
index - parameter indexmatcher - type for IntegerParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> paramAsLong(Integer index, org.hamcrest.Matcher<? super Long> matcher)
Long.
Example:
assertThat(parameterByIndexHolder, paramAsLong(1, is(100L)));
index - parameter indexmatcher - type for LongParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> paramAsDouble(Integer index, org.hamcrest.Matcher<? super Double> matcher)
Double.
Example:
assertThat(parameterByIndexHolder, paramAsDouble(1, is(10.0)));
index - parameter indexmatcher - type for DoubleParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> paramAsShort(Integer index, org.hamcrest.Matcher<? super Short> matcher)
Short.
Example:
assertThat(parameterByIndexHolder, paramAsShort(1, is((short)1)));
index - parameter indexmatcher - type for ShortParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> paramAsBoolean(Integer index, org.hamcrest.Matcher<? super Boolean> matcher)
Boolean.
Example:
assertThat(parameterByIndexHolder, paramAsBoolean(1, is(true)));
index - parameter indexmatcher - type for BooleanParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> paramAsByte(Integer index, org.hamcrest.Matcher<? super Byte> matcher)
Byte.
Example:
assertThat(parameterByIndexHolder, paramAsByte(1, is((byte)1)));
index - parameter indexmatcher - type for ByteParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> paramAsFloat(Integer index, org.hamcrest.Matcher<? super Float> matcher)
Float.
Example:
assertThat(parameterByIndexHolder, paramAsFloat(1, is((float)1.0)));
index - parameter indexmatcher - type for FloatParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> paramAsBigDecimal(Integer index, org.hamcrest.Matcher<? super BigDecimal> matcher)
BigDecimal.
Example:
assertThat(parameterByIndexHolder, paramAsBigDecimal(1, is(new BigDecimal(10)));
index - parameter indexmatcher - type for BitDecimalParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> paramAsBytes(Integer index, org.hamcrest.Matcher<? super byte[]> matcher)
byte[].
Example:
assertThat(parameterByIndexHolder, paramAsBytes(1, is(new byte[]{0xa, 0xb}))); index - parameter indexmatcher - type for byte[]ParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> paramAsDate(Integer index, org.hamcrest.Matcher<? super Date> matcher)
Date.
Example:
assertThat(parameterByIndexHolder, paramAsDate(1, is(new Date(100))));
index - parameter indexmatcher - type for DateParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> paramAsTime(Integer index, org.hamcrest.Matcher<? super Time> matcher)
Time.
Example:
assertThat(parameterByIndexHolder, paramAsTime(1, is(new Time(1000))));
index - parameter indexmatcher - type for TimeParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> paramAsTimestamp(Integer index, org.hamcrest.Matcher<? super Timestamp> matcher)
Timestamp.
Example:
assertThat(parameterByIndexHolder, paramAsTimestamp(1, is(new Timestamp(1000))));
index - parameter indexmatcher - type for TimestampParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> paramAsArray(Integer index, org.hamcrest.Matcher<? super Array> matcher)
Array.
Example:
assertThat(parameterByIndexHolder, paramAsArray(1, is(array)));
index - parameter indexmatcher - type for ArrayParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> paramAsString(String name, org.hamcrest.Matcher<? super String> matcher)
String.
Example:
assertThat(parameterByNameHolder, paramAsString("foo", is("FOO"))); name - parameter namematcher - type for StringParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> paramAsInteger(String name, org.hamcrest.Matcher<? super Integer> matcher)
Integer.
Example:
assertThat(parameterByNameHolder, paramAsInteger("foo", is(100))); name - parameter namematcher - type for IntegerParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> paramAsLong(String name, org.hamcrest.Matcher<? super Long> matcher)
Long.
Example:
assertThat(parameterByNameHolder, paramAsLong("foo", is(100L))); name - parameter namematcher - type for LongParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> paramAsDouble(String name, org.hamcrest.Matcher<? super Double> matcher)
Double.
Example:
assertThat(parameterByNameHolder, paramAsDouble("foo", is(10.0))); name - parameter namematcher - type for DoubleParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> paramAsShort(String name, org.hamcrest.Matcher<? super Short> matcher)
Short.
Example:
assertThat(parameterByNameHolder, paramAsShort("foo", is((short)1))); name - parameter namematcher - type for ShortParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> paramAsBoolean(String name, org.hamcrest.Matcher<? super Boolean> matcher)
Boolean.
Example:
assertThat(parameterByNameHolder, paramAsBoolean("foo", is(true))); name - parameter namematcher - type for BooleanParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> paramAsByte(String name, org.hamcrest.Matcher<? super Byte> matcher)
byte[].
Example:
assertThat(parameterByNameHolder, paramAsBytes("foo", is(new byte[]{0xa, 0xb}))); name - parameter namematcher - type for ByteParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> paramAsFloat(String name, org.hamcrest.Matcher<? super Float> matcher)
Float.
Example:
assertThat(parameterByNameHolder, paramAsFloat("foo", is((float)1.0))); name - parameter namematcher - type for FloatParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> paramAsBigDecimal(String name, org.hamcrest.Matcher<? super BigDecimal> matcher)
BigDecimal.
Example:
assertThat(parameterByNameHolder, paramAsBigDecimal("foo", is(new BigDecimal(10))); name - parameter namematcher - type for BigDecimalParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> paramAsBytes(String name, org.hamcrest.Matcher<? super byte[]> matcher)
byte[].
Example:
assertThat(parameterByNameHolder, paramAsBytes("foo", is(new byte[]{0xa, 0xb}))); name - parameter namematcher - type for byte[]ParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> paramAsDate(String name, org.hamcrest.Matcher<? super Date> matcher)
Time.
Example:
assertThat(parameterByNameHolder, paramAsTime("foo", is(new Time(1000)))); name - parameter namematcher - type for DateParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> paramAsTime(String name, org.hamcrest.Matcher<? super Time> matcher)
Time.
Example:
assertThat(parameterByNameHolder, paramAsTime("foo", is(new Time(1000)))); name - parameter namematcher - type for TimeParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> paramAsTimestamp(String name, org.hamcrest.Matcher<? super Timestamp> matcher)
Timestamp.
Example:
assertThat(parameterByNameHolder, paramAsTimestamp("foo", is(new Timestamp(1000)))); name - parameter namematcher - type for TimestampParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> paramAsArray(String name, org.hamcrest.Matcher<? super Array> matcher)
Array.
Example:
assertThat(parameterByNameHolder, paramAsArray("foo", is(array))); name - parameter namematcher - type for ArrayParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> nullParam(int index, int sqlType)
setNull operation with given Types.
Example:
assertThat(parameterByIndexHolder, nullParam(1, is(Types.VARCHAR)));
index - parameter indexsqlType - type for TypesParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> nullParam(String name, int sqlType)
setNull operation with given Types.
Example:
assertThat(parameterByNameHolder, nullParam("foo", is(Types.VARCHAR))); name - parameter namesqlType - type for TypesParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> nullParam(String name)
setNull operation.
Example:
assertThat(parameterByNameHolder, nullParam("foo")); name - parameter nameParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> nullParam(int index)
setNull operation.
Example:
assertThat(parameterByIndexHolder, nullParam(1));
index - indexParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> outParamNames(org.hamcrest.Matcher<? super Collection<String>> collectionMatcher)
Collection of String.
Example:
assertThat(outParameterHolder, outParamNames(hasItem("foo"), hasItem("bar"))); collectionMatcher - a Collection matcherParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> outParamIndexes(org.hamcrest.Matcher<? super Collection<Integer>> collectionMatcher)
Collection of Integer.
Example:
assertThat(outParameterHolder, outParamIndexes(hasItem(1)));
collectionMatcher - a Collection matcherParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> outParam(String paramName, int sqlType)
Example:
assertThat(outParameterHolder, outParam("foo", Types.BOOLEAN)); paramName - out-parameter namesqlType - sqlType in intParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> outParam(String paramName, SQLType sqlType)
SQLType.
Example:
assertThat(outParameterHolder, outParam("foo", JDBCType.INTEGER)); paramName - out-parameter namesqlType - sqlTypeParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> outParam(int index, int sqlType)
Example:
assertThat(outParameterHolder, outParam(1, Types.BOOLEAN));
index - out-parameter indexsqlType - sqlType in intParameterHolderpublic static org.hamcrest.Matcher<? super ParameterHolder> outParam(int index, SQLType sqlType)
SQLType.
Example:
assertThat(outParameterHolder, outParam(1, JDBCType.INTEGER));
index - out-parameter indexsqlType - sqlTypeParameterHolderCopyright © 2017. All rights reserved.