Package com.linkedin.venice.utils
Class TestMockTime
- java.lang.Object
-
- com.linkedin.venice.utils.TestMockTime
-
- All Implemented Interfaces:
Time
,io.tehuti.utils.Time
public class TestMockTime extends java.lang.Object implements Time, io.tehuti.utils.Time
ATime
implementation which abstracts logical time away from real time, so that it can be deterministically controlled. Useful for tests which are timing-dependent.
-
-
Field Summary
-
Fields inherited from interface com.linkedin.venice.utils.Time
HOURS_PER_DAY, MINUTES_PER_HOUR, MS_PER_DAY, MS_PER_HOUR, MS_PER_MINUTE, MS_PER_SECOND, NS_PER_MS, NS_PER_SECOND, NS_PER_US, SECONDS_PER_DAY, SECONDS_PER_HOUR, SECONDS_PER_MINUTE, US_PER_MS, US_PER_SECOND
-
-
Constructor Summary
Constructors Constructor Description TestMockTime()
TestMockTime(long time)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMilliseconds(long ms)
long
getMilliseconds()
long
getNanoseconds()
long
milliseconds()
For interop with Tehuti's Time abstractionlong
nanoseconds()
For interop with Tehuti's Time abstractionvoid
setTime(long ms)
void
sleep(long ms)
-
-
-
Method Detail
-
getMilliseconds
public long getMilliseconds()
- Specified by:
getMilliseconds
in interfaceTime
-
getNanoseconds
public long getNanoseconds()
- Specified by:
getNanoseconds
in interfaceTime
-
sleep
public void sleep(long ms)
-
setTime
public void setTime(long ms)
-
addMilliseconds
public void addMilliseconds(long ms)
-
milliseconds
public long milliseconds()
For interop with Tehuti's Time abstraction- Specified by:
milliseconds
in interfaceio.tehuti.utils.Time
-
nanoseconds
public long nanoseconds()
For interop with Tehuti's Time abstraction- Specified by:
nanoseconds
in interfaceio.tehuti.utils.Time
-
-