RFR: 8273242: (test) Refactor to use TestNG for RuntimeTests ExecCommand tests [v2]

Roger Riggs rriggs at openjdk.java.net
Wed Sep 8 19:36:14 UTC 2021


On Tue, 7 Sep 2021 22:01:54 GMT, Lance Andersen <lancea at openjdk.org> wrote:

>> Roger Riggs has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
>> 
>>  - Simplify file deletion
>>    Add enum to document test modes.
>>  - Merge branch 'master' into 8273242-execcommand-refactor
>>  - 8273242: Refactored ExecCommand to use TestNG DataProvider for cases
>
> test/jdk/java/lang/RuntimeTests/exec/ExecCommand.java line 107:
> 
>> 105:     private static void deleteOut(String path) {
>> 106:         try {
>> 107:             Files.delete(FileSystems.getDefault().getPath(path));
> 
> More of a curious question, is there a reason you couldn't use Files::deleteIfExists or Path.of() instead of FileSystems.getDefault....

That code is pre-existing.  Your suggestion can completely replace the deleteOut method.  Tnx

-------------

PR: https://git.openjdk.java.net/jdk/pull/5335


More information about the core-libs-dev mailing list