#LANG-59 fails under JDK 1.3, so much as with the earlier code in this class, I've modified it so that it only runs with 1.4 and above. A warning is output, and I improved the other warning message at the same time.

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@447778 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Henri Yandell 2006-09-19 08:18:02 +00:00
parent 8c71182f37
commit 4b25008ec5
1 changed files with 5 additions and 1 deletions

View File

@ -686,7 +686,7 @@ public class DateUtilsTest extends TestCase {
dateTimeParser.parse("March 30, 2003 04:00:00.000"), dateTimeParser.parse("March 30, 2003 04:00:00.000"),
DateUtils.round((Object) cal7, Calendar.HOUR_OF_DAY)); DateUtils.round((Object) cal7, Calendar.HOUR_OF_DAY));
} else { } else {
this.warn("Some date rounding tests not run since the current version is " + SystemUtils.JAVA_VERSION); this.warn("WARNING: Some date rounding tests not run since the current version is " + SystemUtils.JAVA_VERSION);
} }
TimeZone.setDefault(defaultZone); TimeZone.setDefault(defaultZone);
dateTimeParser.setTimeZone(defaultZone); dateTimeParser.setTimeZone(defaultZone);
@ -889,6 +889,10 @@ public class DateUtilsTest extends TestCase {
* see http://issues.apache.org/jira/browse/LANG-59 * see http://issues.apache.org/jira/browse/LANG-59
*/ */
public void testTruncateLang59() throws Exception { public void testTruncateLang59() throws Exception {
if (!SystemUtils.isJavaVersionAtLeast(1.4f)) {
this.warn("WARNING: Test for LANG-59 not run since the current version is " + SystemUtils.JAVA_VERSION);
return;
}
// Set TimeZone to Mountain Time // Set TimeZone to Mountain Time
TimeZone MST_MDT = TimeZone.getTimeZone("MST7MDT"); TimeZone MST_MDT = TimeZone.getTimeZone("MST7MDT");