Skip to content

Commit cab2384

Browse files
committed
Enable tests for eclipse
1 parent 7577b5d commit cab2384

File tree

21 files changed

+78
-15
lines changed

21 files changed

+78
-15
lines changed

java-compiler-testing/src/it/avaje-http/src/test/java/io/github/ascopes/jct/acceptancetests/avajehttp/AvajeHttpTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import static io.github.ascopes.jct.assertions.JctAssertions.assertThatCompilation;
1919

2020
import io.github.ascopes.jct.compilers.JctCompiler;
21+
import io.github.ascopes.jct.junit.EcjCompilerTest;
2122
import io.github.ascopes.jct.junit.JavacCompilerTest;
2223
import io.github.ascopes.jct.workspaces.Workspaces;
2324
import org.junit.jupiter.api.DisplayName;
@@ -26,6 +27,7 @@
2627
class AvajeHttpTest {
2728

2829
@DisplayName("HTTP client code gets generated as expected")
30+
@EcjCompilerTest(minVersion = 11)
2931
@JavacCompilerTest(minVersion = 11)
3032
void httpClientCodeGetsGeneratedAsExpected(JctCompiler compiler) {
3133
// Given
@@ -40,7 +42,7 @@ void httpClientCodeGetsGeneratedAsExpected(JctCompiler compiler) {
4042

4143
// Then
4244
assertThatCompilation(compilation)
43-
.isSuccessfulWithoutWarnings()
45+
.isSuccessful()
4446
.classOutputPackages()
4547
.allFilesExist(
4648
"org/example/httpclient/GeneratedHttpComponent.class",

java-compiler-testing/src/it/avaje-inject/src/test/java/io/github/ascopes/jct/acceptancetests/avajeinject/AvajeInjectTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import static io.github.ascopes.jct.assertions.JctAssertions.assertThatCompilation;
1919

2020
import io.github.ascopes.jct.compilers.JctCompiler;
21+
import io.github.ascopes.jct.junit.EcjCompilerTest;
2122
import io.github.ascopes.jct.junit.JavacCompilerTest;
2223
import io.github.ascopes.jct.workspaces.PathStrategy;
2324
import io.github.ascopes.jct.workspaces.Workspaces;
@@ -27,6 +28,7 @@
2728
class AvajeInjectTest {
2829

2930
@DisplayName("Dependency injection code gets generated as expected")
31+
@EcjCompilerTest(minVersion = 11)
3032
@JavacCompilerTest(minVersion = 11)
3133
void dependencyInjectionCodeGetsGeneratedAsExpected(JctCompiler compiler) {
3234
// Given
@@ -41,7 +43,7 @@ void dependencyInjectionCodeGetsGeneratedAsExpected(JctCompiler compiler) {
4143

4244
// Then
4345
assertThatCompilation(compilation)
44-
.isSuccessfulWithoutWarnings()
46+
.isSuccessful()
4547
.classOutputPackages()
4648
.allFilesExist(
4749
"org/example/CoffeeMaker.class",

java-compiler-testing/src/it/avaje-jsonb/src/test/java/io/github/ascopes/jct/acceptancetests/avajejsonb/AvajeJsonbTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import io.avaje.jsonb.Jsonb;
2222
import io.avaje.jsonb.generator.Processor;
2323
import io.github.ascopes.jct.compilers.JctCompiler;
24+
import io.github.ascopes.jct.junit.EcjCompilerTest;
2425
import io.github.ascopes.jct.junit.JavacCompilerTest;
2526
import io.github.ascopes.jct.workspaces.Workspaces;
2627
import java.time.Instant;
@@ -30,6 +31,7 @@
3031
@DisplayName("Avaje Jsonb acceptance tests")
3132
class AvajeJsonbTest {
3233
@DisplayName("JSON handling logic is generated as expected")
34+
@EcjCompilerTest(minVersion = 11)
3335
@JavacCompilerTest(minVersion = 11)
3436
void jsonHandlingLogicIsGeneratedAsExpected(JctCompiler compiler) throws Throwable {
3537
// Given
@@ -46,7 +48,7 @@ void jsonHandlingLogicIsGeneratedAsExpected(JctCompiler compiler) throws Throwab
4648

4749
// Then
4850
assertThatCompilation(compilation)
49-
.isSuccessfulWithoutWarnings();
51+
.isSuccessful();
5052

5153
var userClass = compilation
5254
.getClassOutputs()

java-compiler-testing/src/it/dagger/src/test/java/io/github/ascopes/jct/acceptancetests/dagger/DaggerTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@
1818
import static io.github.ascopes.jct.assertions.JctAssertions.assertThatCompilation;
1919

2020
import io.github.ascopes.jct.compilers.JctCompiler;
21+
import io.github.ascopes.jct.junit.EcjCompilerTest;
2122
import io.github.ascopes.jct.junit.JavacCompilerTest;
2223
import io.github.ascopes.jct.workspaces.Workspaces;
2324
import org.junit.jupiter.api.DisplayName;
2425

2526
@DisplayName("Dagger acceptance tests")
2627
class DaggerTest {
2728
@DisplayName("Dagger DI runs as expected in the annotation processing phase")
29+
@EcjCompilerTest
2830
@JavacCompilerTest
2931
void daggerDiRunsAsExpectedInTheAnnotationProcessingPhase(JctCompiler compiler) {
3032
try (var workspace = Workspaces.newWorkspace()) {
@@ -38,7 +40,7 @@ void daggerDiRunsAsExpectedInTheAnnotationProcessingPhase(JctCompiler compiler)
3840
var compilation = compiler.compile(workspace);
3941

4042
// Then
41-
assertThatCompilation(compilation).isSuccessfulWithoutWarnings();
43+
assertThatCompilation(compilation).isSuccessful();
4244

4345
assertThatCompilation(compilation)
4446
.sourceOutputPackages()

java-compiler-testing/src/it/dogfood/src/test/java/io/github/ascopes/jct/acceptancetests/dogfood/JctDogfoodTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import static io.github.ascopes.jct.assertions.JctAssertions.assertThat;
1919

2020
import io.github.ascopes.jct.compilers.JctCompiler;
21+
import io.github.ascopes.jct.junit.EcjCompilerTest;
2122
import io.github.ascopes.jct.junit.JavacCompilerTest;
2223
import io.github.ascopes.jct.workspaces.Workspaces;
2324
import java.io.IOException;
@@ -52,6 +53,7 @@ class JctDogfoodTest {
5253
.resolve("classes");
5354

5455
@DisplayName("JCT can compile itself as a legacy module source")
56+
@EcjCompilerTest(minVersion = 17, configurers = JctCompilationConfigurer.class)
5557
@JavacCompilerTest(minVersion = 17, configurers = JctCompilationConfigurer.class)
5658
void jctCanCompileItselfAsLegacyModule(JctCompiler compiler) throws IOException {
5759
// Given

java-compiler-testing/src/it/google-auto-factory/src/test/java/io/github/ascopes/jct/acceptancetests/autofactory/AutoFactoryTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import static org.assertj.core.api.SoftAssertions.assertSoftly;
2020

2121
import io.github.ascopes.jct.compilers.JctCompiler;
22+
import io.github.ascopes.jct.junit.EcjCompilerTest;
2223
import io.github.ascopes.jct.junit.JavacCompilerTest;
2324
import io.github.ascopes.jct.workspaces.Workspaces;
2425
import java.time.Instant;
@@ -28,6 +29,7 @@
2829
class AutoFactoryTest {
2930

3031
@DisplayName("The AutoFactory class is created as expected")
32+
@EcjCompilerTest
3133
@JavacCompilerTest
3234
void autoFactoryClassIsCreatedAsExpected(JctCompiler compiler) throws Throwable {
3335
try (var workspace = Workspaces.newWorkspace()) {
@@ -42,7 +44,7 @@ void autoFactoryClassIsCreatedAsExpected(JctCompiler compiler) throws Throwable
4244

4345
// Then
4446
assertThatCompilation(compilation)
45-
.isSuccessfulWithoutWarnings()
47+
.isSuccessful()
4648
.classOutputPackages()
4749
.fileExists("org", "example", "UserFactory.class")
4850
.isNotEmptyFile();

java-compiler-testing/src/it/google-auto-service/src/test/java/io/github/ascopes/jct/acceptancetests/autoservice/AutoServiceTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import static io.github.ascopes.jct.assertions.JctAssertions.assertThatCompilation;
1919

2020
import io.github.ascopes.jct.compilers.JctCompiler;
21+
import io.github.ascopes.jct.junit.EcjCompilerTest;
2122
import io.github.ascopes.jct.junit.JavacCompilerTest;
2223
import io.github.ascopes.jct.workspaces.Workspaces;
2324
import org.junit.jupiter.api.DisplayName;
@@ -26,6 +27,7 @@
2627
class AutoServiceTest {
2728

2829
@DisplayName("The AutoService descriptor is created as expected")
30+
@EcjCompilerTest
2931
@JavacCompilerTest
3032
void autoServiceDescriptorIsCreatedAsExpected(JctCompiler compiler) {
3133
try (var workspace = Workspaces.newWorkspace()) {
@@ -40,7 +42,7 @@ void autoServiceDescriptorIsCreatedAsExpected(JctCompiler compiler) {
4042

4143
// Then
4244
assertThatCompilation(compilation)
43-
.isSuccessfulWithoutWarnings()
45+
.isSuccessful()
4446
.classOutputPackages()
4547
.fileExists("META-INF", "services", "org.example.SomeInterface")
4648
.hasContent("org.example.SomeImpl");

java-compiler-testing/src/it/google-auto-value/src/test/java/io/github/ascopes/jct/acceptancetests/autovalue/AutoValueTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import static org.assertj.core.api.SoftAssertions.assertSoftly;
2020

2121
import io.github.ascopes.jct.compilers.JctCompiler;
22+
import io.github.ascopes.jct.junit.EcjCompilerTest;
2223
import io.github.ascopes.jct.junit.JavacCompilerTest;
2324
import io.github.ascopes.jct.workspaces.Workspaces;
2425
import java.time.Instant;
@@ -29,6 +30,7 @@
2930
class AutoValueTest {
3031

3132
@DisplayName("The AutoValue implementation class is created as expected")
33+
@EcjCompilerTest
3234
@JavacCompilerTest
3335
void autoValueImplementationClassIsCreatedAsExpected(JctCompiler compiler) throws Throwable {
3436
try (var workspace = Workspaces.newWorkspace()) {
@@ -43,7 +45,7 @@ void autoValueImplementationClassIsCreatedAsExpected(JctCompiler compiler) throw
4345

4446
// Then
4547
assertThatCompilation(compilation)
46-
.isSuccessfulWithoutWarnings()
48+
.isSuccessful()
4749
.classOutputPackages()
4850
.allFilesExist(
4951
"org/example/AutoValue_User.class",

java-compiler-testing/src/it/immutables/src/test/java/io/github/ascopes/jct/acceptancetests/immutables/ImmutablesTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import static org.assertj.core.api.SoftAssertions.assertSoftly;
2020

2121
import io.github.ascopes.jct.compilers.JctCompiler;
22+
import io.github.ascopes.jct.junit.EcjCompilerTest;
2223
import io.github.ascopes.jct.junit.JavacCompilerTest;
2324
import io.github.ascopes.jct.workspaces.Workspaces;
2425
import java.util.stream.Stream;
@@ -36,6 +37,7 @@
3637
class ImmutablesTest {
3738

3839
@DisplayName("Immutables @Value produces the expected class")
40+
@EcjCompilerTest
3941
@JavacCompilerTest
4042
void immutablesValueProducesTheExpectedClass(JctCompiler compiler) throws Throwable {
4143
try (var workspace = Workspaces.newWorkspace()) {
@@ -68,6 +70,7 @@ void immutablesValueProducesTheExpectedClass(JctCompiler compiler) throws Throwa
6870
}
6971

7072
@DisplayName("Immutables @Value produces the expected class for modules")
73+
@EcjCompilerTest(minVersion = 9)
7174
@JavacCompilerTest(minVersion = 9)
7275
void immutablesValueProducesTheExpectedClassForModules(JctCompiler compiler) throws Throwable {
7376
try (var workspace = Workspaces.newWorkspace()) {

java-compiler-testing/src/it/mapstruct/src/test/java/io/github/ascopes/jct/acceptancetests/mapstruct/MapStructTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import static org.assertj.core.api.SoftAssertions.assertSoftly;
2020

2121
import io.github.ascopes.jct.compilers.JctCompiler;
22+
import io.github.ascopes.jct.junit.EcjCompilerTest;
2223
import io.github.ascopes.jct.junit.JavacCompilerTest;
2324
import io.github.ascopes.jct.workspaces.Workspaces;
2425
import java.util.stream.Stream;
@@ -28,6 +29,7 @@
2829
class MapStructTest {
2930

3031
@DisplayName("MapStruct generates expected mapping code")
32+
@EcjCompilerTest
3133
@JavacCompilerTest
3234
void mapStructGeneratesExpectedMappingCode(JctCompiler compiler) throws Throwable {
3335
try (final var workspace = Workspaces.newWorkspace()) {
@@ -40,7 +42,7 @@ void mapStructGeneratesExpectedMappingCode(JctCompiler compiler) throws Throwabl
4042
final var compilation = compiler.compile(workspace);
4143

4244
// Then
43-
assertThatCompilation(compilation).isSuccessfulWithoutWarnings();
45+
assertThatCompilation(compilation).isSuccessful();
4446

4547
final var classLoader = compilation.getFileManager()
4648
.getClassLoader(StandardLocation.CLASS_OUTPUT);
@@ -68,6 +70,7 @@ void mapStructGeneratesExpectedMappingCode(JctCompiler compiler) throws Throwabl
6870
}
6971

7072
@DisplayName("MapStruct generates expected mapping code for modules")
73+
@EcjCompilerTest(minVersion = 9)
7174
@JavacCompilerTest(minVersion = 9)
7275
void mapStructGeneratesExpectedMappingCodeForModules(JctCompiler compiler) throws Throwable {
7376
try (final var workspace = Workspaces.newWorkspace()) {
@@ -80,7 +83,7 @@ void mapStructGeneratesExpectedMappingCodeForModules(JctCompiler compiler) throw
8083
final var compilation = compiler.compile(workspace);
8184

8285
// Then
83-
assertThatCompilation(compilation).isSuccessfulWithoutWarnings();
86+
assertThatCompilation(compilation).isSuccessful();
8487

8588
final var classLoader = compilation.getFileManager()
8689
.getClassLoader(StandardLocation.CLASS_OUTPUT);

0 commit comments

Comments
 (0)