public interface Expect extends SimulationTick
SimulationTick
that verifies the scheduler did something.Modifier and Type | Method and Description |
---|---|
static Expect |
allPlansComplete()
Verifies that the scheduler's plans are all complete -- that there's no pending work.
|
static Expect |
declinedLastOffer()
Verifies that the last offer sent to the scheduler was declined.
|
void |
expect(ClusterState state,
SchedulerDriver mockDriver)
Verifies that a certain event had occurred, optionally updating the provided
ClusterState with a result. |
static Expect |
knownTasks(Persister persisterWithTasks,
java.lang.String... taskNames)
Verifies that the scheduler's list of tasks in the state store matches the provided set.
|
static Expect |
launchedTasks(java.util.Collection<java.lang.String> taskNames)
Verifies that a pod was launched with exactly the provided task names.
|
static Expect |
launchedTasks(java.lang.String... taskNames)
Verifies that a pod was launched with exactly the provided task names.
|
static Expect |
planStatus(java.lang.String planName,
Status status) |
static Expect |
reconciledExplicitly(Persister persisterWithStatuses)
Verifies that an explicit task reconciliation for the task statuses in the provided persister was invoked.
|
static Expect |
reconciledImplicitly()
Verifies that an implicit task reconciliation was invoked.
|
static Expect |
recoveryStepStatus(java.lang.String phaseName,
java.lang.String stepName,
Status expectedStatus)
Verifies that the indicated recovery phase.step has the expected status.
|
static Expect |
stepStatus(java.lang.String planName,
java.lang.String phaseName,
java.lang.String stepName,
Status expectedStatus)
Verifies that the indicated plan.phase.step has the expected status.
|
static Expect |
taskIdKilled(java.lang.String taskId) |
static Expect |
taskNameKilled(java.lang.String taskName)
Verifies that the specified task was killed.
|
static Expect |
taskNameNotKilled(java.lang.String taskName)
Verifies that the specified task was not killed.
|
static Expect |
unreservedTasks(java.util.Collection<java.lang.String> taskNames)
Verifies that the resources for the provided task names have been unreserved.
|
static Expect |
unreservedTasks(java.lang.String... taskNames)
Verifies that the resources for the provided task names have been unreserved.
|
getDescription
static Expect declinedLastOffer()
static Expect launchedTasks(java.lang.String... taskNames)
static Expect launchedTasks(java.util.Collection<java.lang.String> taskNames)
static Expect unreservedTasks(java.lang.String... taskNames)
static Expect unreservedTasks(java.util.Collection<java.lang.String> taskNames)
static Expect taskNameKilled(java.lang.String taskName)
static Expect taskIdKilled(java.lang.String taskId)
static Expect taskNameNotKilled(java.lang.String taskName)
static Expect reconciledExplicitly(Persister persisterWithStatuses)
static Expect reconciledImplicitly()
static Expect allPlansComplete()
static Expect recoveryStepStatus(java.lang.String phaseName, java.lang.String stepName, Status expectedStatus)
static Expect stepStatus(java.lang.String planName, java.lang.String phaseName, java.lang.String stepName, Status expectedStatus)
static Expect knownTasks(Persister persisterWithTasks, java.lang.String... taskNames)
void expect(ClusterState state, SchedulerDriver mockDriver) throws java.lang.AssertionError
ClusterState
with a result.state
- the simulated cluster's statemockDriver
- a mockito mock which was passed to the Scheduler under testjava.lang.AssertionError
- containing a descriptive error if the validation failed