From 453731d3af1ebf489ba130c14707c6f94436290c Mon Sep 17 00:00:00 2001 From: yuqi Date: Fri, 2 Aug 2024 12:04:16 +0800 Subject: [PATCH] Fix --- .../integration/test/util/CommandExecutor.java | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/integration-test-common/src/test/java/org/apache/gravitino/integration/test/util/CommandExecutor.java b/integration-test-common/src/test/java/org/apache/gravitino/integration/test/util/CommandExecutor.java index 2feab5c67e8..ee2b9d2d341 100644 --- a/integration-test-common/src/test/java/org/apache/gravitino/integration/test/util/CommandExecutor.java +++ b/integration-test-common/src/test/java/org/apache/gravitino/integration/test/util/CommandExecutor.java @@ -17,12 +17,9 @@ package org.apache.gravitino.integration.test.util; import java.io.IOException; -import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; -import java.util.List; import java.util.Map; -import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -45,14 +42,10 @@ public static Object executeCommandLocalHost( ProcessData.TypesOfData type, IGNORE_ERRORS ignore_errors, Map env) { - List subCommandsAsList = new ArrayList<>(Arrays.asList(command)); - String mergedCommand = StringUtils.join(subCommandsAsList, " "); - - LOG.info("Sending command \"{}\" to localhost", mergedCommand); - + LOG.info("Sending command \"{}\" to localhost", Arrays.toString(command)); ProcessBuilder processBuilder = new ProcessBuilder(command); processBuilder.environment().putAll(env); - Process process = null; + Process process; try { process = processBuilder.start(); } catch (IOException e) { @@ -66,7 +59,7 @@ public static Object executeCommandLocalHost( if (!printToConsole) LOG.trace(outputOfProcess.toString()); else LOG.debug(outputOfProcess.toString()); if (ignore_errors == IGNORE_ERRORS.FALSE && exit_code != NORMAL_EXIT) { - LOG.error(String.format("Command '%s' failed with exit code %s", mergedCommand, exit_code)); + LOG.error(String.format("Command '%s' failed with exit code %s", Arrays.toString(command), exit_code)); } return outputOfProcess; }