Github user afs commented on a diff in the pull request:
https://github.com/apache/jena/pull/244#discussion_r112720371
--- Diff:
jena-arq/src/test/java/org/apache/jena/sparql/engine/iterator/TestQueryIterSort.java
---
@@ -135,6 +133,37 @@ public void testCleanAfterClose()
assertEquals(0, DataBagExaminer.countTemporaryFiles(qIter.db)) ;
}
+ @Test public void testCloseClosesSourceIterator() {
+ Context context = new Context() ;
+ ExecutionContext ec = new ExecutionContext(context, (Graph) null,
(DatasetGraph) null, (OpExecutorFactory) null);
+ QueryIterSort qis = new QueryIterSort(iterator, comparator, ec);
+ qis.close();
+ assertTrue("source iterator should have been closed",
iterator.isClosed());
+ }
+
+ @Test public void testExhaustionClosesSourceIterator() {
+ iterator.setCallback(new Callback()
--- End diff --
This can be written as `iterator.setCallback(()->{});`
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---