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:40 UTC
(commons-io) branch master updated (2094aed41 -> e28f97685)
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-io.git
from 2094aed41 Reduce vertical whitespace
new 0bd8d290a Add org.apache.commons.io.function.IOStreamTest.testForEachOrderedAsParallel()
new 82393b181 Add to org.apache.commons.io.function.IOStreamTest.testIsParallel()
new b75597ba8 Add org.apache.commons.io.function.IOStreamTest.testAdaptAsParallel()
new 99ae92c00 Add org.apache.commons.io.function.IOStreamTest.testAdaptParallelAndCount()
new 9f5d73aaa Add org.apache.commons.io.function.IOStreamTest.testForEachOrderedAdaptParallel()
new e28f97685 Merge branch 'master' of https://gitbox.apache.org/repos/asf/commons-io.git
The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../apache/commons/io/function/IOStreamTest.java | 50 ++++++++++++++++++++++
1 file changed, 50 insertions(+)
(commons-io) 01/06: Add org.apache.commons.io.function.IOStreamTest.testForEachOrderedAsParallel()
Posted by gg...@apache.org.
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 <ga...@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() {
(commons-io) 04/06: Add org.apache.commons.io.function.IOStreamTest.testAdaptParallelAndCount()
Posted by gg...@apache.org.
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 99ae92c0070435be5f87791bd03b1aa5876a92a6
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue May 6 10:32:40 2025 -0400
Add org.apache.commons.io.function.IOStreamTest.testAdaptParallelAndCount()
---
.../java/org/apache/commons/io/function/IOStreamTest.java | 11 +++++++++++
1 file changed, 11 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 1155e9341..f55d673da 100644
--- a/src/test/java/org/apache/commons/io/function/IOStreamTest.java
+++ b/src/test/java/org/apache/commons/io/function/IOStreamTest.java
@@ -80,6 +80,17 @@ public void testAdaptAsParallel() {
assertEquals(1, IOStream.adapt(Stream.of("A")).parallel().count());
}
+ @SuppressWarnings("resource") // custom stream not recognized by compiler warning machinery
+ @Test
+ public void testAdaptParallelAndCount() {
+ final IOStream<Object> adaptedObj = IOStream.adapt(Stream.empty().parallel());
+ assertTrue(adaptedObj.isParallel());
+ assertEquals(0, adaptedObj.count());
+ final IOStream<String> adaptedStr = IOStream.adapt(Stream.of("A").parallel());
+ assertTrue(adaptedObj.isParallel());
+ assertEquals(1, adaptedStr.count());
+ }
+
@SuppressWarnings("resource") // custom stream not recognized by compiler warning machinery
@Test
public void testAllMatch() throws IOException {
(commons-io) 05/06: Add org.apache.commons.io.function.IOStreamTest.testForEachOrderedAdaptParallel()
Posted by gg...@apache.org.
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 9f5d73aaa4964a308a39bc41da3e98753594178e
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue May 6 10:36:06 2025 -0400
Add org.apache.commons.io.function.IOStreamTest.testForEachOrderedAdaptParallel()
---
.../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 f55d673da..8e2b2982e 100644
--- a/src/test/java/org/apache/commons/io/function/IOStreamTest.java
+++ b/src/test/java/org/apache/commons/io/function/IOStreamTest.java
@@ -304,6 +304,21 @@ public void testForEachOrdered() throws IOException {
assertEquals("AB", sb.toString());
}
+ @SuppressWarnings("resource") // custom stream not recognized by compiler warning machinery
+ @Test
+ public void testForEachOrderedAdaptParallel() throws IOException {
+ // compile vs type
+ assertThrows(IOException.class, () -> IOStream.adapt(Stream.of("A").parallel()).forEach(TestUtils.throwingIOConsumer()));
+ // compile vs inline
+ assertThrows(IOException.class, () -> IOStream.adapt(Stream.of("A").parallel()).forEach(e -> {
+ throw new IOException("Failure");
+ }));
+ assertThrows(IOException.class, () -> IOStream.adapt(Stream.of("A", "B").parallel()).forEach(TestUtils.throwingIOConsumer()));
+ final StringBuilder sb = new StringBuilder();
+ IOStream.adapt(Stream.of("A", "B").parallel()).forEachOrdered(sb::append);
+ assertEquals("AB", sb.toString());
+ }
+
@SuppressWarnings("resource") // custom stream not recognized by compiler warning machinery
@Test
public void testForEachOrderedAsParallel() throws IOException {
(commons-io) 02/06: Add to org.apache.commons.io.function.IOStreamTest.testIsParallel()
Posted by gg...@apache.org.
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 82393b18150c8521b43c52267a3cc7f8487181f2
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue May 6 10:26:38 2025 -0400
Add to org.apache.commons.io.function.IOStreamTest.testIsParallel()
---
src/test/java/org/apache/commons/io/function/IOStreamTest.java | 1 +
1 file changed, 1 insertion(+)
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 12e5c5779..a36443717 100644
--- a/src/test/java/org/apache/commons/io/function/IOStreamTest.java
+++ b/src/test/java/org/apache/commons/io/function/IOStreamTest.java
@@ -304,6 +304,7 @@ public void testForEachOrderedAsParallel() throws IOException {
@Test
public void testIsParallel() {
assertFalse(IOStream.of("A", "B").isParallel());
+ assertTrue(IOStream.of("A", "B").parallel().isParallel());
}
@SuppressWarnings("resource") // custom stream not recognized by compiler warning machinery
(commons-io) 03/06: Add org.apache.commons.io.function.IOStreamTest.testAdaptAsParallel()
Posted by gg...@apache.org.
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 {
(commons-io) 06/06: Merge branch 'master' of https://gitbox.apache.org/repos/asf/commons-io.git
Posted by gg...@apache.org.
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 e28f97685236891636342d386b63b7dd116fe846
Merge: 9f5d73aaa 2094aed41
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue May 6 13:34:06 2025 -0400
Merge branch 'master' of https://gitbox.apache.org/repos/asf/commons-io.git
.../java/org/apache/commons/io/FileUtilsTest.java | 286 +++++++--------------
1 file changed, 88 insertions(+), 198 deletions(-)