4546474849505152
Assert.assertTrue(duration >= expectedMillis); } @Test(expected = ClassCastException.class) public void passingWrongTypeForTimeUnitInErasureYieldsException() { BinaryAction action = sleeper; action.perform(1l, new Object()); }
5152535455565758
action.perform(1l, new Object()); } @Test(expected = ClassCastException.class) public void passingWrongTypeForDurationInErasureYieldsException() { BinaryAction action = sleeper; action.perform(new Object(), TimeUnit.MILLISECONDS); }
3738394041424344
} @Test(expected = ClassCastException.class) public void passingWrongTypeForTimeUnitInErasureYieldsException() { final InterruptingEverySecondTimeStrategy interruptingStrategy = new InterruptingEverySecondTimeStrategy(0); BinaryAction action = new SleepAtLeast(interruptingStrategy); action.perform(1l, new Object()); }
4445464748495051
} @Test(expected = ClassCastException.class) public void passingWrongTypeForDurationInErasureYieldsException() { final InterruptingEverySecondTimeStrategy interruptingStrategy = new InterruptingEverySecondTimeStrategy(0); BinaryAction action = new SleepAtLeast(interruptingStrategy); action.perform(new Object(), TimeUnit.MILLISECONDS); }
2728293031323334
Assert.assertEquals(ICE_AGE + 1, currentTimeInMillis); } @Test(expected = ClassCastException.class) public void passingWrongTypeForTimeUnitInErasureYieldsException() { BinaryAction action = new Sleep(clock); action.perform(1l, new Object()); }
3334353637383940
action.perform(1l, new Object()); } @Test(expected = ClassCastException.class) public void passingWrongTypeForDurationInErasureYieldsException() { BinaryAction action = new Sleep(clock); action.perform(new Object(), TimeUnit.MILLISECONDS); }