From 794f7acd1213e685b707b40041594fe6a217d22c Mon Sep 17 00:00:00 2001 From: Ladislav Thon Date: Tue, 3 Dec 2024 15:34:25 +0100 Subject: [PATCH 1/3] Tests: rename the "kotlin" integration tests module to "kotlin-maven-invoker" This is because these tests use the Maven invoker. --- .../{kotlin => kotlin-maven-invoker}/disable-native-profile | 0 integration-tests/{kotlin => kotlin-maven-invoker}/pom.xml | 5 +++-- .../quarkus/kotlin/maven/it/KotlinCreateMavenProjectIT.java | 0 .../java/io/quarkus/kotlin/maven/it/KotlinDevModeIT.java | 0 .../io/quarkus/kotlin/maven/it/KotlinRemoteDevModeIT.java | 0 .../src/test/resources/projects/classic-kotlin/pom.xml | 0 .../src/main/kotlin/org/acme/GreetingService.kt | 0 .../classic-kotlin/src/main/kotlin/org/acme/HelloResource.kt | 0 .../classic-kotlin/src/main/kotlin/org/acme/MyApplication.kt | 0 .../src/main/resources/META-INF/resources/index.html | 0 .../classic-kotlin/src/main/resources/application.properties | 0 .../src/test/kotlin/org/acme/HelloResourceTest.kt | 0 .../projects/external-reloadable-artifacts/app/pom.xml | 0 .../app/src/main/kotlin/org/acme/GreetingResource.kt | 0 .../app/src/main/resources/application.properties | 0 .../external-reloadable-artifacts/external-lib/pom.xml | 0 .../external-lib/src/main/kotlin/org/acme/lib/Greeting.kt | 0 .../src/test/resources/projects/kotlin-compiler-args/pom.xml | 0 .../src/main/kotlin/org/acme/GraphQLResource.kt | 0 .../src/main/kotlin/org/acme/HelloResource.kt | 0 .../src/main/resources/META-INF/resources/index.html | 0 .../src/main/resources/application.properties | 0 integration-tests/pom.xml | 2 +- 23 files changed, 4 insertions(+), 3 deletions(-) rename integration-tests/{kotlin => kotlin-maven-invoker}/disable-native-profile (100%) rename integration-tests/{kotlin => kotlin-maven-invoker}/pom.xml (95%) rename integration-tests/{kotlin => kotlin-maven-invoker}/src/test/java/io/quarkus/kotlin/maven/it/KotlinCreateMavenProjectIT.java (100%) rename integration-tests/{kotlin => kotlin-maven-invoker}/src/test/java/io/quarkus/kotlin/maven/it/KotlinDevModeIT.java (100%) rename integration-tests/{kotlin => kotlin-maven-invoker}/src/test/java/io/quarkus/kotlin/maven/it/KotlinRemoteDevModeIT.java (100%) rename integration-tests/{kotlin => kotlin-maven-invoker}/src/test/resources/projects/classic-kotlin/pom.xml (100%) rename integration-tests/{kotlin => kotlin-maven-invoker}/src/test/resources/projects/classic-kotlin/src/main/kotlin/org/acme/GreetingService.kt (100%) rename integration-tests/{kotlin => kotlin-maven-invoker}/src/test/resources/projects/classic-kotlin/src/main/kotlin/org/acme/HelloResource.kt (100%) rename integration-tests/{kotlin => kotlin-maven-invoker}/src/test/resources/projects/classic-kotlin/src/main/kotlin/org/acme/MyApplication.kt (100%) rename integration-tests/{kotlin => kotlin-maven-invoker}/src/test/resources/projects/classic-kotlin/src/main/resources/META-INF/resources/index.html (100%) rename integration-tests/{kotlin => kotlin-maven-invoker}/src/test/resources/projects/classic-kotlin/src/main/resources/application.properties (100%) rename integration-tests/{kotlin => kotlin-maven-invoker}/src/test/resources/projects/classic-kotlin/src/test/kotlin/org/acme/HelloResourceTest.kt (100%) rename integration-tests/{kotlin => kotlin-maven-invoker}/src/test/resources/projects/external-reloadable-artifacts/app/pom.xml (100%) rename integration-tests/{kotlin => kotlin-maven-invoker}/src/test/resources/projects/external-reloadable-artifacts/app/src/main/kotlin/org/acme/GreetingResource.kt (100%) rename integration-tests/{kotlin => kotlin-maven-invoker}/src/test/resources/projects/external-reloadable-artifacts/app/src/main/resources/application.properties (100%) rename integration-tests/{kotlin => kotlin-maven-invoker}/src/test/resources/projects/external-reloadable-artifacts/external-lib/pom.xml (100%) rename integration-tests/{kotlin => kotlin-maven-invoker}/src/test/resources/projects/external-reloadable-artifacts/external-lib/src/main/kotlin/org/acme/lib/Greeting.kt (100%) rename integration-tests/{kotlin => kotlin-maven-invoker}/src/test/resources/projects/kotlin-compiler-args/pom.xml (100%) rename integration-tests/{kotlin => kotlin-maven-invoker}/src/test/resources/projects/kotlin-compiler-args/src/main/kotlin/org/acme/GraphQLResource.kt (100%) rename integration-tests/{kotlin => kotlin-maven-invoker}/src/test/resources/projects/kotlin-compiler-args/src/main/kotlin/org/acme/HelloResource.kt (100%) rename integration-tests/{kotlin => kotlin-maven-invoker}/src/test/resources/projects/kotlin-compiler-args/src/main/resources/META-INF/resources/index.html (100%) rename integration-tests/{kotlin => kotlin-maven-invoker}/src/test/resources/projects/kotlin-compiler-args/src/main/resources/application.properties (100%) diff --git a/integration-tests/kotlin/disable-native-profile b/integration-tests/kotlin-maven-invoker/disable-native-profile similarity index 100% rename from integration-tests/kotlin/disable-native-profile rename to integration-tests/kotlin-maven-invoker/disable-native-profile diff --git a/integration-tests/kotlin/pom.xml b/integration-tests/kotlin-maven-invoker/pom.xml similarity index 95% rename from integration-tests/kotlin/pom.xml rename to integration-tests/kotlin-maven-invoker/pom.xml index c4af49aad8f44..6f79c2f1b039b 100644 --- a/integration-tests/kotlin/pom.xml +++ b/integration-tests/kotlin-maven-invoker/pom.xml @@ -10,8 +10,9 @@ 999-SNAPSHOT - quarkus-integration-test-kotlin - Quarkus - Integration Tests - Kotlin + quarkus-integration-test-kotlin-invoker + Quarkus - Integration Tests - Kotlin - Invoker + Kotlin integration tests that need to use the Maven invoker diff --git a/integration-tests/kotlin/src/test/java/io/quarkus/kotlin/maven/it/KotlinCreateMavenProjectIT.java b/integration-tests/kotlin-maven-invoker/src/test/java/io/quarkus/kotlin/maven/it/KotlinCreateMavenProjectIT.java similarity index 100% rename from integration-tests/kotlin/src/test/java/io/quarkus/kotlin/maven/it/KotlinCreateMavenProjectIT.java rename to integration-tests/kotlin-maven-invoker/src/test/java/io/quarkus/kotlin/maven/it/KotlinCreateMavenProjectIT.java diff --git a/integration-tests/kotlin/src/test/java/io/quarkus/kotlin/maven/it/KotlinDevModeIT.java b/integration-tests/kotlin-maven-invoker/src/test/java/io/quarkus/kotlin/maven/it/KotlinDevModeIT.java similarity index 100% rename from integration-tests/kotlin/src/test/java/io/quarkus/kotlin/maven/it/KotlinDevModeIT.java rename to integration-tests/kotlin-maven-invoker/src/test/java/io/quarkus/kotlin/maven/it/KotlinDevModeIT.java diff --git a/integration-tests/kotlin/src/test/java/io/quarkus/kotlin/maven/it/KotlinRemoteDevModeIT.java b/integration-tests/kotlin-maven-invoker/src/test/java/io/quarkus/kotlin/maven/it/KotlinRemoteDevModeIT.java similarity index 100% rename from integration-tests/kotlin/src/test/java/io/quarkus/kotlin/maven/it/KotlinRemoteDevModeIT.java rename to integration-tests/kotlin-maven-invoker/src/test/java/io/quarkus/kotlin/maven/it/KotlinRemoteDevModeIT.java diff --git a/integration-tests/kotlin/src/test/resources/projects/classic-kotlin/pom.xml b/integration-tests/kotlin-maven-invoker/src/test/resources/projects/classic-kotlin/pom.xml similarity index 100% rename from integration-tests/kotlin/src/test/resources/projects/classic-kotlin/pom.xml rename to integration-tests/kotlin-maven-invoker/src/test/resources/projects/classic-kotlin/pom.xml diff --git a/integration-tests/kotlin/src/test/resources/projects/classic-kotlin/src/main/kotlin/org/acme/GreetingService.kt b/integration-tests/kotlin-maven-invoker/src/test/resources/projects/classic-kotlin/src/main/kotlin/org/acme/GreetingService.kt similarity index 100% rename from integration-tests/kotlin/src/test/resources/projects/classic-kotlin/src/main/kotlin/org/acme/GreetingService.kt rename to integration-tests/kotlin-maven-invoker/src/test/resources/projects/classic-kotlin/src/main/kotlin/org/acme/GreetingService.kt diff --git a/integration-tests/kotlin/src/test/resources/projects/classic-kotlin/src/main/kotlin/org/acme/HelloResource.kt b/integration-tests/kotlin-maven-invoker/src/test/resources/projects/classic-kotlin/src/main/kotlin/org/acme/HelloResource.kt similarity index 100% rename from integration-tests/kotlin/src/test/resources/projects/classic-kotlin/src/main/kotlin/org/acme/HelloResource.kt rename to integration-tests/kotlin-maven-invoker/src/test/resources/projects/classic-kotlin/src/main/kotlin/org/acme/HelloResource.kt diff --git a/integration-tests/kotlin/src/test/resources/projects/classic-kotlin/src/main/kotlin/org/acme/MyApplication.kt b/integration-tests/kotlin-maven-invoker/src/test/resources/projects/classic-kotlin/src/main/kotlin/org/acme/MyApplication.kt similarity index 100% rename from integration-tests/kotlin/src/test/resources/projects/classic-kotlin/src/main/kotlin/org/acme/MyApplication.kt rename to integration-tests/kotlin-maven-invoker/src/test/resources/projects/classic-kotlin/src/main/kotlin/org/acme/MyApplication.kt diff --git a/integration-tests/kotlin/src/test/resources/projects/classic-kotlin/src/main/resources/META-INF/resources/index.html b/integration-tests/kotlin-maven-invoker/src/test/resources/projects/classic-kotlin/src/main/resources/META-INF/resources/index.html similarity index 100% rename from integration-tests/kotlin/src/test/resources/projects/classic-kotlin/src/main/resources/META-INF/resources/index.html rename to integration-tests/kotlin-maven-invoker/src/test/resources/projects/classic-kotlin/src/main/resources/META-INF/resources/index.html diff --git a/integration-tests/kotlin/src/test/resources/projects/classic-kotlin/src/main/resources/application.properties b/integration-tests/kotlin-maven-invoker/src/test/resources/projects/classic-kotlin/src/main/resources/application.properties similarity index 100% rename from integration-tests/kotlin/src/test/resources/projects/classic-kotlin/src/main/resources/application.properties rename to integration-tests/kotlin-maven-invoker/src/test/resources/projects/classic-kotlin/src/main/resources/application.properties diff --git a/integration-tests/kotlin/src/test/resources/projects/classic-kotlin/src/test/kotlin/org/acme/HelloResourceTest.kt b/integration-tests/kotlin-maven-invoker/src/test/resources/projects/classic-kotlin/src/test/kotlin/org/acme/HelloResourceTest.kt similarity index 100% rename from integration-tests/kotlin/src/test/resources/projects/classic-kotlin/src/test/kotlin/org/acme/HelloResourceTest.kt rename to integration-tests/kotlin-maven-invoker/src/test/resources/projects/classic-kotlin/src/test/kotlin/org/acme/HelloResourceTest.kt diff --git a/integration-tests/kotlin/src/test/resources/projects/external-reloadable-artifacts/app/pom.xml b/integration-tests/kotlin-maven-invoker/src/test/resources/projects/external-reloadable-artifacts/app/pom.xml similarity index 100% rename from integration-tests/kotlin/src/test/resources/projects/external-reloadable-artifacts/app/pom.xml rename to integration-tests/kotlin-maven-invoker/src/test/resources/projects/external-reloadable-artifacts/app/pom.xml diff --git a/integration-tests/kotlin/src/test/resources/projects/external-reloadable-artifacts/app/src/main/kotlin/org/acme/GreetingResource.kt b/integration-tests/kotlin-maven-invoker/src/test/resources/projects/external-reloadable-artifacts/app/src/main/kotlin/org/acme/GreetingResource.kt similarity index 100% rename from integration-tests/kotlin/src/test/resources/projects/external-reloadable-artifacts/app/src/main/kotlin/org/acme/GreetingResource.kt rename to integration-tests/kotlin-maven-invoker/src/test/resources/projects/external-reloadable-artifacts/app/src/main/kotlin/org/acme/GreetingResource.kt diff --git a/integration-tests/kotlin/src/test/resources/projects/external-reloadable-artifacts/app/src/main/resources/application.properties b/integration-tests/kotlin-maven-invoker/src/test/resources/projects/external-reloadable-artifacts/app/src/main/resources/application.properties similarity index 100% rename from integration-tests/kotlin/src/test/resources/projects/external-reloadable-artifacts/app/src/main/resources/application.properties rename to integration-tests/kotlin-maven-invoker/src/test/resources/projects/external-reloadable-artifacts/app/src/main/resources/application.properties diff --git a/integration-tests/kotlin/src/test/resources/projects/external-reloadable-artifacts/external-lib/pom.xml b/integration-tests/kotlin-maven-invoker/src/test/resources/projects/external-reloadable-artifacts/external-lib/pom.xml similarity index 100% rename from integration-tests/kotlin/src/test/resources/projects/external-reloadable-artifacts/external-lib/pom.xml rename to integration-tests/kotlin-maven-invoker/src/test/resources/projects/external-reloadable-artifacts/external-lib/pom.xml diff --git a/integration-tests/kotlin/src/test/resources/projects/external-reloadable-artifacts/external-lib/src/main/kotlin/org/acme/lib/Greeting.kt b/integration-tests/kotlin-maven-invoker/src/test/resources/projects/external-reloadable-artifacts/external-lib/src/main/kotlin/org/acme/lib/Greeting.kt similarity index 100% rename from integration-tests/kotlin/src/test/resources/projects/external-reloadable-artifacts/external-lib/src/main/kotlin/org/acme/lib/Greeting.kt rename to integration-tests/kotlin-maven-invoker/src/test/resources/projects/external-reloadable-artifacts/external-lib/src/main/kotlin/org/acme/lib/Greeting.kt diff --git a/integration-tests/kotlin/src/test/resources/projects/kotlin-compiler-args/pom.xml b/integration-tests/kotlin-maven-invoker/src/test/resources/projects/kotlin-compiler-args/pom.xml similarity index 100% rename from integration-tests/kotlin/src/test/resources/projects/kotlin-compiler-args/pom.xml rename to integration-tests/kotlin-maven-invoker/src/test/resources/projects/kotlin-compiler-args/pom.xml diff --git a/integration-tests/kotlin/src/test/resources/projects/kotlin-compiler-args/src/main/kotlin/org/acme/GraphQLResource.kt b/integration-tests/kotlin-maven-invoker/src/test/resources/projects/kotlin-compiler-args/src/main/kotlin/org/acme/GraphQLResource.kt similarity index 100% rename from integration-tests/kotlin/src/test/resources/projects/kotlin-compiler-args/src/main/kotlin/org/acme/GraphQLResource.kt rename to integration-tests/kotlin-maven-invoker/src/test/resources/projects/kotlin-compiler-args/src/main/kotlin/org/acme/GraphQLResource.kt diff --git a/integration-tests/kotlin/src/test/resources/projects/kotlin-compiler-args/src/main/kotlin/org/acme/HelloResource.kt b/integration-tests/kotlin-maven-invoker/src/test/resources/projects/kotlin-compiler-args/src/main/kotlin/org/acme/HelloResource.kt similarity index 100% rename from integration-tests/kotlin/src/test/resources/projects/kotlin-compiler-args/src/main/kotlin/org/acme/HelloResource.kt rename to integration-tests/kotlin-maven-invoker/src/test/resources/projects/kotlin-compiler-args/src/main/kotlin/org/acme/HelloResource.kt diff --git a/integration-tests/kotlin/src/test/resources/projects/kotlin-compiler-args/src/main/resources/META-INF/resources/index.html b/integration-tests/kotlin-maven-invoker/src/test/resources/projects/kotlin-compiler-args/src/main/resources/META-INF/resources/index.html similarity index 100% rename from integration-tests/kotlin/src/test/resources/projects/kotlin-compiler-args/src/main/resources/META-INF/resources/index.html rename to integration-tests/kotlin-maven-invoker/src/test/resources/projects/kotlin-compiler-args/src/main/resources/META-INF/resources/index.html diff --git a/integration-tests/kotlin/src/test/resources/projects/kotlin-compiler-args/src/main/resources/application.properties b/integration-tests/kotlin-maven-invoker/src/test/resources/projects/kotlin-compiler-args/src/main/resources/application.properties similarity index 100% rename from integration-tests/kotlin/src/test/resources/projects/kotlin-compiler-args/src/main/resources/application.properties rename to integration-tests/kotlin-maven-invoker/src/test/resources/projects/kotlin-compiler-args/src/main/resources/application.properties diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml index 356cb2336c5c3..f5b6eb084a5b1 100644 --- a/integration-tests/pom.xml +++ b/integration-tests/pom.xml @@ -303,7 +303,7 @@ virtual-http-resteasy maven scala - kotlin + kotlin-maven-invoker kotlin-serialization mongodb-panache mongodb-panache-kotlin From bd8d514fce523346ed6f68c4c0052c26c69a7160 Mon Sep 17 00:00:00 2001 From: Ladislav Thon Date: Tue, 3 Dec 2024 15:38:30 +0100 Subject: [PATCH 2/3] Tests: rename the "kotlin-serialization" integration tests module to "kotlin" This is because these tests use the standard `@QuarkusTest` facility. --- .github/native-tests.json | 2 +- integration-tests/{kotlin-serialization => kotlin}/pom.xml | 5 ++--- .../main/kotlin/io/quarkus/it/kotser/GreetingApplication.kt | 0 .../src/main/kotlin/io/quarkus/it/kotser/GreetingResource.kt | 0 .../src/main/kotlin/io/quarkus/it/kotser/TitleCase.kt | 0 .../src/main/kotlin/io/quarkus/it/kotser/model/Person.kt | 0 .../src/main/kotlin/io/quarkus/it/kotser/model/Person2.kt | 0 .../src/main/resources/application.properties | 0 .../src/test/kotlin/io/quarkus/it/kotser/ResourceIT.kt | 0 .../src/test/kotlin/io/quarkus/it/kotser/ResourceTest.kt | 0 integration-tests/pom.xml | 2 +- 11 files changed, 4 insertions(+), 5 deletions(-) rename integration-tests/{kotlin-serialization => kotlin}/pom.xml (95%) rename integration-tests/{kotlin-serialization => kotlin}/src/main/kotlin/io/quarkus/it/kotser/GreetingApplication.kt (100%) rename integration-tests/{kotlin-serialization => kotlin}/src/main/kotlin/io/quarkus/it/kotser/GreetingResource.kt (100%) rename integration-tests/{kotlin-serialization => kotlin}/src/main/kotlin/io/quarkus/it/kotser/TitleCase.kt (100%) rename integration-tests/{kotlin-serialization => kotlin}/src/main/kotlin/io/quarkus/it/kotser/model/Person.kt (100%) rename integration-tests/{kotlin-serialization => kotlin}/src/main/kotlin/io/quarkus/it/kotser/model/Person2.kt (100%) rename integration-tests/{kotlin-serialization => kotlin}/src/main/resources/application.properties (100%) rename integration-tests/{kotlin-serialization => kotlin}/src/test/kotlin/io/quarkus/it/kotser/ResourceIT.kt (100%) rename integration-tests/{kotlin-serialization => kotlin}/src/test/kotlin/io/quarkus/it/kotser/ResourceTest.kt (100%) diff --git a/.github/native-tests.json b/.github/native-tests.json index 87547f9ca469d..cd9b3beb494a9 100644 --- a/.github/native-tests.json +++ b/.github/native-tests.json @@ -99,7 +99,7 @@ { "category": "Misc1", "timeout": 70, - "test-modules": "maven, jackson, jsonb, kotlin-serialization, rest-client-reactive-kotlin-serialization, quartz, qute, logging-min-level-unset, logging-min-level-set, simple with space", + "test-modules": "maven, jackson, jsonb, kotlin, rest-client-reactive-kotlin-serialization, quartz, qute, logging-min-level-unset, logging-min-level-set, simple with space", "os-name": "ubuntu-latest" }, { diff --git a/integration-tests/kotlin-serialization/pom.xml b/integration-tests/kotlin/pom.xml similarity index 95% rename from integration-tests/kotlin-serialization/pom.xml rename to integration-tests/kotlin/pom.xml index 99919f36e3dbb..bf5587575cf76 100644 --- a/integration-tests/kotlin-serialization/pom.xml +++ b/integration-tests/kotlin/pom.xml @@ -10,9 +10,8 @@ 999-SNAPSHOT - quarkus-integration-test-kotlin-serialization - Quarkus - Integration Tests - Kotlin Serialization - Kotlin Serialization integration tests module + quarkus-integration-test-kotlin + Quarkus - Integration Tests - Kotlin 1.3.1 diff --git a/integration-tests/kotlin-serialization/src/main/kotlin/io/quarkus/it/kotser/GreetingApplication.kt b/integration-tests/kotlin/src/main/kotlin/io/quarkus/it/kotser/GreetingApplication.kt similarity index 100% rename from integration-tests/kotlin-serialization/src/main/kotlin/io/quarkus/it/kotser/GreetingApplication.kt rename to integration-tests/kotlin/src/main/kotlin/io/quarkus/it/kotser/GreetingApplication.kt diff --git a/integration-tests/kotlin-serialization/src/main/kotlin/io/quarkus/it/kotser/GreetingResource.kt b/integration-tests/kotlin/src/main/kotlin/io/quarkus/it/kotser/GreetingResource.kt similarity index 100% rename from integration-tests/kotlin-serialization/src/main/kotlin/io/quarkus/it/kotser/GreetingResource.kt rename to integration-tests/kotlin/src/main/kotlin/io/quarkus/it/kotser/GreetingResource.kt diff --git a/integration-tests/kotlin-serialization/src/main/kotlin/io/quarkus/it/kotser/TitleCase.kt b/integration-tests/kotlin/src/main/kotlin/io/quarkus/it/kotser/TitleCase.kt similarity index 100% rename from integration-tests/kotlin-serialization/src/main/kotlin/io/quarkus/it/kotser/TitleCase.kt rename to integration-tests/kotlin/src/main/kotlin/io/quarkus/it/kotser/TitleCase.kt diff --git a/integration-tests/kotlin-serialization/src/main/kotlin/io/quarkus/it/kotser/model/Person.kt b/integration-tests/kotlin/src/main/kotlin/io/quarkus/it/kotser/model/Person.kt similarity index 100% rename from integration-tests/kotlin-serialization/src/main/kotlin/io/quarkus/it/kotser/model/Person.kt rename to integration-tests/kotlin/src/main/kotlin/io/quarkus/it/kotser/model/Person.kt diff --git a/integration-tests/kotlin-serialization/src/main/kotlin/io/quarkus/it/kotser/model/Person2.kt b/integration-tests/kotlin/src/main/kotlin/io/quarkus/it/kotser/model/Person2.kt similarity index 100% rename from integration-tests/kotlin-serialization/src/main/kotlin/io/quarkus/it/kotser/model/Person2.kt rename to integration-tests/kotlin/src/main/kotlin/io/quarkus/it/kotser/model/Person2.kt diff --git a/integration-tests/kotlin-serialization/src/main/resources/application.properties b/integration-tests/kotlin/src/main/resources/application.properties similarity index 100% rename from integration-tests/kotlin-serialization/src/main/resources/application.properties rename to integration-tests/kotlin/src/main/resources/application.properties diff --git a/integration-tests/kotlin-serialization/src/test/kotlin/io/quarkus/it/kotser/ResourceIT.kt b/integration-tests/kotlin/src/test/kotlin/io/quarkus/it/kotser/ResourceIT.kt similarity index 100% rename from integration-tests/kotlin-serialization/src/test/kotlin/io/quarkus/it/kotser/ResourceIT.kt rename to integration-tests/kotlin/src/test/kotlin/io/quarkus/it/kotser/ResourceIT.kt diff --git a/integration-tests/kotlin-serialization/src/test/kotlin/io/quarkus/it/kotser/ResourceTest.kt b/integration-tests/kotlin/src/test/kotlin/io/quarkus/it/kotser/ResourceTest.kt similarity index 100% rename from integration-tests/kotlin-serialization/src/test/kotlin/io/quarkus/it/kotser/ResourceTest.kt rename to integration-tests/kotlin/src/test/kotlin/io/quarkus/it/kotser/ResourceTest.kt diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml index f5b6eb084a5b1..6376d450f75fa 100644 --- a/integration-tests/pom.xml +++ b/integration-tests/pom.xml @@ -303,8 +303,8 @@ virtual-http-resteasy maven scala + kotlin kotlin-maven-invoker - kotlin-serialization mongodb-panache mongodb-panache-kotlin mongodb-rest-data-panache From 5d11efeeee233bddb96f7d8c7f0d52116ba45283 Mon Sep 17 00:00:00 2001 From: Ladislav Thon Date: Tue, 3 Dec 2024 15:56:38 +0100 Subject: [PATCH 3/3] Testing: add reproducers for testing bugs --- .../it/testing/repro34099/Repro34099Test.kt | 23 ++++++++ .../it/testing/repro42000/Repro42000Test.kt | 42 +++++++++++++++ .../it/testing/repro44320/MyService.java | 17 ++++++ .../testing/repro13261/Repro13261Test.java | 24 +++++++++ .../testing/repro42006/Repro42006Test.java | 43 +++++++++++++++ .../testing/repro44320/Repro44320Test.java | 43 +++++++++++++++ .../it/main/testing/repro8446/Greeter.java | 5 ++ .../testing/repro8446/GreeterExtension.java | 52 +++++++++++++++++++ .../main/testing/repro8446/Repro8446Test.java | 20 +++++++ 9 files changed, 269 insertions(+) create mode 100644 integration-tests/kotlin/src/test/kotlin/io/quarkus/it/testing/repro34099/Repro34099Test.kt create mode 100644 integration-tests/kotlin/src/test/kotlin/io/quarkus/it/testing/repro42000/Repro42000Test.kt create mode 100644 integration-tests/main/src/main/java/io/quarkus/it/testing/repro44320/MyService.java create mode 100644 integration-tests/main/src/test/java/io/quarkus/it/main/testing/repro13261/Repro13261Test.java create mode 100644 integration-tests/main/src/test/java/io/quarkus/it/main/testing/repro42006/Repro42006Test.java create mode 100644 integration-tests/main/src/test/java/io/quarkus/it/main/testing/repro44320/Repro44320Test.java create mode 100644 integration-tests/main/src/test/java/io/quarkus/it/main/testing/repro8446/Greeter.java create mode 100644 integration-tests/main/src/test/java/io/quarkus/it/main/testing/repro8446/GreeterExtension.java create mode 100644 integration-tests/main/src/test/java/io/quarkus/it/main/testing/repro8446/Repro8446Test.java diff --git a/integration-tests/kotlin/src/test/kotlin/io/quarkus/it/testing/repro34099/Repro34099Test.kt b/integration-tests/kotlin/src/test/kotlin/io/quarkus/it/testing/repro34099/Repro34099Test.kt new file mode 100644 index 0000000000000..5e63473cbc4b9 --- /dev/null +++ b/integration-tests/kotlin/src/test/kotlin/io/quarkus/it/testing/repro34099/Repro34099Test.kt @@ -0,0 +1,23 @@ +package io.quarkus.it.testing.repro34099 + +import io.quarkus.test.junit.QuarkusTest +import java.time.Duration +import org.junit.jupiter.api.Assertions +import org.junit.jupiter.api.Disabled +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.assertTimeout + +@QuarkusTest +class Repro34099Test { + @Test + fun javaAssertion() { + Assertions.assertTimeout(Duration.ofSeconds(1)) {} + } + + @Test + @Disabled("https://github.com/quarkusio/quarkus/issues/34099") + // fails with `Linkage loader constraint violation` + fun kotlinAssertion() { + assertTimeout(Duration.ofSeconds(1)) {} + } +} diff --git a/integration-tests/kotlin/src/test/kotlin/io/quarkus/it/testing/repro42000/Repro42000Test.kt b/integration-tests/kotlin/src/test/kotlin/io/quarkus/it/testing/repro42000/Repro42000Test.kt new file mode 100644 index 0000000000000..cbcb4a259fbb1 --- /dev/null +++ b/integration-tests/kotlin/src/test/kotlin/io/quarkus/it/testing/repro42000/Repro42000Test.kt @@ -0,0 +1,42 @@ +package io.quarkus.it.testing.repro42000 + +import io.quarkus.test.junit.QuarkusTest +import java.util.stream.Stream +import org.junit.jupiter.api.Assertions.assertNotNull +import org.junit.jupiter.api.Disabled +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.Arguments +import org.junit.jupiter.params.provider.MethodSource + +@QuarkusTest +class Repro42000Test { + companion object { + val lambda: (String) -> String = { s -> s } + + fun function(s: String) = s + + @JvmStatic + fun lambdaProvider(): Stream { + return Stream.of(Arguments.of(lambda)) + } + + @JvmStatic + fun functionProvider(): Stream { + return Stream.of(Arguments.of(::function)) + } + } + + @ParameterizedTest + @MethodSource("lambdaProvider") + @Disabled("https://github.com/quarkusio/quarkus/issues/42000") + // fails with `IllegalArgumentException: argument type mismatch` + fun testLambdaProvider(function: (String) -> String) { + assertNotNull(function) + } + + @ParameterizedTest + @MethodSource("functionProvider") + fun testFunctionProvider(function: (String) -> String) { + assertNotNull(function) + } +} diff --git a/integration-tests/main/src/main/java/io/quarkus/it/testing/repro44320/MyService.java b/integration-tests/main/src/main/java/io/quarkus/it/testing/repro44320/MyService.java new file mode 100644 index 0000000000000..1f2b031c1d5fd --- /dev/null +++ b/integration-tests/main/src/main/java/io/quarkus/it/testing/repro44320/MyService.java @@ -0,0 +1,17 @@ +package io.quarkus.it.testing.repro44320; + +import java.util.Set; + +import jakarta.enterprise.context.ApplicationScoped; + +import io.quarkus.arc.Unremovable; +import io.quarkus.runtime.Startup; + +@ApplicationScoped +@Startup +@Unremovable +public class MyService { + public Set get() { + return Set.of("a", "b", "c"); + } +} diff --git a/integration-tests/main/src/test/java/io/quarkus/it/main/testing/repro13261/Repro13261Test.java b/integration-tests/main/src/test/java/io/quarkus/it/main/testing/repro13261/Repro13261Test.java new file mode 100644 index 0000000000000..e6abb234611f7 --- /dev/null +++ b/integration-tests/main/src/test/java/io/quarkus/it/main/testing/repro13261/Repro13261Test.java @@ -0,0 +1,24 @@ +package io.quarkus.it.main.testing.repro13261; + +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import java.nio.file.Path; + +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import io.quarkus.test.junit.QuarkusTest; + +@Disabled("https://github.com/quarkusio/quarkus/issues/13261") +// fails with `expected: not ` +@QuarkusTest +public class Repro13261Test { + @TempDir + Path tempDir; + + @Test + public void test() { + assertNotNull(tempDir); + } +} diff --git a/integration-tests/main/src/test/java/io/quarkus/it/main/testing/repro42006/Repro42006Test.java b/integration-tests/main/src/test/java/io/quarkus/it/main/testing/repro42006/Repro42006Test.java new file mode 100644 index 0000000000000..b0929b32df3a6 --- /dev/null +++ b/integration-tests/main/src/test/java/io/quarkus/it/main/testing/repro42006/Repro42006Test.java @@ -0,0 +1,43 @@ +package io.quarkus.it.main.testing.repro42006; + +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.io.Serializable; +import java.util.function.Supplier; +import java.util.stream.Stream; + +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.ArgumentsProvider; +import org.junit.jupiter.params.provider.ArgumentsSource; + +import io.quarkus.test.junit.QuarkusTest; + +@Disabled("https://github.com/quarkusio/quarkus/issues/42006") +// fails with `java.lang.ClassNotFoundException: io.quarkus.it.main.testing.repro42006.Repro42006Test$LambdaProvider$$Lambda$4007/0x000075d5017e8450` +@QuarkusTest +public class Repro42006Test { + @ParameterizedTest + @ArgumentsSource(LambdaProvider.class) + void test(String type, Object lambda) { + assertTrue(lambda.toString().contains("$$Lambda"), "Failed on " + type); + } + + private static class LambdaProvider implements ArgumentsProvider { + @Override + public Stream provideArguments(ExtensionContext context) { + return Stream.of( + Arguments.of("SerializableSupplier", (SerializableSupplier) () -> "foo"), + Arguments.of("SerializableCustom", (SerializableCustom) () -> "bar")); + } + } + + public interface SerializableSupplier extends Supplier, Serializable { + } + + public interface SerializableCustom extends Serializable { + String get(); + } +} diff --git a/integration-tests/main/src/test/java/io/quarkus/it/main/testing/repro44320/Repro44320Test.java b/integration-tests/main/src/test/java/io/quarkus/it/main/testing/repro44320/Repro44320Test.java new file mode 100644 index 0000000000000..cb4588dbca060 --- /dev/null +++ b/integration-tests/main/src/test/java/io/quarkus/it/main/testing/repro44320/Repro44320Test.java @@ -0,0 +1,43 @@ +package io.quarkus.it.main.testing.repro44320; + +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import java.util.HashSet; +import java.util.Set; + +import jakarta.inject.Inject; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + +import io.quarkus.it.testing.repro44320.MyService; +import io.quarkus.test.junit.QuarkusTest; + +@Disabled("https://github.com/quarkusio/quarkus/issues/44320") +// fails with `You must configure at least one set of arguments for this @ParameterizedTest`, because the `set` is empty +@TestInstance(TestInstance.Lifecycle.PER_CLASS) +@QuarkusTest +public class Repro44320Test { + private static Set set = new HashSet<>(); + + @Inject + MyService service; + + @BeforeAll + public void beforeAllTests() { + set = service.get(); + } + + @ParameterizedTest + @MethodSource("getData") + public void test(String key) { + assertNotNull(key); + } + + public Set getData() { + return set; + } +} diff --git a/integration-tests/main/src/test/java/io/quarkus/it/main/testing/repro8446/Greeter.java b/integration-tests/main/src/test/java/io/quarkus/it/main/testing/repro8446/Greeter.java new file mode 100644 index 0000000000000..8a410d2f0afc8 --- /dev/null +++ b/integration-tests/main/src/test/java/io/quarkus/it/main/testing/repro8446/Greeter.java @@ -0,0 +1,5 @@ +package io.quarkus.it.main.testing.repro8446; + +public interface Greeter { + String hello(); +} diff --git a/integration-tests/main/src/test/java/io/quarkus/it/main/testing/repro8446/GreeterExtension.java b/integration-tests/main/src/test/java/io/quarkus/it/main/testing/repro8446/GreeterExtension.java new file mode 100644 index 0000000000000..05155a0bd61cb --- /dev/null +++ b/integration-tests/main/src/test/java/io/quarkus/it/main/testing/repro8446/GreeterExtension.java @@ -0,0 +1,52 @@ +package io.quarkus.it.main.testing.repro8446; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.stream.Stream; + +import org.junit.jupiter.api.extension.Extension; +import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.jupiter.api.extension.ParameterContext; +import org.junit.jupiter.api.extension.ParameterResolutionException; +import org.junit.jupiter.api.extension.ParameterResolver; +import org.junit.jupiter.api.extension.TestTemplateInvocationContext; +import org.junit.jupiter.api.extension.TestTemplateInvocationContextProvider; + +public class GreeterExtension implements TestTemplateInvocationContextProvider { + @Override + public boolean supportsTestTemplate(ExtensionContext context) { + return context.getTestMethod().map(method -> { + return Arrays.asList(method.getParameterTypes()).contains(Greeter.class); + }).orElse(false); + } + + @Override + public Stream provideTestTemplateInvocationContexts(ExtensionContext context) { + return Stream.of(new HelloTestTemplateInvocationContext(() -> "hello")); + } + + private static class HelloTestTemplateInvocationContext implements TestTemplateInvocationContext, ParameterResolver { + private final Greeter greeter; + + public HelloTestTemplateInvocationContext(Greeter greeter) { + this.greeter = greeter; + } + + @Override + public List getAdditionalExtensions() { + return Collections.singletonList(this); + } + + @Override + public boolean supportsParameter(ParameterContext pc, ExtensionContext extensionContext) + throws ParameterResolutionException { + return pc.getParameter().getType() == Greeter.class; + } + + @Override + public Object resolveParameter(ParameterContext parameterContext, ExtensionContext extensionContext) { + return greeter; + } + } +} diff --git a/integration-tests/main/src/test/java/io/quarkus/it/main/testing/repro8446/Repro8446Test.java b/integration-tests/main/src/test/java/io/quarkus/it/main/testing/repro8446/Repro8446Test.java new file mode 100644 index 0000000000000..2edab696af117 --- /dev/null +++ b/integration-tests/main/src/test/java/io/quarkus/it/main/testing/repro8446/Repro8446Test.java @@ -0,0 +1,20 @@ +package io.quarkus.it.main.testing.repro8446; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.TestTemplate; +import org.junit.jupiter.api.extension.ExtendWith; + +import io.quarkus.test.junit.QuarkusTest; + +@Disabled("https://github.com/quarkusio/quarkus/issues/8446") +// fails with `IllegalArgumentException: argument type mismatch` +@QuarkusTest +public class Repro8446Test { + @TestTemplate + @ExtendWith(GreeterExtension.class) + public void test(Greeter greeter) { + assertEquals("hello", greeter.hello()); + } +}