From e75aa5c3abdc26625cfb45cb4bab48f34cc9c9df Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Sat, 8 Mar 2008 22:51:14 +0800 Subject: [PATCH] 6643094: Test on keytool -startdate forgets about December Reviewed-by: xuelei --- jdk/test/sun/security/tools/keytool/StartDateTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jdk/test/sun/security/tools/keytool/StartDateTest.java b/jdk/test/sun/security/tools/keytool/StartDateTest.java index 4c47ad724b8..7e3e5bad103 100644 --- a/jdk/test/sun/security/tools/keytool/StartDateTest.java +++ b/jdk/test/sun/security/tools/keytool/StartDateTest.java @@ -52,15 +52,15 @@ public class StartDateTest { cal.setTime(getIssueDate()); System.out.println(cal); if (cal.get(Calendar.YEAR) != year + 1) { - throw new Exception("Function #1 check fails"); + throw new Exception("Function check #1 fails"); } run("-keystore jks -storetype jks -storepass changeit -keypass changeit -alias me " + "-selfcert -startdate +1m"); cal.setTime(getIssueDate()); System.out.println(cal); - if (cal.get(Calendar.MONTH) != month + 1) { - throw new Exception("Function #1 check fails"); + if (cal.get(Calendar.MONTH) != (month + 1) % 12) { + throw new Exception("Function check #2 fails"); } new File("jks").delete();