You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2025/05/06 17:34:43 UTC
(commons-io) 03/06: Add org.apache.commons.io.function.IOStreamTest.testAdaptAsParallel()
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 b75597ba800ae9ffcd2f00a95532c782646f0d72
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue May 6 10:27:57 2025 -0400
Add org.apache.commons.io.function.IOStreamTest.testAdaptAsParallel()
---
src/test/java/org/apache/commons/io/function/IOStreamTest.java | 8 ++++++++
1 file changed, 8 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 a36443717..1155e9341 100644
--- a/src/test/java/org/apache/commons/io/function/IOStreamTest.java
+++ b/src/test/java/org/apache/commons/io/function/IOStreamTest.java
@@ -72,6 +72,14 @@ public void testAdapt() {
assertEquals(1, IOStream.adapt(Stream.of("A")).count());
}
+ @SuppressWarnings("resource") // custom stream not recognized by compiler warning machinery
+ @Test
+ public void testAdaptAsParallel() {
+ assertEquals(0, IOStream.adapt((Stream<?>) null).parallel().count());
+ assertEquals(0, IOStream.adapt(Stream.empty()).parallel().count());
+ assertEquals(1, IOStream.adapt(Stream.of("A")).parallel().count());
+ }
+
@SuppressWarnings("resource") // custom stream not recognized by compiler warning machinery
@Test
public void testAllMatch() throws IOException {