From aa70206da5cf889b5d5ac0b1f4c9afa2f18834c7 Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Thu, 14 Jul 2022 08:25:48 +0300 Subject: [PATCH 1/2] Add Javadoc to command-mode testing API --- .../src/main/java/io/quarkus/test/junit/main/Launch.java | 5 ++++- .../main/java/io/quarkus/test/junit/main/LaunchResult.java | 7 ++++++- .../io/quarkus/test/junit/main/QuarkusMainLauncher.java | 6 ++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/test-framework/junit5/src/main/java/io/quarkus/test/junit/main/Launch.java b/test-framework/junit5/src/main/java/io/quarkus/test/junit/main/Launch.java index ec373bf40b970..1acdae4956edf 100644 --- a/test-framework/junit5/src/main/java/io/quarkus/test/junit/main/Launch.java +++ b/test-framework/junit5/src/main/java/io/quarkus/test/junit/main/Launch.java @@ -6,8 +6,11 @@ import java.lang.annotation.Target; /** - * Annotation for {@link QuarkusMainTest} and {@link QuarkusMainIntegrationTest} used to + * Annotation for {@link QuarkusMainTest} and {@link QuarkusMainIntegrationTest} that is used to launch command line + * applications. + * The annotation is meant to be used on test methods only. * + * See also {@link LaunchResult} and {@link QuarkusMainLauncher} */ @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) diff --git a/test-framework/junit5/src/main/java/io/quarkus/test/junit/main/LaunchResult.java b/test-framework/junit5/src/main/java/io/quarkus/test/junit/main/LaunchResult.java index 71c62ba23186e..2c6aba790ff0d 100644 --- a/test-framework/junit5/src/main/java/io/quarkus/test/junit/main/LaunchResult.java +++ b/test-framework/junit5/src/main/java/io/quarkus/test/junit/main/LaunchResult.java @@ -2,6 +2,11 @@ import java.util.List; +/** + * Contains information about a run (via {@link Launch}) of a command line application. + * The class is meant to be used as a test method parameter giving the test the ability + * to assert various aspects of the run. + */ public interface LaunchResult { default String getOutput() { @@ -22,4 +27,4 @@ default void echoSystemOut() { List getErrorStream(); int exitCode(); -} \ No newline at end of file +} diff --git a/test-framework/junit5/src/main/java/io/quarkus/test/junit/main/QuarkusMainLauncher.java b/test-framework/junit5/src/main/java/io/quarkus/test/junit/main/QuarkusMainLauncher.java index 5a2167e1492f8..1c7a11f228f82 100644 --- a/test-framework/junit5/src/main/java/io/quarkus/test/junit/main/QuarkusMainLauncher.java +++ b/test-framework/junit5/src/main/java/io/quarkus/test/junit/main/QuarkusMainLauncher.java @@ -1,5 +1,11 @@ package io.quarkus.test.junit.main; +/** + * The annotation is meant to be used on test methods only and it allows the launching a command line application with + * arbitrary parameters. + * + * See also {@link LaunchResult} and {@link Launch} + */ public interface QuarkusMainLauncher { LaunchResult launch(String... args); From cdf39a4deb5aae5a85674b45c3105c5591007626 Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Thu, 14 Jul 2022 08:54:27 +0300 Subject: [PATCH 2/2] Remove unused field --- .../java/io/quarkus/test/junit/QuarkusMainTestExtension.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/test-framework/junit5/src/main/java/io/quarkus/test/junit/QuarkusMainTestExtension.java b/test-framework/junit5/src/main/java/io/quarkus/test/junit/QuarkusMainTestExtension.java index b947bf54ecb98..f026db3bfbda0 100644 --- a/test-framework/junit5/src/main/java/io/quarkus/test/junit/QuarkusMainTestExtension.java +++ b/test-framework/junit5/src/main/java/io/quarkus/test/junit/QuarkusMainTestExtension.java @@ -35,9 +35,6 @@ public class QuarkusMainTestExtension extends AbstractJvmQuarkusTestExtension implements BeforeEachCallback, AfterEachCallback, ParameterResolver, BeforeAllCallback, AfterAllCallback { - public static final ExtensionContext.Namespace NAMESPACE = ExtensionContext.Namespace - .create("io.quarkus.test.main.jvm"); - PrepareResult prepareResult; private static boolean hasPerTestResources;