1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.commons.exec;
21
22 import static org.junit.jupiter.api.Assertions.assertEquals;
23 import static org.junit.jupiter.api.Assertions.assertNotNull;
24 import static org.junit.jupiter.api.Assertions.assertNull;
25
26 import java.time.Duration;
27
28 import org.junit.jupiter.api.Test;
29
30
31
32
33 class ExecuteWatchdogTest {
34
35 @Test
36 void testBuilder() {
37 assertNotNull(ExecuteWatchdog.builder().get());
38 assertNull(ExecuteWatchdog.builder().get().getWatchdog());
39 assertNotNull(ExecuteWatchdog.builder().setTimeout(null).get());
40 assertEquals(Duration.ofMinutes(1), ExecuteWatchdog.builder().setTimeout(Duration.ofMinutes(1)).get().getWatchdog().getTimeout());
41 assertNotNull(ExecuteWatchdog.builder().setThreadFactory(null).get());
42 assertNotNull(ExecuteWatchdog.builder().setThreadFactory(null).setTimeout(Duration.ofMinutes(1)).get().getWatchdog().getThreadFactory());
43 }
44 }