T - type of parameter placeholder identifiers, see getIdentifier(int).public interface TestKit<T>
Functionality that is not supported by a driver should exclude the individual tests by using @Disabled.
Implementors need to provide the following methods:
getConnectionFactory(): Provide the ConnectionFactory under test.getCreateTableWithAutogeneratedKey(): Return the CREATE TABLE statement to create a table.getPlaceholder(int): Return an parameter placeholder for the nth argument. Arguments start at zero.getIdentifier(int): Return an identifier for the nth argument. The placeholder was obtained prior to this call via getPlaceholder(int). Arguments start at zero
getJdbcOperations(): Return a handle to JdbcOperations configured to the same data source as getConnectionFactory(). Used for test fixture setup/teardown.The following customization hooks can be overridden to adapt the TCK to a specific database:
getInsertIntoWithAutogeneratedKey(): Return the INSERT INTO statement to insert data into a table supporting auto-generated keys.blobType(): Returns the SQL type for a Blob column.clobType(): Returns the SQL type for a Clob column.| Modifier and Type | Method and Description |
|---|---|
default void |
autoCommitByDefault() |
default void |
batch() |
static Statement |
bind(Statement statement,
Object identifier,
Object value) |
default void |
bindFails() |
default void |
bindNull() |
static Statement |
bindNull(Statement statement,
Object identifier,
Class<?> type) |
default void |
bindNullFails() |
default void |
blobInsert() |
default void |
blobSelect() |
default String |
blobType()
Customization hook: Returns the SQL type for a
Blob column. |
default void |
changeAutoCommitCommitsTransaction() |
default void |
clobInsert() |
default void |
clobSelect() |
default String |
clobType()
Customization hook: Returns the SQL type for a
Clob column. |
static <T> reactor.core.publisher.Mono<T> |
close(Connection connection) |
default void |
columnMetadata() |
default void |
compoundStatement() |
default void |
createStatementFails() |
default void |
createTable() |
static <T> reactor.core.publisher.Mono<T> |
discard(Blob blob) |
static <T> reactor.core.publisher.Mono<T> |
discard(Clob clob) |
default void |
dropTable() |
default void |
duplicateColumnNames() |
static reactor.core.publisher.Mono<List<Integer>> |
extractColumns(Result result) |
static reactor.core.publisher.Mono<Integer> |
extractRowsUpdated(Result result) |
ConnectionFactory |
getConnectionFactory()
Returns a
ConnectionFactory for the connected database. |
String |
getCreateTableWithAutogeneratedKey()
Returns the
CREATE TABLE statement for a table named test
with two columns: First one uses auto-generated keys, second one is named value of type INT. |
T |
getIdentifier(int index)
Returns the bind identifier for a given substitution.
|
default String |
getInsertIntoWithAutogeneratedKey()
Customization hook: Returns the
INSERT INTO statement for a table which created
by getCreateTableWithAutogeneratedKey(), only contains the
data for second column value which should be 100. |
org.springframework.jdbc.core.JdbcOperations |
getJdbcOperations()
Returns a
JdbcOperations for the connected database. |
String |
getPlaceholder(int index)
Returns the database-specific placeholder for a given substitution.
|
default void |
prepareStatement() |
default void |
prepareStatementWithIncompleteBatchFails() |
default void |
prepareStatementWithIncompleteBindingFails() |
default void |
returnGeneratedValues() |
default void |
returnGeneratedValuesFails() |
default void |
sameAutoCommitLeavesTransactionUnchanged() |
default void |
savePoint() |
default void |
savePointStartsTransaction() |
default void |
transactionCommit() |
default void |
transactionRollback() |
default void |
validate() |
static <T> reactor.core.publisher.Mono<T> close(Connection connection)
static <T> reactor.core.publisher.Mono<T> discard(Blob blob)
static <T> reactor.core.publisher.Mono<T> discard(Clob clob)
ConnectionFactory getConnectionFactory()
ConnectionFactory for the connected database.ConnectionFactory for the connected databaseString getCreateTableWithAutogeneratedKey()
CREATE TABLE statement for a table named test
with two columns: First one uses auto-generated keys, second one is named value of type INT.
Example:
CREATE TABLE test ( id SERIAL, value INTEGER );
// or
CREATE TABLE test ( id INTEGER IDENTITY, value INTEGER );
CREATE TABLE statementString getPlaceholder(int index)
index - the zero-index number of the substitutionT getIdentifier(int index)
index - the zero-index number of the substitutionorg.springframework.jdbc.core.JdbcOperations getJdbcOperations()
JdbcOperations for the connected database.JdbcOperations for the connected database@Test default void autoCommitByDefault()
@Test default void changeAutoCommitCommitsTransaction()
@Test default void sameAutoCommitLeavesTransactionUnchanged()
@Test default void batch()
@Test default void bindFails()
@Test default void bindNull()
@Test default void bindNullFails()
@Test default void blobInsert()
@Test default void blobSelect()
default String blobType()
Blob column.Blob column.@Test default void clobInsert()
@Test default void clobSelect()
default String clobType()
Clob column.Clob column.@Test default void columnMetadata()
@Test default void compoundStatement()
@Test default void createStatementFails()
@BeforeEach default void createTable()
@AfterEach default void dropTable()
@Test default void duplicateColumnNames()
@Test default void prepareStatement()
@Test default void prepareStatementWithIncompleteBatchFails()
@Test default void prepareStatementWithIncompleteBindingFails()
default String getInsertIntoWithAutogeneratedKey()
INSERT INTO statement for a table which created
by getCreateTableWithAutogeneratedKey(), only contains the
data for second column value which should be 100.
Example:
INSERT INTO test VALUES(100);
// or
INSERT INTO test VALUES(DEFAULT,100);
INSERT INTO statement@Test default void returnGeneratedValues()
@Test default void returnGeneratedValuesFails()
@Test default void savePoint()
@Test default void savePointStartsTransaction()
@Test default void transactionCommit()
@Test default void transactionRollback()
@Test default void validate()
Copyright © 2020. All rights reserved.