Skip to content

Commit

Permalink
Minimize test case and express in "standard" queries
Browse files Browse the repository at this point in the history
  • Loading branch information
mrotteveel committed Sep 18, 2024
1 parent 707e9b5 commit 8cd1f0f
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions src/test/org/firebirdsql/jdbc/FBResultSetTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1475,26 +1475,17 @@ static Stream<Arguments> testIsBeforeFirst_isAfterLast_emptyResultSet_bug807() {
@MethodSource
void wasNull_onInsertRow(int resultSetType, String scrollableCursorPropertyValue) throws Exception {
try (Connection connection = createConnection(scrollableCursorPropertyValue)) {
executeCreateTable(connection, "create table t1 (i int primary key, v varchar(10))");

try (PreparedStatement pstmt = connection.prepareStatement("insert into t1 values(?, ?)")) {
for (int i = 1; i <= 10; i++) {
pstmt.setInt(1, i);
pstmt.setString(2, i + " s");
pstmt.addBatch();
}
pstmt.executeBatch();
}
executeCreateTable(connection, CREATE_TABLE_STATEMENT);

try (Statement stmt = connection.createStatement(resultSetType, CONCUR_UPDATABLE);
ResultSet rs = stmt.executeQuery("select i, v from t1")) {
ResultSet rs = stmt.executeQuery(SELECT_TEST_TABLE)) {
rs.moveToInsertRow();
rs.updateNull(1);
rs.updateString(2, "11 s");
rs.updateString(2, "1 s");

assertNull(rs.getObject(1), "column 1");
assertTrue(rs.wasNull(), "column 1");
assertEquals("11 s", rs.getObject(2), "column 2");
assertEquals("1 s", rs.getObject(2), "column 2");
assertFalse(rs.wasNull(), "column 2");
}
}
Expand Down

0 comments on commit 8cd1f0f

Please sign in to comment.