Author: bayard Date: Tue Dec 19 22:24:00 2006 New Revision: 488929 URL: http://svn.apache.org/viewvc?view=rev&rev=488929 Log: Added a test for the under a day range in formatPeriod
Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DurationFormatUtilsTest.java Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DurationFormatUtilsTest.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DurationFormatUtilsTest.java?view=diff&rev=488929&r1=488928&r2=488929 ============================================================================== --- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DurationFormatUtilsTest.java (original) +++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DurationFormatUtilsTest.java Tue Dec 19 22:24:00 2006 @@ -409,6 +409,21 @@ assertEqualDuration( "09", new int[] { 2005, 11, 31, 0, 0, 0 }, new int[] { 2006, 9, 6, 0, 0, 0 }, "MM"); } + + // Testing the under a day range in DurationFormatUtils.formatPeriod + public void testLowDurations() { + for(int hr=0; hr < 24; hr++) { + for(int min=0; min < 60; min++) { + for(int sec=0; sec < 60; sec++) { + assertEqualDuration( hr + ":" + min + ":" + sec, + new int[] { 2000, 0, 1, 0, 0, 0, 0 }, + new int[] { 2000, 0, 1, hr, min, sec }, + "H:m:s" + ); + } + } + } + } // Attempting to test edge cases in DurationFormatUtils.formatPeriod public void testEdgeDurations() { @@ -538,8 +553,6 @@ c.add(calendarType, 1); } } - - private void assertEqualDuration(String expected, int[] start, int[] end, String format) { assertEqualDuration(null, expected, start, end, format); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]