@Test public void testPass() throws InterruptedException{ for(long i = 0; i <= initPos; i++){ long current = System.currentTimeMillis(); offsetNotifier.await(i, waitMili); long ended = System.currentTimeMillis(); Assert.assertTrue(ended - current <= 20); } long current = System.currentTimeMillis(); offsetNotifier.await(initPos + 1, waitMili); long ended = System.currentTimeMillis(); Assert.assertTrue(ended - current >= (0.9 * waitMili)); }
public void await(long startOffset) throws InterruptedException { sync.acquireSharedInterruptibly(startOffset); }
OffsetNotifier { public void await(long startOffset) throws InterruptedException { sync.acquireSharedInterruptibly(startOffset); } }
OffsetNotifier { public void await(long startOffset) throws InterruptedException { sync.acquireSharedInterruptibly(startOffset); } OffsetNotifier(long offset); }
OffsetNotifier { public void await(long startOffset) throws InterruptedException { sync.acquireSharedInterruptibly(startOffset); } OffsetNotifier(long offset); void await(long startOffset); boolean await(long startOffset, long miliSeconds); void offsetIncreased(long newOffset); }
OffsetNotifier { public void await(long startOffset) throws InterruptedException { sync.acquireSharedInterruptibly(startOffset); } OffsetNotifier(long offset); void await(long startOffset); boolean await(long startOffset, long miliSeconds); void offsetIncreased(long newOffset);  }