This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-exec.git
commit edddc86503044332be65a08037202880f6b3753a Author: Gary D. Gregory <garydgreg...@gmail.com> AuthorDate: Sat May 24 11:24:08 2025 -0400 Use ExecuteWatchdog.Builder.setThreadFactory(ThreadFactory) in the tutorial --- pom.xml | 6 ++++++ src/test/java/org/apache/commons/exec/TutorialTest.java | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index bd773295..3a7ae763 100644 --- a/pom.xml +++ b/pom.xml @@ -90,6 +90,12 @@ limitations under the License. <artifactId>junit-pioneer</artifactId> <scope>test</scope> </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-lang3</artifactId> + <version>3.17.0</version> + <scope>test</scope> + </dependency> </dependencies> <build> <defaultGoal>clean artifact:check-buildplan verify apache-rat:check japicmp:cmp checkstyle:check pmd:cpd-check pmd:check javadoc:javadoc spotbugs:check</defaultGoal> diff --git a/src/test/java/org/apache/commons/exec/TutorialTest.java b/src/test/java/org/apache/commons/exec/TutorialTest.java index 1b16461c..401522e2 100644 --- a/src/test/java/org/apache/commons/exec/TutorialTest.java +++ b/src/test/java/org/apache/commons/exec/TutorialTest.java @@ -27,7 +27,9 @@ import java.nio.file.Path; import java.time.Duration; import java.util.HashMap; import java.util.Map; +import java.util.concurrent.Executors; +import org.apache.commons.lang3.concurrent.BasicThreadFactory; import org.junit.jupiter.api.Test; /** @@ -105,7 +107,12 @@ public class TutorialTest { // create a watchdog if requested if (printJobTimeout.toMillis() > 0) { - watchdog = ExecuteWatchdog.builder().setTimeout(printJobTimeout).get(); + // @formatter:off + watchdog = ExecuteWatchdog.builder() + .setTimeout(printJobTimeout) + .setThreadFactory(new BasicThreadFactory.Builder().build()) + .get(); + // @formatter:on executor.setWatchdog(watchdog); }