Search in sources :

Example 11 with DebuggerEvent

use of org.eclipse.che.api.debug.shared.model.event.DebuggerEvent in project che by eclipse.

the class GdbDebuggerTest method stepOver.

private void stepOver() throws DebuggerException, InterruptedException {
    gdbDebugger.stepOver(new StepOverActionImpl());
    DebuggerEvent debuggerEvent = events.take();
    assertTrue(debuggerEvent instanceof SuspendEvent);
    SuspendEvent suspendEvent = (SuspendEvent) debuggerEvent;
    assertEquals(suspendEvent.getLocation().getTarget(), "h.cpp");
    assertEquals(suspendEvent.getLocation().getLineNumber(), 5);
    gdbDebugger.stepOver(new StepOverActionImpl());
    debuggerEvent = events.take();
    assertTrue(debuggerEvent instanceof SuspendEvent);
    suspendEvent = (SuspendEvent) debuggerEvent;
    assertEquals(suspendEvent.getLocation().getTarget(), "h.cpp");
    assertEquals(suspendEvent.getLocation().getLineNumber(), 6);
    gdbDebugger.stepOver(new StepOverActionImpl());
    debuggerEvent = events.take();
    assertTrue(debuggerEvent instanceof SuspendEvent);
    suspendEvent = (SuspendEvent) debuggerEvent;
    assertEquals(suspendEvent.getLocation().getTarget(), "h.cpp");
    assertEquals(suspendEvent.getLocation().getLineNumber(), 7);
}
Also used : StepOverActionImpl(org.eclipse.che.api.debug.shared.model.impl.action.StepOverActionImpl) SuspendEvent(org.eclipse.che.api.debug.shared.model.event.SuspendEvent) DebuggerEvent(org.eclipse.che.api.debug.shared.model.event.DebuggerEvent)

Example 12 with DebuggerEvent

use of org.eclipse.che.api.debug.shared.model.event.DebuggerEvent in project che by eclipse.

the class GdbDebuggerTest method stepOut.

private void stepOut() throws DebuggerException, InterruptedException {
    try {
        gdbDebugger.stepOut(new StepOutActionImpl());
    } catch (DebuggerException e) {
    // ignore
    }
    DebuggerEvent debuggerEvent = events.take();
    assertTrue(debuggerEvent instanceof SuspendEvent);
}
Also used : SuspendEvent(org.eclipse.che.api.debug.shared.model.event.SuspendEvent) DebuggerException(org.eclipse.che.api.debugger.server.exceptions.DebuggerException) StepOutActionImpl(org.eclipse.che.api.debug.shared.model.impl.action.StepOutActionImpl) DebuggerEvent(org.eclipse.che.api.debug.shared.model.event.DebuggerEvent)

Example 13 with DebuggerEvent

use of org.eclipse.che.api.debug.shared.model.event.DebuggerEvent in project che by eclipse.

the class AbstractZendDbgSessionTest method awaitSuspend.

protected void awaitSuspend(String dbgFile, int lineNumber) throws Exception {
    DebuggerEvent debuggerEvent = dbgEvents.poll(5, TimeUnit.SECONDS);
    if (debuggerEvent == null) {
        throw new Exception("Suspend event timeout occurred.");
    }
    assertTrue(debuggerEvent instanceof SuspendEvent);
    SuspendEvent suspendEvent = (SuspendEvent) debuggerEvent;
    assertEquals(suspendEvent.getLocation().getResourcePath(), dbgFile);
    assertEquals(suspendEvent.getLocation().getLineNumber(), lineNumber);
}
Also used : SuspendEvent(org.eclipse.che.api.debug.shared.model.event.SuspendEvent) DebuggerEvent(org.eclipse.che.api.debug.shared.model.event.DebuggerEvent)

Example 14 with DebuggerEvent

use of org.eclipse.che.api.debug.shared.model.event.DebuggerEvent in project che by eclipse.

the class NodeJsDebuggerTest method testResume.

@Test
public void testResume() throws Exception {
    debugger.resume(new ResumeActionImpl());
    ArgumentCaptor<DebuggerEvent> eventCaptor = ArgumentCaptor.forClass(DebuggerEvent.class);
    verify(callback, timeout(5000)).onEvent(eventCaptor.capture());
    assertTrue(eventCaptor.getValue() != null);
    assertTrue(eventCaptor.getValue() instanceof DisconnectEvent);
}
Also used : ResumeActionImpl(org.eclipse.che.api.debug.shared.model.impl.action.ResumeActionImpl) DebuggerEvent(org.eclipse.che.api.debug.shared.model.event.DebuggerEvent) DisconnectEvent(org.eclipse.che.api.debug.shared.model.event.DisconnectEvent) Test(org.testng.annotations.Test)

Aggregations

DebuggerEvent (org.eclipse.che.api.debug.shared.model.event.DebuggerEvent)14 SuspendEvent (org.eclipse.che.api.debug.shared.model.event.SuspendEvent)7 BreakpointActivatedEvent (org.eclipse.che.api.debug.shared.model.event.BreakpointActivatedEvent)6 Test (org.testng.annotations.Test)6 BreakpointImpl (org.eclipse.che.api.debug.shared.model.impl.BreakpointImpl)5 LocationImpl (org.eclipse.che.api.debug.shared.model.impl.LocationImpl)5 Breakpoint (org.eclipse.che.api.debug.shared.model.Breakpoint)3 Location (org.eclipse.che.api.debug.shared.model.Location)3 DisconnectEvent (org.eclipse.che.api.debug.shared.model.event.DisconnectEvent)3 ResumeActionImpl (org.eclipse.che.api.debug.shared.model.impl.action.ResumeActionImpl)3 StartActionImpl (org.eclipse.che.api.debug.shared.model.impl.action.StartActionImpl)2 StepOutActionImpl (org.eclipse.che.api.debug.shared.model.impl.action.StepOutActionImpl)2 StepOverActionImpl (org.eclipse.che.api.debug.shared.model.impl.action.StepOverActionImpl)2 StepIntoActionImpl (org.eclipse.che.api.debug.shared.model.impl.action.StepIntoActionImpl)1 DebuggerException (org.eclipse.che.api.debugger.server.exceptions.DebuggerException)1