Skip to content

Commit b0d9083

Browse files
committed
Format integration test projects with Spotless as well
1 parent c4ed325 commit b0d9083

File tree

20 files changed

+93
-63
lines changed

20 files changed

+93
-63
lines changed

platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,28 @@ import org.gradle.api.tasks.PathSensitivity.RELATIVE
22
import org.gradle.jvm.toolchain.internal.NoToolchainAvailableException
33

44
plugins {
5-
`java-library-conventions`
5+
`kotlin-library-conventions`
66
`testing-conventions`
77
}
88

99
javaLibrary {
1010
mainJavaVersion = JavaVersion.VERSION_11
1111
}
1212

13+
spotless {
14+
java {
15+
target(files(project.java.sourceSets.map { it.allJava }), "projects/**/*.java")
16+
}
17+
kotlin {
18+
target("projects/**/*.kt")
19+
}
20+
format("projects") {
21+
target("projects/**/*.gradle.kts", "projects/**/*.md")
22+
trimTrailingWhitespace()
23+
endWithNewline()
24+
}
25+
}
26+
1327
val thirdPartyJars by configurations.creating
1428
val antJars by configurations.creating
1529
val mavenDistribution by configurations.creating

platform-tooling-support-tests/projects/ant-starter/src/main/java/com/example/project/Calculator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2021 the original author or authors.
2+
* Copyright 2015-2023 the original author or authors.
33
*
44
* All rights reserved. This program and the accompanying materials are
55
* made available under the terms of the Eclipse Public License v2.0 which

platform-tooling-support-tests/projects/ant-starter/src/test/java/com/example/project/CalculatorTests.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2021 the original author or authors.
2+
* Copyright 2015-2023 the original author or authors.
33
*
44
* All rights reserved. This program and the accompanying materials are
55
* made available under the terms of the Eclipse Public License v2.0 which
@@ -27,15 +27,15 @@ void addsTwoNumbers() {
2727
}
2828

2929
@ParameterizedTest(name = "{0} + {1} = {2}")
30-
@CsvSource({
31-
"0, 1, 1",
32-
"1, 2, 3",
33-
"49, 51, 100",
34-
"1, 100, 101"
30+
@CsvSource({ //
31+
"0, 1, 1", //
32+
"1, 2, 3", //
33+
"49, 51, 100", //
34+
"1, 100, 101" //
3535
})
3636
void add(int first, int second, int expectedResult) {
3737
Calculator calculator = new Calculator();
3838
assertEquals(expectedResult, calculator.add(first, second),
39-
() -> first + " + " + second + " should equal " + expectedResult);
39+
() -> first + " + " + second + " should equal " + expectedResult);
4040
}
4141
}

platform-tooling-support-tests/projects/graalvm-starter/src/main/java/com/example/project/Calculator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2022 the original author or authors.
2+
* Copyright 2015-2023 the original author or authors.
33
*
44
* All rights reserved. This program and the accompanying materials are
55
* made available under the terms of the Eclipse Public License v2.0 which

platform-tooling-support-tests/projects/graalvm-starter/src/test/java/com/example/project/CalculatorTests.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2022 the original author or authors.
2+
* Copyright 2015-2023 the original author or authors.
33
*
44
* All rights reserved. This program and the accompanying materials are
55
* made available under the terms of the Eclipse Public License v2.0 which
@@ -27,15 +27,15 @@ void addsTwoNumbers() {
2727
}
2828

2929
@ParameterizedTest(name = "{0} + {1} = {2}")
30-
@CsvSource({
31-
"0, 1, 1",
32-
"1, 2, 3",
33-
"49, 51, 100",
34-
"1, 100, 101"
30+
@CsvSource({ //
31+
"0, 1, 1", //
32+
"1, 2, 3", //
33+
"49, 51, 100", //
34+
"1, 100, 101" //
3535
})
3636
void add(int first, int second, int expectedResult) {
3737
Calculator calculator = new Calculator();
3838
assertEquals(expectedResult, calculator.add(first, second),
39-
() -> first + " + " + second + " should equal " + expectedResult);
39+
() -> first + " + " + second + " should equal " + expectedResult);
4040
}
4141
}

