This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-io.git

commit 0bd8d290ac180349369261d5acc8becb556fe823
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Tue May 6 10:25:42 2025 -0400

    Add 
org.apache.commons.io.function.IOStreamTest.testForEachOrderedAsParallel()
---
 .../java/org/apache/commons/io/function/IOStreamTest.java | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/test/java/org/apache/commons/io/function/IOStreamTest.java 
b/src/test/java/org/apache/commons/io/function/IOStreamTest.java
index 71f5182e5..12e5c5779 100644
--- a/src/test/java/org/apache/commons/io/function/IOStreamTest.java
+++ b/src/test/java/org/apache/commons/io/function/IOStreamTest.java
@@ -285,6 +285,21 @@ public void testForEachOrdered() throws IOException {
         assertEquals("AB", sb.toString());
     }
 
+    @SuppressWarnings("resource") // custom stream not recognized by compiler 
warning machinery
+    @Test
+    public void testForEachOrderedAsParallel() throws IOException {
+        // compile vs type
+        assertThrows(IOException.class, () -> 
IOStream.of("A").parallel().forEach(TestUtils.throwingIOConsumer()));
+        // compile vs inline
+        assertThrows(IOException.class, () -> 
IOStream.of("A").parallel().forEach(e -> {
+            throw new IOException("Failure");
+        }));
+        assertThrows(IOException.class, () -> IOStream.of("A", 
"B").parallel().forEach(TestUtils.throwingIOConsumer()));
+        final StringBuilder sb = new StringBuilder();
+        IOStream.of("A", "B").parallel().forEachOrdered(sb::append);
+        assertEquals("AB", sb.toString());
+    }
+
     @SuppressWarnings("resource") // custom stream not recognized by compiler 
warning machinery
     @Test
     public void testIsParallel() {

Reply via email to