RFR: small testfix: JDK-8220693: jdk/javadoc/doclet/MetaTag/MetaTag.java with unexpected date
Jonathan Gibbons
jonathan.gibbons at oracle.com
Fri Mar 15 19:00:23 UTC 2019
Please review a small test-only fix, to suppress the check for the date
in the generated files when the date has changed since the test started
(i.e.the date was run close to midnight.) And yes, this did just happen!
JBS: https://bugs.openjdk.java.net/browse/JDK-8220693
-- Jon
$ hg diff
diff -r c61f09122d3b test/langtools/jdk/javadoc/doclet/MetaTag/MetaTag.java
--- a/test/langtools/jdk/javadoc/doclet/MetaTag/MetaTag.java Fri Mar
15 18:59:21 2019 +0100
+++ b/test/langtools/jdk/javadoc/doclet/MetaTag/MetaTag.java Fri Mar
15 11:56:19 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());
}
}
More information about the javadoc-dev
mailing list