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);
}
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());
}
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);
}
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);
}
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);
}
Aggregations