use of org.eclipse.che.api.workspace.server.model.impl.RuntimeIdentityImpl in project che-server by eclipse-che.
the class StartSynchronizerTest method shouldAddSubscribersAfterStart.
@Test
public void shouldAddSubscribersAfterStart() throws Exception {
// given
runtimeId = new RuntimeIdentityImpl("workspace123", "envName", "ownerId", "infraNamespace");
EventService eventService = new EventService();
startSynchronizer = new StartSynchronizer(eventService, 5, runtimeId);
// when
startSynchronizer.start();
// then
assertSubscriberTypesNumber(eventService, 2);
assertSubscribersNumber(eventService, KubernetesRuntimeStoppingEvent.class, 1);
assertSubscribersNumber(eventService, KubernetesRuntimeStoppedEvent.class, 1);
}
use of org.eclipse.che.api.workspace.server.model.impl.RuntimeIdentityImpl in project che-server by eclipse-che.
the class StartSynchronizerTest method shouldUnsubscribeEventsWhenItIscCompleteExceptionally.
@Test
public void shouldUnsubscribeEventsWhenItIscCompleteExceptionally() throws Exception {
// given
runtimeId = new RuntimeIdentityImpl("workspace123", "envName", "ownerId", "infraNamespace");
EventService eventService = new EventService();
startSynchronizer = new StartSynchronizer(eventService, 5, runtimeId);
startSynchronizer.start();
// when
startSynchronizer.completeExceptionally(new Exception());
// then
assertSubscribersNumber(eventService, KubernetesRuntimeStoppingEvent.class, 0);
assertSubscribersNumber(eventService, KubernetesRuntimeStoppedEvent.class, 0);
}
use of org.eclipse.che.api.workspace.server.model.impl.RuntimeIdentityImpl in project che-server by eclipse-che.
the class StartSynchronizerTest method setUp.
@BeforeMethod
public void setUp() {
runtimeId = new RuntimeIdentityImpl("workspace123", "envName", "ownerId", "infraNamespace");
startSynchronizer = new StartSynchronizer(eventService, 5, runtimeId);
}
use of org.eclipse.che.api.workspace.server.model.impl.RuntimeIdentityImpl in project che-server by eclipse-che.
the class KubernetesRuntimeStateCacheTest method shouldReturnEmptyOptionalWhenThereIsNotRuntimeStateWhileStatusRetrieving.
@Test
public void shouldReturnEmptyOptionalWhenThereIsNotRuntimeStateWhileStatusRetrieving() throws Exception {
// when
Optional<WorkspaceStatus> statusOpt = runtimesStatesCache.getStatus(new RuntimeIdentityImpl("non-existent-ws", "defEnv", "acc1", "infraNamespace"));
// then
assertFalse(statusOpt.isPresent());
}
use of org.eclipse.che.api.workspace.server.model.impl.RuntimeIdentityImpl in project che-server by eclipse-che.
the class KubernetesRuntimeStateCacheTest method shouldReturnEmptyCommandsListIfStateDoesNotExist.
@Test
public void shouldReturnEmptyCommandsListIfStateDoesNotExist() throws Exception {
// when
List<? extends Command> commands = runtimesStatesCache.getCommands(new RuntimeIdentityImpl("non-existent-ws", "defEnv", "acc1", "infraNamespace"));
// then
assertTrue(commands.isEmpty());
}
Aggregations