Search in sources :

Example 1 with SystemServiceEventDto

use of org.eclipse.che.api.system.shared.dto.SystemServiceEventDto in project che by eclipse.

the class DtoConverter method asDto.

/**
     * Creates {@link SystemServiceEventDto} from event.
     */
public static SystemServiceEventDto asDto(SystemServiceEvent event) {
    SystemServiceEventDto dto = DtoFactory.newDto(SystemServiceEventDto.class);
    dto.setService(event.getServiceName());
    dto.setType(event.getType());
    return dto;
}
Also used : SystemServiceEventDto(org.eclipse.che.api.system.shared.dto.SystemServiceEventDto)

Example 2 with SystemServiceEventDto

use of org.eclipse.che.api.system.shared.dto.SystemServiceEventDto in project che by eclipse.

the class DtoConverterTest method convertsSystemServiceStoppedEvent.

@Test
public void convertsSystemServiceStoppedEvent() {
    SystemServiceStoppedEvent event = new SystemServiceStoppedEvent("service1");
    SystemServiceEventDto dto = DtoConverter.asDto(event);
    assertEquals(dto.getType(), EventType.SERVICE_STOPPED);
    assertEquals(dto.getService(), event.getServiceName());
}
Also used : SystemServiceEventDto(org.eclipse.che.api.system.shared.dto.SystemServiceEventDto) SystemServiceStoppedEvent(org.eclipse.che.api.system.shared.event.service.SystemServiceStoppedEvent) Test(org.testng.annotations.Test)

Example 3 with SystemServiceEventDto

use of org.eclipse.che.api.system.shared.dto.SystemServiceEventDto in project che by eclipse.

the class DtoConverterTest method convertsSystemServiceStoppingEvent.

@Test
public void convertsSystemServiceStoppingEvent() {
    StoppingSystemServiceEvent event = new StoppingSystemServiceEvent("service1");
    SystemServiceEventDto dto = DtoConverter.asDto(event);
    assertEquals(dto.getType(), EventType.STOPPING_SERVICE);
    assertEquals(dto.getService(), event.getServiceName());
}
Also used : SystemServiceEventDto(org.eclipse.che.api.system.shared.dto.SystemServiceEventDto) StoppingSystemServiceEvent(org.eclipse.che.api.system.shared.event.service.StoppingSystemServiceEvent) Test(org.testng.annotations.Test)

Aggregations

SystemServiceEventDto (org.eclipse.che.api.system.shared.dto.SystemServiceEventDto)3 Test (org.testng.annotations.Test)2 StoppingSystemServiceEvent (org.eclipse.che.api.system.shared.event.service.StoppingSystemServiceEvent)1 SystemServiceStoppedEvent (org.eclipse.che.api.system.shared.event.service.SystemServiceStoppedEvent)1