Search in sources :

Example 1 with StepIntoActionDto

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

the class AbstractDebugger method stepInto.

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

Example 2 with StepIntoActionDto

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

the class DebuggerTest method testStepInto.

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

Aggregations

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