@author
266267268269270271272273
} @Test public void testMonthFromNow() throws Exception { PrettyTime t = new PrettyTime(new Date(0), locale); assertEquals("kuukauden päästä", t.format(new Date(1000L * 60 * 60 * 24 * 30 * 1))); }
273274275276277278279280
} @Test public void testMonthAgo() throws Exception { PrettyTime t = new PrettyTime(new Date(1000L * 60 * 60 * 24 * 30 * 1), locale); assertEquals("kuukausi sitten", t.format(new Date(0))); }
280281282283284285286287
} @Test public void testYearsFromNow() throws Exception { PrettyTime t = new PrettyTime(new Date(0), locale); assertEquals("3 vuoden päästä", t.format(new Date(1000L * 60 * 60 * 24 * 365 * 3))); }
287288289290291292293294
} @Test public void testYearsAgo() throws Exception { PrettyTime t = new PrettyTime(new Date(1000L * 60 * 60 * 24 * 365 * 3), locale); assertEquals("3 vuotta sitten", t.format(new Date(0))); }
294295296297298299300301
} @Test public void testYearFromNow() throws Exception { PrettyTime t = new PrettyTime(new Date(0), locale); assertEquals("vuoden päästä", t.format(new Date(1000L * 60 * 60 * 24 * 366 * 1))); }
301302303304305306307308
} @Test public void testYearAgo() throws Exception { PrettyTime t = new PrettyTime(new Date(1000L * 60 * 60 * 24 * 366 * 1), locale); assertEquals("vuosi sitten", t.format(new Date(0))); }
308309310311312313314315
} @Test public void testDecadesFromNow() throws Exception { PrettyTime t = new PrettyTime(new Date(0), locale); assertEquals("3 vuosikymmenen päästä", t.format(new Date(1000L * 60 * 60 * 24 * 365 * 10 * 3))); }
315316317318319320321322
} @Test public void testDecadesAgo() throws Exception { PrettyTime t = new PrettyTime(new Date(1000L * 60 * 60 * 24 * 365 * 10 * 3), locale); assertEquals("3 vuosikymmentä sitten", t.format(new Date(0))); }
322323324325326327328329
} @Test public void testDecadeFromNow() throws Exception { PrettyTime t = new PrettyTime(new Date(0), locale); assertEquals("vuosikymmenen päästä", t.format(new Date(1000L * 60 * 60 * 24 * 365 * 11 * 1))); }
329330331332333334335336
} @Test public void testDecadeAgo() throws Exception { PrettyTime t = new PrettyTime(new Date(1000L * 60 * 60 * 24 * 365 * 11), locale); assertEquals("vuosikymmen sitten", t.format(new Date(0))); }