Fixed degrade i18n's testcase for time span.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@7142 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
cactusman committed 2008-02-17 02:26:16 +00:00
1 parent fab3269cab
commit f326aae8b5
1 file changed
+6 -6
+6 -6
View File
@@ -37,18 +37,18 @@ public class UtilTest extends TestCase {
// We're still working on the assumption that a month is 30 days, so there will
// be 5 days at the end of the year that will be "12 months" but not "1 year".
// First check 359 days.
assertEquals("11 " + Messages.Util_month(), Util.getTimeSpanString(31017600000L));
assertEquals("11 " + Messages.Util_month() + Messages.Util_timeSuffix(), Util.getTimeSpanString(31017600000L));
// And 362 days.
assertEquals("12 " + Messages.Util_month(), Util.getTimeSpanString(31276800000L));
assertEquals("12 " + Messages.Util_month() + Messages.Util_timeSuffix(), Util.getTimeSpanString(31276800000L));
// 11.25 years - Check that if the first unit has 2 or more digits, a second unit isn't used.
assertEquals("11 " + Messages.Util_year(), Util.getTimeSpanString(354780000000L));
assertEquals("11 " + Messages.Util_year() + Messages.Util_timeSuffix(), Util.getTimeSpanString(354780000000L));
// 9.25 years - Check that if the first unit has only 1 digit, a second unit is used.
assertEquals("9 " + Messages.Util_year() + " 3 " + Messages.Util_month(), Util.getTimeSpanString(291708000000L));
assertEquals("9 " + Messages.Util_year() + Messages.Util_timeSuffix() + " 3 " + Messages.Util_month() + Messages.Util_timeSuffix(), Util.getTimeSpanString(291708000000L));
// 67 seconds
assertEquals("1 " + Messages.Util_minute() + " 7 " + Messages.Util_second(), Util.getTimeSpanString(67000L));
assertEquals("1 " + Messages.Util_minute() + " 7 " + Messages.Util_second() + Messages.Util_timeSuffix(), Util.getTimeSpanString(67000L));
// 17 seconds - Check that times less than a minute only use seconds.
assertEquals("17 " + Messages.Util_second(), Util.getTimeSpanString(17000L));
assertEquals("17 " + Messages.Util_second() + Messages.Util_timeSuffix(), Util.getTimeSpanString(17000L));
}
}