Skip to content

Commit fad9d56

Browse files
committed
Fix whitespace across the project
1 parent 3fb8be6 commit fad9d56

File tree

19 files changed

+174
-174
lines changed

19 files changed

+174
-174
lines changed

documentation/src/test/java/example/ParameterizedTestDemo.java

Lines changed: 68 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,10 @@ void testWithMultiArgFieldSource(String str, int num, List<String> list) {
312312
// tag::CsvSource_example[]
313313
@ParameterizedTest
314314
@CsvSource({
315-
"apple, 1",
316-
"banana, 2",
315+
"apple, 1",
316+
"banana, 2",
317317
"'lemon, lime', 0xF1",
318-
"strawberry, 700_000"
318+
"strawberry, 700_000"
319319
})
320320
void testWithCsvSource(String fruit, int rank) {
321321
assertNotNull(fruit);
@@ -497,75 +497,77 @@ void testWithExplicitJavaTimeConverter(
497497
// @formatter:on
498498

499499
// @formatter:off
500-
// tag::ArgumentsAccessor_example[]
501-
@ParameterizedTest
502-
@CsvSource({
503-
"Jane, Doe, F, 1990-05-20",
504-
"John, Doe, M, 1990-10-22"
505-
})
506-
void testWithArgumentsAccessor(ArgumentsAccessor arguments) {
507-
Person person = new Person(arguments.getString(0),
508-
arguments.getString(1),
509-
arguments.get(2, Gender.class),
510-
arguments.get(3, LocalDate.class));
511-
512-
if (person.getFirstName().equals("Jane")) {
513-
assertEquals(Gender.F, person.getGender());
514-
}
515-
else {
516-
assertEquals(Gender.M, person.getGender());
517-
}
518-
assertEquals("Doe", person.getLastName());
519-
assertEquals(1990, person.getDateOfBirth().getYear());
520-
}
521-
// end::ArgumentsAccessor_example[]
500+
// tag::ArgumentsAccessor_example[]
501+
@ParameterizedTest
502+
@CsvSource({
503+
"Jane, Doe, F, 1990-05-20",
504+
"John, Doe, M, 1990-10-22"
505+
})
506+
void testWithArgumentsAccessor(ArgumentsAccessor arguments) {
507+
Person person = new Person(
508+
arguments.getString(0),
509+
arguments.getString(1),
510+
arguments.get(2, Gender.class),
511+
arguments.get(3, LocalDate.class));
512+
513+
if (person.getFirstName().equals("Jane")) {
514+
assertEquals(Gender.F, person.getGender());
515+
}
516+
else {
517+
assertEquals(Gender.M, person.getGender());
518+
}
519+
assertEquals("Doe", person.getLastName());
520+
assertEquals(1990, person.getDateOfBirth().getYear());
521+
}
522+
// end::ArgumentsAccessor_example[]
522523
// @formatter:on
523524

524525
// @formatter:off
525-
// tag::ArgumentsAggregator_example[]
526-
@ParameterizedTest
527-
@CsvSource({
528-
"Jane, Doe, F, 1990-05-20",
529-
"John, Doe, M, 1990-10-22"
530-
})
531-
void testWithArgumentsAggregator(@AggregateWith(PersonAggregator.class) Person person) {
532-
// perform assertions against person
533-
}
534-
535-
// end::ArgumentsAggregator_example[]
536-
static
537-
// tag::ArgumentsAggregator_example_PersonAggregator[]
538-
public class PersonAggregator implements ArgumentsAggregator {
539-
@Override
540-
public Person aggregateArguments(ArgumentsAccessor arguments, ParameterContext context) {
541-
return new Person(arguments.getString(0),
542-
arguments.getString(1),
543-
arguments.get(2, Gender.class),
544-
arguments.get(3, LocalDate.class));
545-
}
546-
}
547-
// end::ArgumentsAggregator_example_PersonAggregator[]
526+
// tag::ArgumentsAggregator_example[]
527+
@ParameterizedTest
528+
@CsvSource({
529+
"Jane, Doe, F, 1990-05-20",
530+
"John, Doe, M, 1990-10-22"
531+
})
532+
void testWithArgumentsAggregator(@AggregateWith(PersonAggregator.class) Person person) {
533+
// perform assertions against person
534+
}
535+
536+
// end::ArgumentsAggregator_example[]
537+
static
538+
// tag::ArgumentsAggregator_example_PersonAggregator[]
539+
public class PersonAggregator implements ArgumentsAggregator {
540+
@Override
541+
public Person aggregateArguments(ArgumentsAccessor arguments, ParameterContext context) {
542+
return new Person(
543+
arguments.getString(0),
544+
arguments.getString(1),
545+
arguments.get(2, Gender.class),
546+
arguments.get(3, LocalDate.class));
547+
}
548+
}
549+
// end::ArgumentsAggregator_example_PersonAggregator[]
548550
// @formatter:on
549551

550552
// @formatter:off
551-
// tag::ArgumentsAggregator_with_custom_annotation_example[]
552-
@ParameterizedTest
553-
@CsvSource({
554-
"Jane, Doe, F, 1990-05-20",
555-
"John, Doe, M, 1990-10-22"
556-
})
557-
void testWithCustomAggregatorAnnotation(@CsvToPerson Person person) {
558-
// perform assertions against person
559-
}
560-
// end::ArgumentsAggregator_with_custom_annotation_example[]
561-
562-
// tag::ArgumentsAggregator_with_custom_annotation_example_CsvToPerson[]
563-
@Retention(RetentionPolicy.RUNTIME)
564-
@Target(ElementType.PARAMETER)
565-
@AggregateWith(PersonAggregator.class)
566-
public @interface CsvToPerson {
567-
}
568-
// end::ArgumentsAggregator_with_custom_annotation_example_CsvToPerson[]
553+
// tag::ArgumentsAggregator_with_custom_annotation_example[]
554+
@ParameterizedTest
555+
@CsvSource({
556+
"Jane, Doe, F, 1990-05-20",
557+
"John, Doe, M, 1990-10-22"
558+
})
559+
void testWithCustomAggregatorAnnotation(@CsvToPerson Person person) {
560+
// perform assertions against person
561+
}
562+
// end::ArgumentsAggregator_with_custom_annotation_example[]
563+
564+
// tag::ArgumentsAggregator_with_custom_annotation_example_CsvToPerson[]
565+
@Retention(RetentionPolicy.RUNTIME)
566+
@Target(ElementType.PARAMETER)
567+
@AggregateWith(PersonAggregator.class)
568+
public @interface CsvToPerson {
569+
}
570+
// end::ArgumentsAggregator_with_custom_annotation_example_CsvToPerson[]
569571
// @formatter:on
570572

571573
// tag::custom_display_names[]

documentation/src/test/java/example/exception/MultipleHandlersTestCase.java

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -24,38 +24,38 @@
2424
@ExtendWith(ThirdExecutedHandler.class)
2525
class MultipleHandlersTestCase {
2626

27-
// Register handlers for @Test, @BeforeEach, @AfterEach only
28-
@ExtendWith(SecondExecutedHandler.class)
29-
@ExtendWith(FirstExecutedHandler.class)
30-
@Test
31-
void testMethod() {
32-
}
33-
34-
// end::user_guide[]
35-
36-
static class FirstExecutedHandler implements TestExecutionExceptionHandler {
37-
@Override
38-
public void handleTestExecutionException(ExtensionContext context, Throwable ex)
39-
throws Throwable {
40-
throw ex;
41-
}
42-
}
43-
44-
static class SecondExecutedHandler implements LifecycleMethodExecutionExceptionHandler {
45-
@Override
46-
public void handleBeforeEachMethodExecutionException(ExtensionContext context, Throwable ex)
47-
throws Throwable {
48-
throw ex;
49-
}
50-
}
51-
52-
static class ThirdExecutedHandler implements LifecycleMethodExecutionExceptionHandler {
53-
@Override
54-
public void handleBeforeAllMethodExecutionException(ExtensionContext context, Throwable ex)
55-
throws Throwable {
56-
throw ex;
57-
}
58-
}
27+
// Register handlers for @Test, @BeforeEach, @AfterEach only
28+
@ExtendWith(SecondExecutedHandler.class)
29+
@ExtendWith(FirstExecutedHandler.class)
30+
@Test
31+
void testMethod() {
32+
}
33+
34+
// end::user_guide[]
35+
36+
static class FirstExecutedHandler implements TestExecutionExceptionHandler {
37+
@Override
38+
public void handleTestExecutionException(ExtensionContext context, Throwable ex)
39+
throws Throwable {
40+
throw ex;
41+
}
42+
}
43+
44+
static class SecondExecutedHandler implements LifecycleMethodExecutionExceptionHandler {
45+
@Override
46+
public void handleBeforeEachMethodExecutionException(ExtensionContext context, Throwable ex)
47+
throws Throwable {
48+
throw ex;
49+
}
50+
}
51+
52+
static class ThirdExecutedHandler implements LifecycleMethodExecutionExceptionHandler {
53+
@Override
54+
public void handleBeforeAllMethodExecutionException(ExtensionContext context, Throwable ex)
55+
throws Throwable {
56+
throw ex;
57+
}
58+
}
5959
// tag::user_guide[]
6060
}
6161
// end::user_guide[]

documentation/src/test/java/example/exception/RecordStateOnErrorExtension.java

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -17,38 +17,37 @@
1717
// tag::user_guide[]
1818
class RecordStateOnErrorExtension implements LifecycleMethodExecutionExceptionHandler {
1919

20-
@Override
21-
public void handleBeforeAllMethodExecutionException(ExtensionContext context, Throwable ex)
22-
throws Throwable {
23-
memoryDumpForFurtherInvestigation("Failure recorded during class setup");
24-
throw ex;
25-
}
26-
27-
@Override
28-
public void handleBeforeEachMethodExecutionException(ExtensionContext context, Throwable ex)
29-
throws Throwable {
30-
memoryDumpForFurtherInvestigation("Failure recorded during test setup");
31-
throw ex;
32-
}
33-
34-
@Override
35-
public void handleAfterEachMethodExecutionException(ExtensionContext context, Throwable ex)
36-
throws Throwable {
37-
memoryDumpForFurtherInvestigation("Failure recorded during test cleanup");
38-
throw ex;
39-
}
40-
41-
@Override
42-
public void handleAfterAllMethodExecutionException(ExtensionContext context, Throwable ex)
43-
throws Throwable {
44-
memoryDumpForFurtherInvestigation("Failure recorded during class cleanup");
45-
throw ex;
46-
}
47-
// end::user_guide[]
48-
49-
private void memoryDumpForFurtherInvestigation(String error) {
50-
51-
}
20+
@Override
21+
public void handleBeforeAllMethodExecutionException(ExtensionContext context, Throwable ex)
22+
throws Throwable {
23+
memoryDumpForFurtherInvestigation("Failure recorded during class setup");
24+
throw ex;
25+
}
26+
27+
@Override
28+
public void handleBeforeEachMethodExecutionException(ExtensionContext context, Throwable ex)
29+
throws Throwable {
30+
memoryDumpForFurtherInvestigation("Failure recorded during test setup");
31+
throw ex;
32+
}
33+
34+
@Override
35+
public void handleAfterEachMethodExecutionException(ExtensionContext context, Throwable ex)
36+
throws Throwable {
37+
memoryDumpForFurtherInvestigation("Failure recorded during test cleanup");
38+
throw ex;
39+
}
40+
41+
@Override
42+
public void handleAfterAllMethodExecutionException(ExtensionContext context, Throwable ex)
43+
throws Throwable {
44+
memoryDumpForFurtherInvestigation("Failure recorded during class cleanup");
45+
throw ex;
46+
}
47+
// end::user_guide[]
48+
49+
private void memoryDumpForFurtherInvestigation(String error) {
50+
}
5251
// tag::user_guide[]
5352
}
5453
// end::user_guide[]

junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertionFailureBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public AssertionFailureBuilder actual(Object actual) {
115115
* failure message.
116116
*
117117
* @param includeValuesInMessage whether to include the actual and expected
118-
* values
118+
* values
119119
* @return this builder for method chaining
120120
*/
121121
public AssertionFailureBuilder includeValuesInMessage(boolean includeValuesInMessage) {

junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assertions.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,7 +1493,7 @@ public static void assertArrayEquals(Object[] expected, Object[] actual, Supplie
14931493
* iterators must return equal elements in the same order as each other. <strong>Note:</strong>
14941494
* this means that the iterables <em>do not</em> need to be of the same type. Example: <pre>{@code
14951495
* import static java.util.Arrays.asList;
1496-
* . . .
1496+
* ...
14971497
* Iterable<Integer> i0 = new ArrayList<>(asList(1, 2, 3));
14981498
* Iterable<Integer> i1 = new LinkedList<>(asList(1, 2, 3));
14991499
* assertIterableEquals(i0, i1); // Passes
@@ -1516,7 +1516,7 @@ public static void assertIterableEquals(Iterable<?> expected, Iterable<?> actual
15161516
* elements in the same order as each other. <strong>Note:</strong> this means that the iterables
15171517
* <em>do not</em> need to be of the same type. Example: <pre>{@code
15181518
* import static java.util.Arrays.asList;
1519-
* . . .
1519+
* ...
15201520
* Iterable<Integer> i0 = new ArrayList<>(asList(1, 2, 3));
15211521
* Iterable<Integer> i1 = new LinkedList<>(asList(1, 2, 3));
15221522
* assertIterableEquals(i0, i1); // Passes
@@ -1540,7 +1540,7 @@ public static void assertIterableEquals(Iterable<?> expected, Iterable<?> actual
15401540
* elements in the same order as each other. <strong>Note:</strong> this means that the iterables
15411541
* <em>do not</em> need to be of the same type. Example: <pre>{@code
15421542
* import static java.util.Arrays.asList;
1543-
* . . .
1543+
* ...
15441544
* Iterable<Integer> i0 = new ArrayList<>(asList(1, 2, 3));
15451545
* Iterable<Integer> i1 = new LinkedList<>(asList(1, 2, 3));
15461546
* assertIterableEquals(i0, i1); // Passes

junit-jupiter-api/src/main/java/org/junit/jupiter/api/TestReporter.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ default void publishEntry(String value) {
9393
* The file will be copied to the report output directory replacing any
9494
* potentially existing file with the same name.
9595
*
96-
* @param file the file to be attached; never {@code null} or blank
96+
* @param file the file to be attached; never {@code null} or blank
9797
* @param mediaType the media type of the file; never {@code null}; use
98-
* {@link MediaType#APPLICATION_OCTET_STREAM} if unknown
98+
* {@link MediaType#APPLICATION_OCTET_STREAM} if unknown
9999
* @since 5.12
100100
*/
101101
@API(status = EXPERIMENTAL, since = "5.12")
@@ -146,12 +146,11 @@ default void publishDirectory(Path directory) {
146146
* The {@link Path} passed to the supplied action will be relative to the
147147
* report output directory, but it's up to the action to write the file.
148148
*
149-
* @param name the name of the file to be attached; never {@code null}
150-
* or blank and must not contain any path separators
149+
* @param name the name of the file to be attached; never {@code null} or
150+
* blank and must not contain any path separators
151151
* @param mediaType the media type of the file; never {@code null}; use
152-
* {@link MediaType#APPLICATION_OCTET_STREAM} if unknown
153-
* @param action the action to be executed to write the file; never
154-
* {@code null}
152+
* {@link MediaType#APPLICATION_OCTET_STREAM} if unknown
153+
* @param action the action to be executed to write the file; never {@code null}
155154
* @since 5.12
156155
*/
157156
@API(status = EXPERIMENTAL, since = "5.12")
@@ -168,9 +167,8 @@ default void publishFile(String name, MediaType mediaType, ThrowingConsumer<Path
168167
* to the action to write files to it.
169168
*
170169
* @param name the name of the directory to be attached; never {@code null}
171-
* or blank and must not contain any path separators
172-
* @param action the action to be executed to write the file; never
173-
* {@code null}
170+
* or blank and must not contain any path separators
171+
* @param action the action to be executed to write the file; never {@code null}
174172
* @since 5.12
175173
*/
176174
@API(status = EXPERIMENTAL, since = "5.12")

junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ExtensionContext.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -374,11 +374,11 @@ default void publishReportEntry(String value) {
374374
* The file will be resolved in the report output directory prior to
375375
* invoking the supplied action.
376376
*
377-
* @param name the name of the file to be attached; never {@code null}
378-
* or blank and must not contain any path separators
377+
* @param name the name of the file to be attached; never {@code null} or
378+
* blank and must not contain any path separators
379379
* @param mediaType the media type of the file; never {@code null}; use
380-
* {@link MediaType#APPLICATION_OCTET_STREAM} if unknown
381-
* @param action the action to be executed to write the file; never {@code null}
380+
* {@link MediaType#APPLICATION_OCTET_STREAM} if unknown
381+
* @param action the action to be executed to write the file; never {@code null}
382382
* @since 5.12
383383
* @see org.junit.platform.engine.EngineExecutionListener#fileEntryPublished
384384
*/
@@ -392,8 +392,8 @@ default void publishReportEntry(String value) {
392392
* The directory will be resolved and created in the report output directory
393393
* prior to invoking the supplied action.
394394
*
395-
* @param name the name of the directory to be attached; never {@code null}
396-
* or blank and must not contain any path separators
395+
* @param name the name of the directory to be attached; never {@code null}
396+
* or blank and must not contain any path separators
397397
* @param action the action to be executed to write the file; never {@code null}
398398
* @since 5.12
399399
* @see org.junit.platform.engine.EngineExecutionListener#fileEntryPublished

0 commit comments

Comments
 (0)