use of org.eclipse.che.api.workspace.shared.dto.event.RuntimeLogEvent in project che-server by eclipse-che.
the class KubernetesInternalRuntimeTest method testRepublishContainerOutputAsMachineLogEvents.
@Test
public void testRepublishContainerOutputAsMachineLogEvents() throws Exception {
final MachineLogsPublisher logsPublisher = new MachineLogsPublisher(eventPublisher, machinesCache, IDENTITY);
final PodEvent out1 = mockContainerEventWithoutRandomName(WORKSPACE_POD_NAME, "Pulling", "pulling image", EVENT_CREATION_TIMESTAMP, getCurrentTimestampWithOneHourShiftAhead());
final PodEvent out2 = mockContainerEventWithoutRandomName(WORKSPACE_POD_NAME, "Pulled", "image pulled", EVENT_CREATION_TIMESTAMP, getCurrentTimestampWithOneHourShiftAhead());
final ArgumentCaptor<RuntimeLogEvent> captor = ArgumentCaptor.forClass(RuntimeLogEvent.class);
internalRuntime.doStartMachine(serverResolver);
logsPublisher.handle(out1);
logsPublisher.handle(out2);
verify(eventService, atLeastOnce()).publish(captor.capture());
final ImmutableList<RuntimeLogEvent> machineLogs = ImmutableList.of(asRuntimeLogEvent(out1), asRuntimeLogEvent(out2));
assertTrue(captor.getAllValues().containsAll(machineLogs));
}
use of org.eclipse.che.api.workspace.shared.dto.event.RuntimeLogEvent in project devspaces-images by redhat-developer.
the class KubernetesInternalRuntimeTest method testRepublishContainerOutputAsMachineLogEvents.
@Test
public void testRepublishContainerOutputAsMachineLogEvents() throws Exception {
final MachineLogsPublisher logsPublisher = new MachineLogsPublisher(eventPublisher, machinesCache, IDENTITY);
final PodEvent out1 = mockContainerEventWithoutRandomName(WORKSPACE_POD_NAME, "Pulling", "pulling image", EVENT_CREATION_TIMESTAMP, getCurrentTimestampWithOneHourShiftAhead());
final PodEvent out2 = mockContainerEventWithoutRandomName(WORKSPACE_POD_NAME, "Pulled", "image pulled", EVENT_CREATION_TIMESTAMP, getCurrentTimestampWithOneHourShiftAhead());
final ArgumentCaptor<RuntimeLogEvent> captor = ArgumentCaptor.forClass(RuntimeLogEvent.class);
internalRuntime.doStartMachine(serverResolver);
logsPublisher.handle(out1);
logsPublisher.handle(out2);
verify(eventService, atLeastOnce()).publish(captor.capture());
final ImmutableList<RuntimeLogEvent> machineLogs = ImmutableList.of(asRuntimeLogEvent(out1), asRuntimeLogEvent(out2));
assertTrue(captor.getAllValues().containsAll(machineLogs));
}
Aggregations