Search in sources :

Example 1 with StepOutActionDto

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

the class DebuggerTest method testStepOut.

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

Example 2 with StepOutActionDto

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

the class AbstractDebugger method stepOut.

@Override
public void stepOut() {
    if (isConnected()) {
        for (DebuggerObserver observer : observers) {
            observer.onPreStepOut();
        }
        removeCurrentLocation();
        preserveDebuggerState();
        StepOutActionDto action = dtoFactory.createDto(StepOutActionDto.class);
        action.setType(Action.TYPE.STEP_OUT);
        Promise<Void> promise = service.stepOut(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) StepOutActionDto(org.eclipse.che.api.debug.shared.dto.action.StepOutActionDto) DebuggerObserver(org.eclipse.che.ide.debug.DebuggerObserver) OperationException(org.eclipse.che.api.promises.client.OperationException)

Aggregations

StepOutActionDto (org.eclipse.che.api.debug.shared.dto.action.StepOutActionDto)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