mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-08-04 01:58:16 +00:00
Fix test to use lighter query
This commit is contained in:
parent
a82c459ed0
commit
b17511b559
3 changed files with 4 additions and 8 deletions
|
@ -21,7 +21,7 @@ class LimboStatementTest {
|
|||
|
||||
@Test
|
||||
void closing_statement_closes_related_resources() throws Exception {
|
||||
LimboStatement stmt = connection.prepare("SELECT 1");
|
||||
LimboStatement stmt = connection.prepare("SELECT 1;");
|
||||
stmt.execute();
|
||||
|
||||
stmt.close();
|
||||
|
|
|
@ -62,9 +62,7 @@ class JDBC4ResultSetTest {
|
|||
|
||||
@Test
|
||||
void close_resultSet_test() throws Exception {
|
||||
stmt.executeUpdate("CREATE TABLE users (id INT PRIMARY KEY, username TEXT);");
|
||||
stmt.executeUpdate("INSERT INTO users VALUES (2, 'seonwoo');");
|
||||
stmt.executeQuery("SELECT * FROM users");
|
||||
stmt.executeQuery("SELECT 1;");
|
||||
ResultSet resultSet = stmt.getResultSet();
|
||||
|
||||
assertFalse(resultSet.isClosed());
|
||||
|
@ -74,9 +72,7 @@ class JDBC4ResultSetTest {
|
|||
|
||||
@Test
|
||||
void calling_methods_on_closed_resultSet_should_throw_exception() throws Exception {
|
||||
stmt.executeUpdate("CREATE TABLE users (id INT PRIMARY KEY, username TEXT);");
|
||||
stmt.executeUpdate("INSERT INTO users VALUES (2, 'seonwoo');");
|
||||
stmt.executeQuery("SELECT * FROM users");
|
||||
stmt.executeQuery("SELECT 1;");
|
||||
ResultSet resultSet = stmt.getResultSet();
|
||||
resultSet.close();
|
||||
assertTrue(resultSet.isClosed());
|
||||
|
|
|
@ -68,6 +68,6 @@ class JDBC4StatementTest {
|
|||
@Test
|
||||
void operations_on_closed_statement_should_throw_exception() throws Exception {
|
||||
stmt.close();
|
||||
assertThrows(SQLException.class, () -> stmt.execute("SELECT 1"));
|
||||
assertThrows(SQLException.class, () -> stmt.execute("SELECT 1;"));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue