Search in sources :

Example 1 with StartActionImpl

use of org.eclipse.che.api.debug.shared.model.impl.action.StartActionImpl in project che by eclipse.

the class AbstractZendDbgSessionTest method triggerSession.

protected void triggerSession(String dbgFile, ZendDbgSettings dbgSettings, List<Breakpoint> dbgBreakpoints) throws Exception {
    ZendDbgLocationHandler dbgLocationMapper = mock(ZendDbgLocationHandler.class);
    // No need to convert between VFS and DBG for test purposes
    when(dbgLocationMapper.convertToVFS(anyObject())).then(returnsFirstArg());
    when(dbgLocationMapper.convertToDBG(anyObject())).then(returnsFirstArg());
    debugger = new ZendDebugger(dbgSettings, dbgLocationMapper, dbgEvents::add);
    debugger.start(new StartActionImpl(dbgBreakpoints));
    dbgEngineProcess = Runtime.getRuntime().exec("php " + dbgFile, new String[] { dbgSettings.isUseSsslEncryption() ? QUERY_SSL : QUERY_NO_SSL });
}
Also used : StartActionImpl(org.eclipse.che.api.debug.shared.model.impl.action.StartActionImpl)

Example 2 with StartActionImpl

use of org.eclipse.che.api.debug.shared.model.impl.action.StartActionImpl 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");
}
Also used : BreakpointImpl(org.eclipse.che.api.debug.shared.model.impl.BreakpointImpl) SuspendEvent(org.eclipse.che.api.debug.shared.model.event.SuspendEvent) LocationImpl(org.eclipse.che.api.debug.shared.model.impl.LocationImpl) BreakpointActivatedEvent(org.eclipse.che.api.debug.shared.model.event.BreakpointActivatedEvent) StartActionImpl(org.eclipse.che.api.debug.shared.model.impl.action.StartActionImpl) DebuggerEvent(org.eclipse.che.api.debug.shared.model.event.DebuggerEvent) Location(org.eclipse.che.api.debug.shared.model.Location) Test(org.testng.annotations.Test)

Example 3 with StartActionImpl

use of org.eclipse.che.api.debug.shared.model.impl.action.StartActionImpl 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

StartActionImpl (org.eclipse.che.api.debug.shared.model.impl.action.StartActionImpl)3 DebuggerEvent (org.eclipse.che.api.debug.shared.model.event.DebuggerEvent)2 SuspendEvent (org.eclipse.che.api.debug.shared.model.event.SuspendEvent)2 Location (org.eclipse.che.api.debug.shared.model.Location)1 BreakpointActivatedEvent (org.eclipse.che.api.debug.shared.model.event.BreakpointActivatedEvent)1 BreakpointImpl (org.eclipse.che.api.debug.shared.model.impl.BreakpointImpl)1 LocationImpl (org.eclipse.che.api.debug.shared.model.impl.LocationImpl)1 Test (org.testng.annotations.Test)1