PacketBuffer { public long getAge() { lock.lock(); try { return tempFileCreateTime == null ? 0 : dateSupplier.get().getTime() - tempFileCreateTime; } finally { lock.unlock(); } } PacketBuffer(); void setTempFileGenerator(TempFileGenerator tempFileGenerator); void setOutputStreamFactory(OutputStreamFactory outputStreamFactory); void setMaxIncompleteFrameBytes(long maxIncompleteFrameBytes); @Override String toString(); void reset(); long getAge(); long getByteCount(); void write(byte[] rawPacket); void frameComplete(FrameType frameType); RotateResult rotate(RolloverCondition rolloverCondition); RotateResult flushAndRotate(); void cancelTimer(); static final long ACTIVITY_TIMEOUT; }
@Test public void testGetAgeInitial() { assertThat(packetBuffer.getAge(), is(0L)); }