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

+15-1
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

+1-1
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

+7-7
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

+1-1
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

+7-7
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

+1-2
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
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

+1-1
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

+7-7
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

+10
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;

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

+1-1
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/maven-starter/src/test/java/com/example/project/CalculatorTests.java

+7-7
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/maven-surefire-compatibility/src/test/java/com/example/project/DummyTests.java

+1-1
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/multi-release-jar/default/src/test/java/integration/integration/JupiterIntegrationTests.java

+3-5
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
@@ -42,10 +42,8 @@ void moduleIsNamed() {
4242
@Test
4343
void resolve() {
4444
var selector = DiscoverySelectors.selectClass(getClass());
45-
var testPlan = LauncherFactory.create().discover(request()
46-
.selectors(selector)
47-
.filters(includeEngines("junit-jupiter"))
48-
.build());
45+
var testPlan = LauncherFactory.create().discover(
46+
request().selectors(selector).filters(includeEngines("junit-jupiter")).build());
4947

5048
var engine = testPlan.getRoots().iterator().next();
5149

platform-tooling-support-tests/projects/multi-release-jar/default/src/test/java/integration/integration/ModuleUtilsTests.java

+2-2
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
@@ -19,9 +19,9 @@
1919
import java.util.Set;
2020

2121
import org.junit.jupiter.api.Test;
22+
import org.junit.platform.commons.PreconditionViolationException;
2223
import org.junit.platform.commons.util.ClassFilter;
2324
import org.junit.platform.commons.util.ModuleUtils;
24-
import org.junit.platform.commons.PreconditionViolationException;
2525

2626
/**
2727
* Unit tests for {@link ModuleUtils}.

platform-tooling-support-tests/projects/standalone/src/standalone/JupiterIntegration.java

+1-1
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/standalone/src/standalone/JupiterParamsIntegration.java

+1-1
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/standalone/src/standalone/SuiteIntegration.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 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/standalone/src/standalone/VintageIntegration.java

+1-1
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
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
11
/*
2-
* This Java source file was generated by the Gradle 'init' task.
2+
* Copyright 2015-2023 the original author or authors.
3+
*
4+
* All rights reserved. This program and the accompanying materials are
5+
* made available under the terms of the Eclipse Public License v2.0 which
6+
* accompanies this distribution and is available at
7+
*
8+
* https://www.eclipse.org/legal/epl-v20.html
39
*/
10+
411
package com.example.vintage;
512

6-
import org.junit.Test;
713
import static org.junit.Assert.*;
814

15+
import org.junit.Test;
16+
917
public class VintageTest {
10-
@Test
11-
public void success() {
12-
// pass
13-
}
14-
@Test
15-
public void failure() {
16-
fail("expected to fail");
17-
}
18+
@Test
19+
public void success() {
20+
// pass
21+
}
22+
23+
@Test
24+
public void failure() {
25+
fail("expected to fail");
26+
}
1827
}

0 commit comments

Comments
 (0)