Exemplo n.º 1
0
 public void tooLongForALong() {
   try {
     ShortDuration.valueOf("106751.99116730064592 days");
     fail();
   } catch (ArithmeticException expected) {
   }
 }
Exemplo n.º 2
0
 private void testIt(long i, String s, String p) {
   ShortDuration d = ShortDuration.valueOf(s);
   assertEquals(i, d.to(TimeUnit.NANOSECONDS));
   assertEquals(p, d.toString());
 }