Search in sources :

Example 1 with SystemServiceItemStoppedEventDto

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

the class DtoConverterTest method convertsSystemServiceItemStoppedEvent.

@Test
public void convertsSystemServiceItemStoppedEvent() {
    SystemServiceItemStoppedEvent event = new SystemServiceItemStoppedEvent("service1", "workspace1", 3, 5);
    SystemServiceItemStoppedEventDto dto = DtoConverter.asDto(event);
    assertEquals(dto.getType(), EventType.SERVICE_ITEM_STOPPED);
    assertEquals(dto.getService(), event.getServiceName());
    assertEquals(dto.getItem(), event.getItem());
    assertEquals(dto.getCurrent(), event.getCurrent());
    assertEquals(dto.getTotal(), event.getTotal());
}
Also used : SystemServiceItemStoppedEvent(org.eclipse.che.api.system.shared.event.service.SystemServiceItemStoppedEvent) SystemServiceItemStoppedEventDto(org.eclipse.che.api.system.shared.dto.SystemServiceItemStoppedEventDto) Test(org.testng.annotations.Test)

Example 2 with SystemServiceItemStoppedEventDto

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

the class DtoConverter method asDto.

/**
     * Creates {@link SystemServiceItemStoppedEventDto} from event.
     */
public static SystemServiceItemStoppedEventDto asDto(SystemServiceItemStoppedEvent event) {
    SystemServiceItemStoppedEventDto dto = DtoFactory.newDto(SystemServiceItemStoppedEventDto.class);
    dto.setService(event.getServiceName());
    dto.setType(event.getType());
    dto.setCurrent(event.getCurrent());
    dto.setTotal(event.getTotal());
    dto.setItem(event.getItem());
    return dto;
}
Also used : SystemServiceItemStoppedEventDto(org.eclipse.che.api.system.shared.dto.SystemServiceItemStoppedEventDto)

Aggregations

SystemServiceItemStoppedEventDto (org.eclipse.che.api.system.shared.dto.SystemServiceItemStoppedEventDto)2 SystemServiceItemStoppedEvent (org.eclipse.che.api.system.shared.event.service.SystemServiceItemStoppedEvent)1 Test (org.testng.annotations.Test)1