use of org.eclipse.che.workspace.infrastructure.kubernetes.model.KubernetesRuntimeState in project devspaces-images by redhat-developer.
the class KubernetesInternalRuntimeTest method shouldScheduleServerCheckersForStartingRuntime.
@Test
public void shouldScheduleServerCheckersForStartingRuntime() throws Exception {
// given
runtimeStatesCache.putIfAbsent(new KubernetesRuntimeState(internalRuntime.getContext().getIdentity(), WorkspaceStatus.STARTING, emptyList()));
// when
internalRuntime.scheduleServersCheckers();
// then
verify(probesScheduler).schedule(any(), any(), any());
}
use of org.eclipse.che.workspace.infrastructure.kubernetes.model.KubernetesRuntimeState in project devspaces-images by redhat-developer.
the class KubernetesInternalRuntimeTest method shouldMarkRuntimeRunning.
@Test
public void shouldMarkRuntimeRunning() throws Exception {
// given
runtimeStatesCache.putIfAbsent(new KubernetesRuntimeState(internalRuntime.getContext().getIdentity(), WorkspaceStatus.STARTING, emptyList()));
// when
internalRuntime.markRunning();
// then
assertEquals(internalRuntime.getStatus(), WorkspaceStatus.RUNNING);
}
use of org.eclipse.che.workspace.infrastructure.kubernetes.model.KubernetesRuntimeState in project devspaces-images by redhat-developer.
the class KubernetesInternalRuntimeTest method shouldMarkRuntimeStopping.
@Test
public void shouldMarkRuntimeStopping() throws Exception {
// given
runtimeStatesCache.putIfAbsent(new KubernetesRuntimeState(internalRuntime.getContext().getIdentity(), WorkspaceStatus.RUNNING, emptyList()));
// when
internalRuntime.markStopping();
// then
assertEquals(internalRuntime.getStatus(), WorkspaceStatus.STOPPING);
}
use of org.eclipse.che.workspace.infrastructure.kubernetes.model.KubernetesRuntimeState in project devspaces-images by redhat-developer.
the class KubernetesInternalRuntimeTest method shouldScheduleServerCheckersForRunningRuntime.
@Test
public void shouldScheduleServerCheckersForRunningRuntime() throws Exception {
// given
runtimeStatesCache.putIfAbsent(new KubernetesRuntimeState(internalRuntime.getContext().getIdentity(), WorkspaceStatus.RUNNING, emptyList()));
// when
internalRuntime.scheduleServersCheckers();
// then
verify(probesScheduler).schedule(any(), any());
}
use of org.eclipse.che.workspace.infrastructure.kubernetes.model.KubernetesRuntimeState in project devspaces-images by redhat-developer.
the class KubernetesInternalRuntimeTest method shouldThrowExceptionWhenTryToMakeNonRunningNorStartingRuntimeAsStopping.
@Test(expectedExceptions = StateException.class, expectedExceptionsMessageRegExp = "The environment must be running or starting", dataProvider = "nonRunningStatuses")
public void shouldThrowExceptionWhenTryToMakeNonRunningNorStartingRuntimeAsStopping(WorkspaceStatus status) throws Exception {
// given
runtimeStatesCache.putIfAbsent(new KubernetesRuntimeState(internalRuntime.getContext().getIdentity(), status, emptyList()));
// when
internalRuntime.markStopping();
}
Aggregations