Skip to content

Commit

Permalink
Set parent project version to 20.0.0, correct warns after update #85
Browse files Browse the repository at this point in the history
  • Loading branch information
hdsdi3g committed Apr 16, 2024
1 parent 52ece13 commit 5d46e9e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -463,10 +463,9 @@ public ConversionTool cleanUpOutputFiles(final boolean remove_all, final boolean
})
.map(File::toPath)
.flatMap(dirPath -> {
try (var result = Files.walk(dirPath)
.sorted(reverseOrder())
.map(Path::toFile)) {
return result.toList().stream();
try (var result = Files.walk(dirPath)) {
return result.sorted(reverseOrder())
.map(Path::toFile).toList().stream();
} catch (final IOException e) {
log.error("Can't access to {}", dirPath, e);
return Stream.empty();
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<groupId>tv.hd3g.commons</groupId>
<artifactId>starter</artifactId>
<version>19.0.0</version>
<version>20.0.0</version>
<relativePath />
</parent>

Expand All @@ -25,7 +25,7 @@
</modules>

<properties>
<starter.version>18.0.2</starter.version>
<starter.version>20.0.0</starter.version>
<jaxb-maven-plugin.version>2.0.3</jaxb-maven-plugin.version>
<jaxb-api.version>2.3.1</jaxb-api.version>
<jaxb-runtime.version>2.3.8</jaxb-runtime.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public void postStartupExecution(final ProcesslauncherLifecycle processlauncherL
@Test
void testResultValues() throws Exception {
final var parameters = Parameters.of("-cp", System.getProperty("java.class.path"),
DemoExecIOText.class.getName());
DemoExecIOText.class.getName());
parameters.addParameters(DemoExecIOText.expectedIn);
final var cmd = new CommandLine("java", parameters, executableFinder);
final var ept = new ProcesslauncherBuilder(cmd);
Expand Down Expand Up @@ -167,7 +167,7 @@ void testMaxExecTime() throws Exception {
final var duration = System.currentTimeMillis() - startTime;

MatcherAssert.assertThat(duration, Matchers.lessThan(DemoExecLongSleep.MAX_DURATION
+ 1500)); /** 1500 is a "startup time bonus" */
+ 1500)); /** 1500 is a "startup time bonus" */
assertEquals(EndStatus.TOO_LONG_EXECUTION_TIME, result.getEndStatus());

assertTrue(result.isTooLongTime());
Expand All @@ -192,7 +192,7 @@ void testKill() throws Exception {
final var duration = System.currentTimeMillis() - startTime;

MatcherAssert.assertThat(duration, Matchers.lessThan(DemoExecLongSleep.MAX_DURATION
+ 1500)); /** 1500 is a "startup time bonus" */
+ 1500)); /** 1500 is a "startup time bonus" */
assertEquals(EndStatus.KILLED, result.getEndStatus());

assertFalse(result.isTooLongTime());
Expand Down Expand Up @@ -251,7 +251,7 @@ void testTimesAndProcessProps() throws Exception {
@Test
void testInteractiveHandler() throws Exception {
final var parameters = Parameters.of("-cp", System.getProperty("java.class.path"),
DemoExecInteractive.class.getName());
DemoExecInteractive.class.getName());
parameters.addParameters("foo");
final var cmd = new CommandLine("java", parameters, executableFinder);
final var ept = new ProcesslauncherBuilder(cmd);
Expand Down Expand Up @@ -283,7 +283,7 @@ void testInteractiveHandler() throws Exception {
};

ept.getSetCaptureStandardOutputAsOutputText(CapturedStreams.BOTH_STDOUT_STDERR)
.addObserver(new CapturedStdOutErrTextInteractive(interactive));
.addObserver(new CapturedStdOutErrTextInteractive(interactive));

final var result = ept.start().waitForEnd();

Expand Down Expand Up @@ -312,7 +312,7 @@ void testToString() throws IOException {
@Test
void testCheckExecutionOk() throws InterruptedException, ExecutionException, IOException {
final var parameters = Parameters.of("-cp", System.getProperty("java.class.path"),
DemoExecExitCode.class.getName());
DemoExecExitCode.class.getName());
parameters.addParameters("0");
final var cmd = new CommandLine("java", parameters, executableFinder);
final var ept1 = new ProcesslauncherBuilder(cmd);
Expand All @@ -323,7 +323,7 @@ void testCheckExecutionOk() throws InterruptedException, ExecutionException, IOE
@Test
void testCheckExecutionError() throws InterruptedException, ExecutionException, IOException {
final var parameters = Parameters.of("-cp", System.getProperty("java.class.path"),
DemoExecExitCode.class.getName());
DemoExecExitCode.class.getName());
parameters.addParameters("1");
final var cmd = new CommandLine("java", parameters, executableFinder);
final var result = new ProcesslauncherBuilder(cmd).start();
Expand Down Expand Up @@ -358,13 +358,9 @@ void testDirectStandardOutputStdErrRetention() throws IOException, InterruptedEx
final var errors = new AtomicReference<Exception>();

final InputStreamConsumer stdOutConsumer = (processInputStream, source) -> {
try {
final var lines = IOUtils.readLines(processInputStream, StandardCharsets.UTF_8);
lineCount.set((int) lines.stream().filter(l -> l.equals(DemoExecLongStdOutErr.STD_OUT)).count());
endOk.set(lines.get(lines.size() - 1).equals(DemoExecLongStdOutErr.STD_OUT_END));
} catch (final IOException e) {
errors.set(e);
}
final var lines = IOUtils.readLines(processInputStream, StandardCharsets.UTF_8);
lineCount.set((int) lines.stream().filter(l -> l.equals(DemoExecLongStdOutErr.STD_OUT)).count());
endOk.set(lines.get(lines.size() - 1).equals(DemoExecLongStdOutErr.STD_OUT_END));
};

ept.setCaptureStandardOutput(new DirectStandardOutputStdErrRetention(textRetention, stdOutConsumer));
Expand Down

0 comments on commit 5d46e9e

Please sign in to comment.