aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/apache/commons
diff options
context:
space:
mode:
authorGary Gregory <garydgregory@gmail.com>2024-03-29 11:52:26 -0400
committerGary Gregory <garydgregory@gmail.com>2024-03-29 11:52:26 -0400
commit3f8b071404ad5b15c903d3570e058b11b9b5ce72 (patch)
treef7dc38a1ed1d5f011ccbeb6867aeb356e3547b5b /src/test/java/org/apache/commons
parentb9c7da0a8ccff15ef78f906c11590d9e983fcbd6 (diff)
downloadapache-commons-lang-3f8b071404ad5b15c903d3570e058b11b9b5ce72.tar.gz
Whitespace
Diffstat (limited to 'src/test/java/org/apache/commons')
-rw-r--r--src/test/java/org/apache/commons/lang3/StreamsTest.java33
1 files 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());
}
}