Search in sources :

Example 6 with DebuggerEvent

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

the class AbstractZendDbgSessionTest method awaitBreakpointActivated.

protected void awaitBreakpointActivated(Breakpoint breakpoint) throws Exception {
    DebuggerEvent debuggerEvent = dbgEvents.poll(5, TimeUnit.SECONDS);
    if (debuggerEvent == null) {
        throw new Exception("Breakpoint activated event timeout occurred.");
    }
    assertTrue(debuggerEvent instanceof BreakpointActivatedEvent);
    BreakpointActivatedEvent bpActivatedEvent = (BreakpointActivatedEvent) debuggerEvent;
    assertEquals(bpActivatedEvent.getBreakpoint(), breakpoint);
}
Also used : BreakpointActivatedEvent(org.eclipse.che.api.debug.shared.model.event.BreakpointActivatedEvent) DebuggerEvent(org.eclipse.che.api.debug.shared.model.event.DebuggerEvent)

Example 7 with DebuggerEvent

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

the class JavaDebuggerTest method testGetAllBreakpoints.

@Test(priority = 8)
public void testGetAllBreakpoints() throws Exception {
    assertFalse(debugger.getAllBreakpoints().isEmpty());
    debugger.deleteAllBreakpoints();
    assertTrue(debugger.getAllBreakpoints().isEmpty());
    debugger.addBreakpoint(new BreakpointImpl(new LocationImpl("com.HelloWorld", 18), false, null));
    DebuggerEvent debuggerEvent = events.take();
    assertTrue(debuggerEvent instanceof BreakpointActivatedEvent);
    assertEquals(debugger.getAllBreakpoints().size(), 1);
    Breakpoint breakpoint = debugger.getAllBreakpoints().get(0);
    assertEquals(breakpoint.getLocation().getLineNumber(), 18);
    assertEquals(breakpoint.getLocation().getTarget(), "com.HelloWorld");
    assertTrue(breakpoint.isEnabled());
}
Also used : Breakpoint(org.eclipse.che.api.debug.shared.model.Breakpoint) BreakpointImpl(org.eclipse.che.api.debug.shared.model.impl.BreakpointImpl) LocationImpl(org.eclipse.che.api.debug.shared.model.impl.LocationImpl) BreakpointActivatedEvent(org.eclipse.che.api.debug.shared.model.event.BreakpointActivatedEvent) DebuggerEvent(org.eclipse.che.api.debug.shared.model.event.DebuggerEvent) Test(org.testng.annotations.Test)

Example 8 with DebuggerEvent

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

the class GdbDebuggerTest method disconnect.

private void disconnect() throws DebuggerException, InterruptedException {
    gdbDebugger.disconnect();
    assertEquals(events.size(), 1);
    DebuggerEvent debuggerEvent = events.take();
    assertTrue(debuggerEvent instanceof DisconnectEvent);
}
Also used : DebuggerEvent(org.eclipse.che.api.debug.shared.model.event.DebuggerEvent) DisconnectEvent(org.eclipse.che.api.debug.shared.model.event.DisconnectEvent)

Example 9 with DebuggerEvent

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

the class GdbDebuggerTest method addBreakpoint.

private void addBreakpoint() throws DebuggerException, InterruptedException {
    Location location = new LocationImpl("h.cpp", 7);
    Breakpoint breakpoint = new BreakpointImpl(location);
    gdbDebugger.addBreakpoint(breakpoint);
    assertEquals(events.size(), 1);
    DebuggerEvent debuggerEvent = events.take();
    assertTrue(debuggerEvent instanceof BreakpointActivatedEvent);
    BreakpointActivatedEvent breakpointActivatedEvent = (BreakpointActivatedEvent) debuggerEvent;
    assertEquals(breakpointActivatedEvent.getBreakpoint().getLocation().getTarget(), "h.cpp");
    assertEquals(breakpointActivatedEvent.getBreakpoint().getLocation().getLineNumber(), 7);
}
Also used : Breakpoint(org.eclipse.che.api.debug.shared.model.Breakpoint) BreakpointImpl(org.eclipse.che.api.debug.shared.model.impl.BreakpointImpl) LocationImpl(org.eclipse.che.api.debug.shared.model.impl.LocationImpl) BreakpointActivatedEvent(org.eclipse.che.api.debug.shared.model.event.BreakpointActivatedEvent) DebuggerEvent(org.eclipse.che.api.debug.shared.model.event.DebuggerEvent) Location(org.eclipse.che.api.debug.shared.model.Location)

Example 10 with DebuggerEvent

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

the class GdbDebuggerTest method startDebugger.

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

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