Search in sources :

Example 6 with DebugSessionDto

use of org.eclipse.che.api.debug.shared.dto.DebugSessionDto in project che by eclipse.

the class DebuggerTest method setUp.

@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    super.setUp();
    debuggerDescriptor = new DebuggerDescriptor(NAME + " " + VERSION, HOST + ":" + PORT);
    doReturn(locationDto).when(dtoFactory).createDto(LocationDto.class);
    doReturn(breakpointDto).when(dtoFactory).createDto(BreakpointDto.class);
    doReturn(locationDto).when(breakpointDto).getLocation();
    doReturn(messageBus).when(messageBusProvider).getMachineMessageBus();
    doReturn(localStorage).when(localStorageProvider).get();
    doReturn(DEBUG_INFO).when(localStorage).getItem(AbstractDebugger.LOCAL_STORAGE_DEBUGGER_SESSION_KEY);
    doReturn(debugSessionDto).when(dtoFactory).createDtoFromJson(anyString(), eq(DebugSessionDto.class));
    doReturn(Path.valueOf(PATH)).when(file).getLocation();
    debugger = new TestDebugger(service, dtoFactory, localStorageProvider, messageBusProvider, eventBus, activeFileHandler, debuggerManager, notificationManager, "id");
    doReturn(promiseInfo).when(service).getSessionInfo(SESSION_ID);
    doReturn(promiseInfo).when(promiseInfo).then(any(Operation.class));
    // setup messageBus
    verify(eventBus).addHandler(eq(WsAgentStateEvent.TYPE), extServerStateHandlerCaptor.capture());
    extServerStateHandlerCaptor.getValue().onWsAgentStarted(WsAgentStateEvent.createWsAgentStartedEvent());
    debugger.addObserver(observer);
    FileType fileType = mock(FileType.class);
    doReturn("java").when(fileType).getExtension();
}
Also used : FileType(org.eclipse.che.ide.api.filetypes.FileType) DebugSessionDto(org.eclipse.che.api.debug.shared.dto.DebugSessionDto) DebuggerDescriptor(org.eclipse.che.ide.debug.DebuggerDescriptor) Operation(org.eclipse.che.api.promises.client.Operation) Before(org.junit.Before)

Aggregations

DebugSessionDto (org.eclipse.che.api.debug.shared.dto.DebugSessionDto)6 DebuggerInfo (org.eclipse.che.api.debug.shared.model.DebuggerInfo)3 OperationException (org.eclipse.che.api.promises.client.OperationException)3 PromiseError (org.eclipse.che.api.promises.client.PromiseError)3 DebuggerDescriptor (org.eclipse.che.ide.debug.DebuggerDescriptor)3 Operation (org.eclipse.che.api.promises.client.Operation)2 JsPromiseError (org.eclipse.che.api.promises.client.js.JsPromiseError)2 DebuggerObserver (org.eclipse.che.ide.debug.DebuggerObserver)2 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1 LocationDto (org.eclipse.che.api.debug.shared.dto.LocationDto)1 StartActionDto (org.eclipse.che.api.debug.shared.dto.action.StartActionDto)1 DebuggerEventDto (org.eclipse.che.api.debug.shared.dto.event.DebuggerEventDto)1 VariablePath (org.eclipse.che.api.debug.shared.model.VariablePath)1 Function (org.eclipse.che.api.promises.client.Function)1 Promise (org.eclipse.che.api.promises.client.Promise)1 JsPromise (org.eclipse.che.api.promises.client.js.JsPromise)1 FileType (org.eclipse.che.ide.api.filetypes.FileType)1 WsAgentStateEvent (org.eclipse.che.ide.api.machine.events.WsAgentStateEvent)1