test/java/util/stream/bootlib/java/util/stream/IntStreamTestScenario.java
Print this page
rev 7630 : 8019395: Consolidate StreamSupport.{stream,parallelStream} into a single method
Reviewed-by: henryjen
rev 7633 : 8017513: Support for closeable streams
Reviewed-by:
Contributed-by: brian.goetz@oracle.com
*** 38,55 ****
* the same output (modulo allowable differences in ordering).
*/
@SuppressWarnings({"rawtypes", "unchecked"})
public enum IntStreamTestScenario implements OpTestCase.BaseStreamTestScenario {
! STREAM_FOR_EACH(false) {
<T, S_IN extends BaseStream<T, S_IN>>
void _run(TestData<T, S_IN> data, IntConsumer b, Function<S_IN, IntStream> m) {
IntStream s = m.apply(data.stream());
if (s.isParallel()) {
s = s.sequential();
}
s.forEach(b);
}
},
STREAM_TO_ARRAY(false) {
<T, S_IN extends BaseStream<T, S_IN>>
--- 38,56 ----
* the same output (modulo allowable differences in ordering).
*/
@SuppressWarnings({"rawtypes", "unchecked"})
public enum IntStreamTestScenario implements OpTestCase.BaseStreamTestScenario {
! STREAM_FOR_EACH_WITH_CLOSE(false) {
<T, S_IN extends BaseStream<T, S_IN>>
void _run(TestData<T, S_IN> data, IntConsumer b, Function<S_IN, IntStream> m) {
IntStream s = m.apply(data.stream());
if (s.isParallel()) {
s = s.sequential();
}
s.forEach(b);
+ s.close();
}
},
STREAM_TO_ARRAY(false) {
<T, S_IN extends BaseStream<T, S_IN>>