File tree Expand file tree Collapse file tree
main/java/org/ocpsoft/prettytime
test/java/org/ocpsoft/prettytime Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929 * reedit to Ukrainian with Eclipse). User: Ihor Lavrynuk Date: 2013-01-06 Time: 15:04
3030 *
3131 */
32- public class Resources_ua extends ListResourceBundle implements TimeFormatProvider
32+ public class Resources_uk extends ListResourceBundle implements TimeFormatProvider
3333{
3434 private static final Object [][] OBJECTS = new Object [0 ][0 ];
3535
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ public class JustNow extends ResourcesTimeUnit implements TimeUnit
2323
2424 public JustNow ()
2525 {
26- setMaxQuantity (1000L * 60L * 5L );
26+ setMaxQuantity (1000L * 60L );
2727 }
2828
2929 @ Override
Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ public void testGetUnit()
167167 public void testChangeUnit ()
168168 {
169169 JustNow unit = t .getUnit (JustNow .class );
170- assertEquals (1000L * 60L * 5L , unit .getMaxQuantity ());
170+ assertEquals (1000L * 60L , unit .getMaxQuantity ());
171171 unit .setMaxQuantity (1 );
172172 assertEquals (1 , t .getUnit (JustNow .class ).getMaxQuantity ());
173173 }
Original file line number Diff line number Diff line change 2828/**
2929 * User: Ihor Lavrynuk Date: 2013-01-05 Time: 16:57
3030 */
31- public class PrettyTimeI18n_UA_Test
31+ public class PrettyTimeI18n_uk_Test
3232{
3333 private final SimpleDateFormat format = new SimpleDateFormat ("dd/MM/yyyy" );
3434 private Locale locale ;
3535
3636 @ Before
3737 public void setUp () throws Exception
3838 {
39- locale = new Locale ("ua " );
39+ locale = new Locale ("uk " );
4040 Locale .setDefault (locale );
4141 }
4242
Original file line number Diff line number Diff line change @@ -67,6 +67,16 @@ public void testRightNow() throws Exception
6767 Assert .assertEquals ("moments from now" , t .format (new Date ()));
6868 }
6969
70+ @ Test
71+ public void testCalculatePreciceDuration () throws Exception
72+ {
73+ PrettyTime t = new PrettyTime ();
74+ List <Duration > preciseDuration = t .calculatePreciseDuration (
75+ new Date (System .currentTimeMillis () - (2 * 60 * 60 * 1000 ) - (2 * 60 * 1000 )));
76+ Assert .assertEquals ("2 hours 2 minutes ago" , t .format (preciseDuration ));
77+ Assert .assertEquals ("2 hours 2 minutes" , t .formatDuration (preciseDuration ));
78+ }
79+
7080 @ Test
7181 public void testRightNowVariance () throws Exception
7282 {
You can’t perform that action at this time.
0 commit comments