Search in sources :

Example 1 with StepOverActionDto

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

the class AbstractDebugger method stepOver.

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

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

Example 2 with StepOverActionDto

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

the class DebuggerTest method testStepOver.

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

Aggregations

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