# HG changeset patch # User weijun # Date 1204987874 -28800 # Node ID 2f9e71bc1bac62d20315c80b85635752f1d39c94 # Parent 12ba8f0d14947e7862b6be46f367c408be8afa4e 6643094: Test on keytool -startdate forgets about December Reviewed-by: xuelei diff -r 12ba8f0d1494 -r 2f9e71bc1bac jdk/test/sun/security/tools/keytool/StartDateTest.java --- a/jdk/test/sun/security/tools/keytool/StartDateTest.java Sat Mar 08 22:49:45 2008 +0800 +++ b/jdk/test/sun/security/tools/keytool/StartDateTest.java Sat Mar 08 22:51:14 2008 +0800 @@ -52,15 +52,15 @@ 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();