use of org.eclipse.che.api.debug.shared.model.event.DebuggerEvent in project che by eclipse.
the class GdbDebuggerTest method resume.
private void resume() throws DebuggerException, InterruptedException {
gdbDebugger.resume(new ResumeActionImpl());
DebuggerEvent debuggerEvent = events.take();
assertTrue(debuggerEvent instanceof SuspendEvent);
SuspendEvent suspendEvent = (SuspendEvent) debuggerEvent;
assertEquals(suspendEvent.getLocation().getTarget(), "h.cpp");
assertEquals(suspendEvent.getLocation().getLineNumber(), 7);
}
use of org.eclipse.che.api.debug.shared.model.event.DebuggerEvent in project che by eclipse.
the class JavaDebuggerTest method testAddBreakpoint.
@Test(priority = 3)
public void testAddBreakpoint() throws Exception {
int breakpointsCount = debugger.getAllBreakpoints().size();
debugger.addBreakpoint(new BreakpointImpl(new LocationImpl("com.HelloWorld", 18), false, null));
DebuggerEvent debuggerEvent = events.take();
assertTrue(debuggerEvent instanceof BreakpointActivatedEvent);
Breakpoint breakpoint = ((BreakpointActivatedEvent) debuggerEvent).getBreakpoint();
assertEquals(breakpoint.getLocation().getLineNumber(), 18);
assertEquals(breakpoint.getLocation().getTarget(), "com.HelloWorld");
assertTrue(breakpoint.isEnabled());
assertEquals(debugger.getAllBreakpoints().size(), breakpointsCount + 1);
}
use of org.eclipse.che.api.debug.shared.model.event.DebuggerEvent in project che by eclipse.
the class JavaDebuggerTest method testStartDebugger.
@Test(priority = 2)
public void testStartDebugger() throws Exception {
BreakpointImpl breakpoint = new BreakpointImpl(new LocationImpl("com.HelloWorld", 17), false, null);
debugger.start(new StartActionImpl(singletonList(breakpoint)));
DebuggerEvent debuggerEvent = events.take();
assertTrue(debuggerEvent instanceof BreakpointActivatedEvent);
debuggerEvent = events.take();
assertTrue(debuggerEvent instanceof SuspendEvent);
Location location = ((SuspendEvent) debuggerEvent).getLocation();
assertEquals(location.getLineNumber(), 17);
assertEquals(location.getTarget(), "com.HelloWorld");
}
use of org.eclipse.che.api.debug.shared.model.event.DebuggerEvent in project che by eclipse.
the class JavaDebuggerTest method testSteps.
@Test(priority = 9)
public void testSteps() throws Exception {
debugger.deleteAllBreakpoints();
debugger.addBreakpoint(new BreakpointImpl(new LocationImpl("com.HelloWorld", 20), false, null));
assertTrue(events.take() instanceof BreakpointActivatedEvent);
debugger.resume(new ResumeActionImpl());
DebuggerEvent debuggerEvent = events.take();
assertTrue(debuggerEvent instanceof SuspendEvent);
Location location = ((SuspendEvent) debuggerEvent).getLocation();
assertEquals(location.getTarget(), "com.HelloWorld");
assertEquals(location.getLineNumber(), 20);
assertEquals(location.getExternalResourceId(), -1);
assertEquals(location.getResourceProjectPath(), "/test");
assertEquals(location.getResourcePath(), "/test/src/com/HelloWorld.java");
debugger.stepInto(new StepIntoActionImpl());
debuggerEvent = events.take();
assertTrue(debuggerEvent instanceof SuspendEvent);
location = ((SuspendEvent) debuggerEvent).getLocation();
assertEquals(location.getTarget(), "com.HelloWorld");
assertEquals(location.getLineNumber(), 28);
debugger.stepOut(new StepOutActionImpl());
debuggerEvent = events.take();
assertTrue(debuggerEvent instanceof SuspendEvent);
location = ((SuspendEvent) debuggerEvent).getLocation();
assertEquals(location.getTarget(), "com.HelloWorld");
assertEquals(location.getLineNumber(), 20);
debugger.stepOver(new StepOverActionImpl());
debuggerEvent = events.take();
assertTrue(debuggerEvent instanceof SuspendEvent);
location = ((SuspendEvent) debuggerEvent).getLocation();
assertEquals(location.getTarget(), "com.HelloWorld");
assertEquals(location.getLineNumber(), 21);
debugger.stepOver(new StepOverActionImpl());
debuggerEvent = events.take();
assertTrue(debuggerEvent instanceof SuspendEvent);
location = ((SuspendEvent) debuggerEvent).getLocation();
assertEquals(location.getTarget(), "com.HelloWorld");
assertEquals(location.getLineNumber(), 23);
debugger.stepOver(new StepOverActionImpl());
debuggerEvent = events.take();
assertTrue(debuggerEvent instanceof SuspendEvent);
location = ((SuspendEvent) debuggerEvent).getLocation();
assertEquals(location.getTarget(), "com.HelloWorld");
assertEquals(location.getLineNumber(), 24);
}
use of org.eclipse.che.api.debug.shared.model.event.DebuggerEvent in project che by eclipse.
the class JavaDebuggerTest method testDisconnect.
@Test(priority = 12)
public void testDisconnect() throws Exception {
debugger.disconnect();
DebuggerEvent debuggerEvent = events.take();
assertTrue(debuggerEvent instanceof DisconnectEvent);
}
Aggregations