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-lang.git
The following commit(s) were added to refs/heads/master by this push:
new 3f8b07140 Whitespace
3f8b07140 is described below
commit 3f8b071404ad5b15c903d3570e058b11b9b5ce72
Author: Gary Gregory <[email protected]>
AuthorDate: Fri Mar 29 11:52:26 2024 -0400
Whitespace
---
.../java/org/apache/commons/lang3/StreamsTest.java | 33 ++++++++--------------
1 file changed, 11 insertions(+), 22 deletions(-)
diff --git a/src/test/java/org/apache/commons/lang3/StreamsTest.java
b/src/test/java/org/apache/commons/lang3/StreamsTest.java
index 8819a61a1..dd64e5571 100644
--- a/src/test/java/org/apache/commons/lang3/StreamsTest.java
+++ b/src/test/java/org/apache/commons/lang3/StreamsTest.java
@@ -57,14 +57,14 @@ public class StreamsTest extends AbstractLangTest {
if (i.intValue() == 5 && pThrowable != null) {
throw pThrowable;
}
- return i%2==0;
+ return i % 2 == 0;
};
}
private void assertEvenNumbers(final List<Integer> output) {
assertEquals(3, output.size());
- for (int i = 0; i < 3; i++) {
- assertEquals((i+1)*2, output.get(i).intValue());
+ for (int i = 0; i < 3; i++) {
+ assertEquals((i + 1) * 2, output.get(i).intValue());
}
}
@@ -76,9 +76,7 @@ public class StreamsTest extends AbstractLangTest {
.filter(asIntPredicate(null))
.collect(Collectors.toList());
assertEvenNumbers(output);
-
return Stream.of(
-
dynamicTest("IllegalArgumentException", () -> {
final IllegalArgumentException iae = new
IllegalArgumentException("Invalid argument: " + 5);
final Executable testMethod = () -> Functions.stream(input)
@@ -88,7 +86,6 @@ public class StreamsTest extends AbstractLangTest {
final IllegalArgumentException thrown =
assertThrows(IllegalArgumentException.class, testMethod);
assertThat(thrown.getMessage(), is(equalTo("Invalid
argument: " + 5)));
}),
-
dynamicTest("OutOfMemoryError", () -> {
final OutOfMemoryError oome = new OutOfMemoryError();
final Executable testMethod = () -> Functions.stream(input)
@@ -98,7 +95,6 @@ public class StreamsTest extends AbstractLangTest {
final OutOfMemoryError thrown =
assertThrows(OutOfMemoryError.class, testMethod);
assertThat(thrown.getMessage(), is(nullValue()));
}),
-
dynamicTest("SAXException", () -> {
final SAXException se = new SAXException();
final Executable testMethod = () -> Functions.stream(input)
@@ -117,29 +113,22 @@ public class StreamsTest extends AbstractLangTest {
@TestFactory
public Stream<DynamicTest> simpleStreamForEachFailing() {
final List<String> input = Arrays.asList("1", "2", "3", "4", "5", "6");
-
return Stream.of(
-
dynamicTest("IllegalArgumentException", () -> {
final IllegalArgumentException ise = new
IllegalArgumentException();
- final Executable testMethod = () -> Functions.stream(input)
- .forEach(asIntConsumer(ise));
+ final Executable testMethod = () ->
Functions.stream(input).forEach(asIntConsumer(ise));
final IllegalArgumentException thrown =
assertThrows(IllegalArgumentException.class, testMethod);
assertThat(thrown.getMessage(), is(nullValue()));
}),
-
dynamicTest("OutOfMemoryError", () -> {
final OutOfMemoryError oome = new OutOfMemoryError();
- final Executable oomeTestMethod = () ->
Functions.stream(input)
- .forEach(asIntConsumer(oome));
+ final Executable oomeTestMethod = () ->
Functions.stream(input).forEach(asIntConsumer(oome));
final OutOfMemoryError oomeThrown =
assertThrows(OutOfMemoryError.class, oomeTestMethod);
assertThat(oomeThrown.getMessage(), is(nullValue()));
}),
-
dynamicTest("SAXException", () -> {
final SAXException se = new SAXException();
- final Executable seTestMethod = () ->
Functions.stream(input)
- .forEach(asIntConsumer(se));
+ final Executable seTestMethod = () ->
Functions.stream(input).forEach(asIntConsumer(se));
final UndeclaredThrowableException seThrown =
assertThrows(UndeclaredThrowableException.class, seTestMethod);
assertAll(
() -> assertThat(seThrown.getMessage(),
is(nullValue())),
@@ -154,7 +143,7 @@ public class StreamsTest extends AbstractLangTest {
final List<String> input = Arrays.asList("1", "2", "3", "4", "5", "6");
final List<Integer> output = Functions.stream(input)
.map(Integer::valueOf)
- .filter(i -> (i.intValue() %2 == 0))
+ .filter(i -> (i.intValue() % 2 == 0))
.collect(Collectors.toList());
assertEvenNumbers(output);
}
@@ -165,8 +154,8 @@ public class StreamsTest extends AbstractLangTest {
final List<Integer> output = new ArrayList<>();
Functions.stream(input).forEach(s -> output.add(Integer.valueOf(s)));
assertEquals(6, output.size());
- for (int i = 0; i < 6; i++) {
- assertEquals(i+1, output.get(i).intValue());
+ for (int i = 0; i < 6; i++) {
+ assertEquals(i + 1, output.get(i).intValue());
}
}
@@ -175,8 +164,8 @@ public class StreamsTest extends AbstractLangTest {
final List<String> input = Arrays.asList("1", "2", "3", "4", "5", "6");
final List<Integer> output =
Functions.stream(input).map(Integer::valueOf).collect(Collectors.toList());
assertEquals(6, output.size());
- for (int i = 0; i < 6; i++) {
- assertEquals(i+1, output.get(i).intValue());
+ for (int i = 0; i < 6; i++) {
+ assertEquals(i + 1, output.get(i).intValue());
}
}