platform-tooling-support-tests/projects/gradle-kotlin-extensions/src/test/kotlin/com/example/project/ExtensionFunctionsTests.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
/*
2-
* Copyright 2015-2021 the original author or authors.
2+
* Copyright 2015-2023 the original author or authors.
33
*
44
* All rights reserved. This program and the accompanying materials are
55
* made available under the terms of the Eclipse Public License v2.0 which
66
* accompanies this distribution and is available at
77
*
88
* https://www.eclipse.org/legal/epl-v20.html
99
*/
10-
1110
package com.example.project
1211

1312
import org.junit.jupiter.api.Assertions.assertEquals
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1+
12
/*
2-
* Copyright 2015-2021 the original author or authors.
3+
* Copyright 2015-2023 the original author or authors.
34
*
45
* All rights reserved. This program and the accompanying materials are
56
* made available under the terms of the Eclipse Public License v2.0 which
67
* accompanies this distribution and is available at
78
*
89
* https://www.eclipse.org/legal/epl-v20.html
910
*/
10-
1111
import static org.junit.jupiter.api.Assertions.fail;
1212

1313
import org.junit.jupiter.api.Assertions;
1414
import org.junit.jupiter.api.Test;
1515

1616
class FooTests {
1717

18-
@Test
19-
void test() {
20-
fail("This test must not be executed!");
21-
}
18+
@Test
19+
void test() {
20+
fail("This test must not be executed!");
21+
}
2222
}

platform-tooling-support-tests/projects/gradle-starter/src/main/java/com/example/project/Calculator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2021 the original author or authors.
2+
* Copyright 2015-2023 the original author or authors.
33
*
44
* All rights reserved. This program and the accompanying materials are
55
* made available under the terms of the Eclipse Public License v2.0 which

platform-tooling-support-tests/projects/gradle-starter/src/test/java/com/example/project/CalculatorTests.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2021 the original author or authors.
2+
* Copyright 2015-2023 the original author or authors.
33
*
44
* All rights reserved. This program and the accompanying materials are
55
* made available under the terms of the Eclipse Public License v2.0 which
@@ -27,15 +27,15 @@ void addsTwoNumbers() {
2727
}
2828

2929
@ParameterizedTest(name = "{0} + {1} = {2}")
30-
@CsvSource({
31-
"0, 1, 1",
32-
"1, 2, 3",
33-
"49, 51, 100",
34-
"1, 100, 101"
30+
@CsvSource({ //
31+
"0, 1, 1", //
32+
"1, 2, 3", //
33+
"49, 51, 100", //
34+
"1, 100, 101" //
3535
})
3636
void add(int first, int second, int expectedResult) {
3737
Calculator calculator = new Calculator();
3838
assertEquals(expectedResult, calculator.add(first, second),
39-
() -> first + " + " + second + " should equal " + expectedResult);
39+
() -> first + " + " + second + " should equal " + expectedResult);
4040
}
4141
}

platform-tooling-support-tests/projects/java-versions/src/test/java/JUnitPlatformCommonsTests.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
2+
/*
3+
* Copyright 2015-2023 the original author or authors.
4+
*
5+
* All rights reserved. This program and the accompanying materials are
6+
* made available under the terms of the Eclipse Public License v2.0 which
7+
* accompanies this distribution and is available at
8+
*
9+
* https://www.eclipse.org/legal/epl-v20.html
10+
*/
111
import static org.junit.jupiter.api.Assertions.assertEquals;
212
import static org.junit.jupiter.api.Assertions.assertFalse;
313
import static org.junit.jupiter.api.Assertions.assertTrue;

0 commit comments

Comments
 (0)