Package com.linkedin.venice.utils
Class TestMockTime
java.lang.Object
com.linkedin.venice.utils.TestMockTime
- All Implemented Interfaces:
Time
,io.tehuti.utils.Time
A
Time
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
Fields inherited from interface io.tehuti.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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addMilliseconds
(long ms) long
long
long
For interop with Tehuti's Time abstractionlong
For interop with Tehuti's Time abstractionvoid
setTime
(long ms) void
sleep
(long ms)
-
Constructor Details
-
TestMockTime
public TestMockTime() -
TestMockTime
public TestMockTime(long time)
-
-
Method Details
-
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
-