public void close() { closed = true; final Cursor cursor = this.cursor; if (cursor != null) { this.cursor = null; cursor.close(); } statement.onResultSetClose(this); }
public void close() { closed = true; final Cursor cursor = this.cursor; if (cursor != null) { this.cursor = null; cursor.close(); } statement.onResultSetClose(this); }
public void close() { closed = true; final Cursor cursor = this.cursor; if (cursor != null) { this.cursor = null; cursor.close(); } statement.onResultSetClose(this); // TODO: for timeout, see IteratorResultSet.close /* if (timeoutCursor != null) { final long noTimeout = 0; timeoutCursor.close(noTimeout); timeoutCursor = null; } */ }
@Test public void testGetMoreResults() throws SQLException { AvaticaResultSet resultSet = mock(AvaticaResultSet.class); statement.openResultSet = resultSet; doCallRealMethod().when(statement).onResultSetClose(any(ResultSet.class)); when(statement.getMoreResults()).thenCallRealMethod(); when(statement.getMoreResults(anyInt())).thenCallRealMethod(); assertFalse(statement.getMoreResults()); verify(resultSet).close(); } }
@Test public void testGetMoreResults() throws SQLException { AvaticaResultSet resultSet = mock(AvaticaResultSet.class); statement.openResultSet = resultSet; doCallRealMethod().when(statement).onResultSetClose(any(ResultSet.class)); when(statement.getMoreResults()).thenCallRealMethod(); when(statement.getMoreResults(anyInt())).thenCallRealMethod(); assertFalse(statement.getMoreResults()); verify(resultSet).close(); } }