diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml index 356cb2336c5c39..9aa9cd69bb8568 100644 --- a/integration-tests/pom.xml +++ b/integration-tests/pom.xml @@ -417,6 +417,10 @@ virtual-threads mutiny-native-jctools + + repro-13261 + repro-42006 + repro-44320 diff --git a/integration-tests/repro-13261/pom.xml b/integration-tests/repro-13261/pom.xml new file mode 100644 index 00000000000000..05148071e333aa --- /dev/null +++ b/integration-tests/repro-13261/pom.xml @@ -0,0 +1,63 @@ + + + 4.0.0 + + io.quarkus + quarkus-integration-tests-parent + 999-SNAPSHOT + + + quarkus-integration-test-repro-13261 + Quarkus - Integration Tests - Reproducer #13261 + + + + io.quarkus + quarkus-arc + + + + io.quarkus + quarkus-junit5 + test + + + + + io.quarkus + quarkus-arc-deployment + ${project.version} + pom + test + + + * + * + + + + + + + + + io.quarkus + quarkus-maven-plugin + + + + build + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + + + diff --git a/integration-tests/repro-13261/src/test/java/io/quarkus/it/repro13261/Repro13261Test.java b/integration-tests/repro-13261/src/test/java/io/quarkus/it/repro13261/Repro13261Test.java new file mode 100644 index 00000000000000..d33540ec0a665c --- /dev/null +++ b/integration-tests/repro-13261/src/test/java/io/quarkus/it/repro13261/Repro13261Test.java @@ -0,0 +1,22 @@ +package io.quarkus.it.repro13261; + +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import java.nio.file.Path; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import io.quarkus.test.junit.QuarkusTest; + +@QuarkusTest +public class Repro13261Test { + @TempDir + Path tempDir; + + @Test + public void defaultConfiguration() { + System.out.println(tempDir); + assertNotNull(tempDir); + } +} diff --git a/integration-tests/repro-42006/pom.xml b/integration-tests/repro-42006/pom.xml new file mode 100644 index 00000000000000..828ae4cdf2de04 --- /dev/null +++ b/integration-tests/repro-42006/pom.xml @@ -0,0 +1,63 @@ + + + 4.0.0 + + io.quarkus + quarkus-integration-tests-parent + 999-SNAPSHOT + + + quarkus-integration-test-repro-42006 + Quarkus - Integration Tests - Reproducer #42006 + + + + io.quarkus + quarkus-arc + + + + io.quarkus + quarkus-junit5 + test + + + + + io.quarkus + quarkus-arc-deployment + ${project.version} + pom + test + + + * + * + + + + + + + + + io.quarkus + quarkus-maven-plugin + + + + build + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + + + diff --git a/integration-tests/repro-42006/src/test/java/io/quarkus/it/repro42006/Repro42006Test.java b/integration-tests/repro-42006/src/test/java/io/quarkus/it/repro42006/Repro42006Test.java new file mode 100644 index 00000000000000..b66da93865b7cf --- /dev/null +++ b/integration-tests/repro-42006/src/test/java/io/quarkus/it/repro42006/Repro42006Test.java @@ -0,0 +1,41 @@ +package io.quarkus.it.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.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; + +@QuarkusTest +public class Repro42006Test { + @ParameterizedTest + @ArgumentsSource(LambdaProvider.class) + void test(String type, Object lambda) { + System.out.println(type + " | " + lambda); + assertTrue(lambda.toString().contains("$$Lambda")); + } + + 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/repro-44320/pom.xml b/integration-tests/repro-44320/pom.xml new file mode 100644 index 00000000000000..b109d5d553ad36 --- /dev/null +++ b/integration-tests/repro-44320/pom.xml @@ -0,0 +1,63 @@ + + + 4.0.0 + + io.quarkus + quarkus-integration-tests-parent + 999-SNAPSHOT + + + quarkus-integration-test-repro-44320 + Quarkus - Integration Tests - Reproducer #44320 + + + + io.quarkus + quarkus-arc + + + + io.quarkus + quarkus-junit5 + test + + + + + io.quarkus + quarkus-arc-deployment + ${project.version} + pom + test + + + * + * + + + + + + + + + io.quarkus + quarkus-maven-plugin + + + + build + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + + + diff --git a/integration-tests/repro-44320/src/main/java/io/quarkus/it/repro44320/MyService.java b/integration-tests/repro-44320/src/main/java/io/quarkus/it/repro44320/MyService.java new file mode 100644 index 00000000000000..b3eb274fe8d1ba --- /dev/null +++ b/integration-tests/repro-44320/src/main/java/io/quarkus/it/repro44320/MyService.java @@ -0,0 +1,17 @@ +package io.quarkus.it.repro44320; + +import java.util.List; + +import jakarta.enterprise.context.ApplicationScoped; + +import io.quarkus.arc.Unremovable; +import io.quarkus.runtime.Startup; + +@ApplicationScoped +@Startup +@Unremovable +public class MyService { + public List get() { + return List.of("a", "b", "c", "d", "b", "b", "h", "a"); + } +} diff --git a/integration-tests/repro-44320/src/test/java/io/quarkus/it/repro44320/Repro44320Test.java b/integration-tests/repro-44320/src/test/java/io/quarkus/it/repro44320/Repro44320Test.java new file mode 100644 index 00000000000000..f55ae5ecc81a26 --- /dev/null +++ b/integration-tests/repro-44320/src/test/java/io/quarkus/it/repro44320/Repro44320Test.java @@ -0,0 +1,43 @@ +package io.quarkus.it.repro44320; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +import jakarta.inject.Inject; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + +import io.quarkus.test.junit.QuarkusTest; + +@TestInstance(TestInstance.Lifecycle.PER_CLASS) +@QuarkusTest +public class Repro44320Test { + private static Map map = new HashMap<>(); + + @Inject + MyService service; + + @BeforeAll + public void beforeAllTests() { + List list = service.get(); + map = list.stream().collect(Collectors.groupingBy(k -> k, Collectors.counting())); + System.out.println("Map in @BeforeAll" + map); + } + + @ParameterizedTest + @MethodSource("getData") + public void test(String key) { + System.out.println("Key " + key); + } + + public Set getData() { + System.out.println("Map in getData " + map); + return map.keySet(); + } +}