OpenJDK / jdk / jdk
changeset 54181:d265655be483
8220693: jdk/javadoc/doclet/MetaTag/MetaTag.java with unexpected date
Reviewed-by: hannesw
author | jjg |
---|---|
date | Mon, 18 Mar 2019 11:50:57 -0700 |
parents | 564043cbe138 |
children | 2e586b74722e |
files | test/langtools/jdk/javadoc/doclet/MetaTag/MetaTag.java |
diffstat | 1 files changed, 9 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/test/langtools/jdk/javadoc/doclet/MetaTag/MetaTag.java Mon Mar 18 17:33:59 2019 +0100 +++ b/test/langtools/jdk/javadoc/doclet/MetaTag/MetaTag.java Mon Mar 18 11:50:57 2019 -0700 @@ -93,14 +93,19 @@ "<meta name=\"keywords\" content=\"Overview, Sample Packages\">"); // NOTE: Hopefully, this regression test is not run at midnight. If the output - // was generated yesterday and this test is run today, the test will fail. - checkOutput("overview-summary.html", found, - "<meta name=\"" + metaNameDate + "\" content=\"" + date() + "\">"); + // was generated yesterday and this test is run today, this check could fail ... + // so make sure the date has not changed since the test started + String date = date(); + if (date.equals(startDate)) { + checkOutput("overview-summary.html", found, + "<meta name=\"" + metaNameDate + "\" content=\"" + date + "\">"); + } } private static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); + private static final String startDate = date(); - String date() { + static String date() { return dateFormat.format(new Date()); } }