Search in sources :

Example 6 with BreakpointActivatedEvent

use of org.eclipse.che.api.debug.shared.model.event.BreakpointActivatedEvent 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 7 with BreakpointActivatedEvent

use of org.eclipse.che.api.debug.shared.model.event.BreakpointActivatedEvent 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)

Aggregations

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