Tidy up streams on close in stream manager
This commit is contained in:
@@ -125,6 +125,22 @@ public class SimpleStreamManagerTests extends TestCase {
|
||||
assertEquals(1, list.size());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for
|
||||
* {@link org.springframework.batch.item.stream.SimpleStreamManager#commit(org.springframework.transaction.TransactionStatus)}.
|
||||
*/
|
||||
public void testCloseUnregisters() {
|
||||
manager.register(new ItemStreamSupport() {
|
||||
public void open(ExecutionContext executionContext) throws StreamException {
|
||||
list.add("bar");
|
||||
}
|
||||
});
|
||||
manager.open(null);
|
||||
manager.close(null);
|
||||
manager.open(null);
|
||||
assertEquals(1, list.size());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test method for
|
||||
* {@link org.springframework.batch.item.stream.SimpleStreamManager#commit(org.springframework.transaction.TransactionStatus)}.
|
||||
|
||||
@@ -91,8 +91,8 @@ public class AsynchronousRepeatTests extends AbstractTradeBatchTests {
|
||||
// Shouldn't be necessary to wait:
|
||||
// Thread.sleep(500);
|
||||
assertEquals(NUMBER_OF_ITEMS, processor.count);
|
||||
// Because of the throttling and queing internally to a TaskExecutor,
|
||||
// more than one thread wil be used - the number used is (as of writing)
|
||||
// Because of the throttling and queueing internally to a TaskExecutor,
|
||||
// more than one thread will be used - the number used is (as of writing)
|
||||
// one less than the throttle limit of the template.
|
||||
// TODO: see if we can get it to use only one thread?
|
||||
assertTrue(threadNames.size() >= 1);
|
||||
|
||||
Reference in New Issue
Block a user