OpenJDK / jdk / jdk
changeset 54575:84054d68bf85
8222713: Add OutputAnalyzer(Path) constructor
Reviewed-by: dholmes, coleenp
author | stefank |
---|---|
date | Thu, 18 Apr 2019 09:27:28 +0200 |
parents | 7b74bbe5085b |
children | aa626cbadf1b |
files | test/lib/jdk/test/lib/process/OutputAnalyzer.java |
diffstat | 1 files changed, 12 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/test/lib/jdk/test/lib/process/OutputAnalyzer.java Wed Apr 17 07:41:09 2019 +0200 +++ b/test/lib/jdk/test/lib/process/OutputAnalyzer.java Thu Apr 18 09:27:28 2019 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,8 @@ import java.io.IOException; import java.io.PrintStream; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; @@ -59,6 +61,15 @@ /** * Create an OutputAnalyzer, a utility class for verifying output * + * @param file File to analyze + */ + public OutputAnalyzer(Path file) throws IOException { + this(Files.readString(file)); + } + + /** + * Create an OutputAnalyzer, a utility class for verifying output + * * @param stdout stdout buffer to analyze * @param stderr stderr buffer to analyze */