Class MockSleeper
java.lang.Object
com.google.api.client.testing.util.MockSleeper
- All Implemented Interfaces:
Sleeper
- Since:
- 1.15
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
Number of timessleep(long)
was called.private long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal int
getCount()
Returns the number of timessleep(long)
was called.final long
void
sleep
(long millis) Causes the currently executing thread to sleep (temporarily cease execution) for the specified number of milliseconds as specified inThread.sleep(long)
.
-
Field Details
-
count
private int countNumber of timessleep(long)
was called. -
lastMillis
private long lastMillis
-
-
Constructor Details
-
MockSleeper
public MockSleeper()
-
-
Method Details
-
sleep
Description copied from interface:Sleeper
Causes the currently executing thread to sleep (temporarily cease execution) for the specified number of milliseconds as specified inThread.sleep(long)
.- Specified by:
sleep
in interfaceSleeper
- Parameters:
millis
- length of time to sleep in milliseconds- Throws:
InterruptedException
- if any thread has interrupted the current thread
-
getCount
public final int getCount()Returns the number of timessleep(long)
was called. -
getLastMillis
public final long getLastMillis()
-