Search in sources :

Example 1 with ResumeActionDto

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

the class DebuggerTest method testResume.

@Test
public void testResume() throws Exception {
    ResumeActionDto resumeAction = mock(ResumeActionDto.class);
    doReturn(promiseVoid).when(service).resume(SESSION_ID, resumeAction);
    doReturn(resumeAction).when(dtoFactory).createDto(ResumeActionDto.class);
    debugger.resume();
    verify(observer).onPreResume();
    verify(promiseVoid).catchError(operationPromiseErrorCaptor.capture());
    operationPromiseErrorCaptor.getValue().apply(promiseError);
    verify(promiseError).getCause();
    assertTrue(debugger.isConnected());
}
Also used : ResumeActionDto(org.eclipse.che.api.debug.shared.dto.action.ResumeActionDto) BaseTest(org.eclipse.che.plugin.debugger.ide.BaseTest) Test(org.junit.Test)

Example 2 with ResumeActionDto

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

the class AbstractDebugger method resume.

@Override
public void resume() {
    if (isConnected()) {
        for (DebuggerObserver observer : observers) {
            observer.onPreResume();
        }
        removeCurrentLocation();
        preserveDebuggerState();
        ResumeActionDto action = dtoFactory.createDto(ResumeActionDto.class);
        action.setType(Action.TYPE.RESUME);
        Promise<Void> promise = service.resume(debugSessionDto.getId(), action);
        promise.catchError(new Operation<PromiseError>() {

            @Override
            public void apply(PromiseError arg) throws OperationException {
                Log.error(AbstractDebugger.class, arg.getCause());
            }
        });
    }
}
Also used : JsPromiseError(org.eclipse.che.api.promises.client.js.JsPromiseError) PromiseError(org.eclipse.che.api.promises.client.PromiseError) DebuggerObserver(org.eclipse.che.ide.debug.DebuggerObserver) ResumeActionDto(org.eclipse.che.api.debug.shared.dto.action.ResumeActionDto) OperationException(org.eclipse.che.api.promises.client.OperationException)

Aggregations

ResumeActionDto (org.eclipse.che.api.debug.shared.dto.action.ResumeActionDto)2 OperationException (org.eclipse.che.api.promises.client.OperationException)1 PromiseError (org.eclipse.che.api.promises.client.PromiseError)1 JsPromiseError (org.eclipse.che.api.promises.client.js.JsPromiseError)1 DebuggerObserver (org.eclipse.che.ide.debug.DebuggerObserver)1 BaseTest (org.eclipse.che.plugin.debugger.ide.BaseTest)1 Test (org.junit.Test)1