private TimeCounter timeCounter;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
timeCounter = new TimeCounter();
}
* - tm1 at time 2 ms
* - tm2 at time 4 ms
* - tm3 at time 9 ms
- *
* awaited average time:
* - tm1 = 2/1 = 2 ms
* - tm2 = 4/2 = 2 ms
* - tm3 = 9/3 = 3 ms
- *
* But this times are only theoretical if whole test is executed without latency and atomically. Therefore awaited
* average times can't be compared to exact values of awaited average time (therefore == was replaced with >=)
- * @throws Exception
+ * @throws Exception if interrupted
*/
@Test
- public void testGetAverageTimeBetweenMarks() throws Exception {
+ public void testGetAverageTimeBetweenMarks() {
Assert.assertEquals(0, timeCounter.getAverageTimeBetweenMarks());
timeCounter.markStart();
Assert.assertEquals(0, timeCounter.getAverageTimeBetweenMarks());
Assert.assertTrue(timeCounter.getAverageTimeBetweenMarks() >= 3);
}
- private void zzz(long length) {
+ private static void zzz(long length) {
try {
Thread.sleep(length);
} catch (InterruptedException e) {