RFR: 8315960: test/jdk/java/io/File/TempDirDoesNotExist.java leaves test files behind [v7]
Daniel Jeliński
djelinski at openjdk.org
Wed Sep 20 04:40:39 UTC 2023
On Tue, 19 Sep 2023 21:45:13 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:
>> Add a `finally` block to delete the created files.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
>
> 8315960: Fix indentation
test/jdk/java/io/File/TempDirDoesNotExist.java line 153:
> 151: @ParameterizedTest
> 152: @MethodSource("tempDirSource")
> 153: public void existingMessage(int exitValue, String errorMsg,
`exitValue` is always zero, and `errorMsg` is always `WARNING`; do you need to use parameters here?
test/jdk/java/io/File/TempDirDoesNotExist.java line 161:
> 159: @ParameterizedTest
> 160: @MethodSource("noTempDirSource")
> 161: public void nonexistentMessage(int exitValue, String errorMsg,
exitValue is always zero, and errorMsg is always WARNING; do you need to use parameters here?
test/jdk/java/io/File/TempDirDoesNotExist.java line 170:
> 168: @MethodSource("counterSource")
> 169: public void messageCounter(int exitValue, String... options)
> 170: throws Exception {
Suggestion:
public void messageCounter(int exitValue, String... options)
throws Exception {
test/jdk/java/io/File/TempDirDoesNotExist.java line 174:
> 172: List<String> list = originalOutput.asLines().stream().filter(line
> 173: -> line.equalsIgnoreCase(WARNING)).toList();
> 174: if (list.size() != 1 || originalOutput.getExitValue() != exitValue)
(preexisting) the exception message doesn't make much sense in the second case (`originalOutput.getExitValue() != exitValue`)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15757#discussion_r1330970785
PR Review Comment: https://git.openjdk.org/jdk/pull/15757#discussion_r1330970874
PR Review Comment: https://git.openjdk.org/jdk/pull/15757#discussion_r1330979437
PR Review Comment: https://git.openjdk.org/jdk/pull/15757#discussion_r1330973190
More information about the core-libs-dev
mailing list