You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2022/09/28 13:12:54 UTC
[camel-quarkus] 06/11: test-support-process: add possibility to customize process executor
This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch 2.13.x
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit 2ebc41e66a788255033f31fb11299259255eb5b1
Author: aldettinger <al...@gmail.com>
AuthorDate: Mon Sep 19 13:57:30 2022 +0200
test-support-process: add possibility to customize process executor
---
.../quarkus/test/support/process/QuarkusProcessExecutor.java | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/integration-tests-support/process-executor-support/src/main/java/org/apache/camel/quarkus/test/support/process/QuarkusProcessExecutor.java b/integration-tests-support/process-executor-support/src/main/java/org/apache/camel/quarkus/test/support/process/QuarkusProcessExecutor.java
index c92a961606..e10963583d 100644
--- a/integration-tests-support/process-executor-support/src/main/java/org/apache/camel/quarkus/test/support/process/QuarkusProcessExecutor.java
+++ b/integration-tests-support/process-executor-support/src/main/java/org/apache/camel/quarkus/test/support/process/QuarkusProcessExecutor.java
@@ -22,6 +22,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.TimeoutException;
+import java.util.function.Consumer;
import org.apache.camel.quarkus.test.AvailablePortFinder;
import org.jboss.logging.Logger;
@@ -40,10 +41,14 @@ public class QuarkusProcessExecutor {
private final int httpsPort = AvailablePortFinder.getNextAvailable();
public QuarkusProcessExecutor(String... jvmArgs) {
- this(jvmArgs, null);
+ this(jvmArgs, (String[]) null);
}
public QuarkusProcessExecutor(String[] jvmArgs, String... applicationArgs) {
+ this(null, jvmArgs, applicationArgs);
+ }
+
+ public QuarkusProcessExecutor(Consumer<ProcessExecutor> customizer, String[] jvmArgs, String... applicationArgs) {
List<String> command = command(jvmArgs);
if (applicationArgs != null) {
command.addAll(Arrays.asList(applicationArgs));
@@ -54,6 +59,10 @@ public class QuarkusProcessExecutor {
.command(command)
.redirectOutput(System.out)
.readOutput(true);
+
+ if (customizer != null) {
+ customizer.accept(executor);
+ }
}
public ProcessResult execute() throws InterruptedException, TimeoutException, IOException {