This project provides Hamcrest matcher that compares JDBC result set (java.sql.ResultSet
) against each other or against Java structures.
import static com.exasol.matcher.ResultSetStructurMatcher.*;
class MyTest {
@Test
void testCustomerTableContents() {
// Preparation: Create a JDBC statement and store the reference in variable 'statement'
final ResulSet result = statement.executeQuery("SELECT * FROM CUSTOMERS");
assertThat(result, table("INTEGER", "VARCHAR", "VARCHAR")
.row(1, "JOHN", "DOE")
.row(2, "JANE", "SMITH")
.matches());
}
}
- Match two JDBC result sets
- Match a JDBC result set against an object structure
This is an open source project which is written by enthusiasts at Exasol and not officially supported. We will still try to help you as much as possible. So please create GitHub issue tickets when you want to request features or report bugs.