Search in sources :

Example 1 with ResumeActionImpl

use of org.eclipse.che.api.debug.shared.model.impl.action.ResumeActionImpl 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);
}
Also used : SuspendEvent(org.eclipse.che.api.debug.shared.model.event.SuspendEvent) ResumeActionImpl(org.eclipse.che.api.debug.shared.model.impl.action.ResumeActionImpl) DebuggerEvent(org.eclipse.che.api.debug.shared.model.event.DebuggerEvent)

Example 2 with ResumeActionImpl

use of org.eclipse.che.api.debug.shared.model.impl.action.ResumeActionImpl 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);
}
Also used : BreakpointImpl(org.eclipse.che.api.debug.shared.model.impl.BreakpointImpl) StepIntoActionImpl(org.eclipse.che.api.debug.shared.model.impl.action.StepIntoActionImpl) StepOverActionImpl(org.eclipse.che.api.debug.shared.model.impl.action.StepOverActionImpl) 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) ResumeActionImpl(org.eclipse.che.api.debug.shared.model.impl.action.ResumeActionImpl) StepOutActionImpl(org.eclipse.che.api.debug.shared.model.impl.action.StepOutActionImpl) 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 ResumeActionImpl

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

the class ZendDbgSessionTest method testBreaking.

@Test(groups = { "zendDbg" }, dependsOnGroups = { "checkPHP" })
public void testBreaking() throws Exception {
    List<Breakpoint> breakpoints = new ArrayList<>();
    Breakpoint bp1 = new BreakpointImpl(ZendDbgLocationHandler.createDBG(dbgHelloFile, 4));
    Breakpoint bp2 = new BreakpointImpl(ZendDbgLocationHandler.createDBG(dbgClassesFile, 10));
    breakpoints.add(bp1);
    breakpoints.add(bp2);
    triggerSession(dbgHelloFile, getDbgSettings(false, false), breakpoints);
    awaitBreakpointActivated(bp1);
    awaitBreakpointActivated(bp2);
    awaitSuspend(dbgHelloFile, 4);
    debugger.resume(new ResumeActionImpl());
    awaitSuspend(dbgClassesFile, 10);
}
Also used : Breakpoint(org.eclipse.che.api.debug.shared.model.Breakpoint) BreakpointImpl(org.eclipse.che.api.debug.shared.model.impl.BreakpointImpl) ArrayList(java.util.ArrayList) ResumeActionImpl(org.eclipse.che.api.debug.shared.model.impl.action.ResumeActionImpl) Test(org.testng.annotations.Test)

Example 4 with ResumeActionImpl

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

the class ZendDbgSessionTest method testSslConnection.

@Test(groups = { "zendDbg" }, dependsOnGroups = { "checkPHP" })
public void testSslConnection() throws Exception {
    triggerSession(dbgHelloFile, getDbgSettings(true, true));
    awaitSuspend(dbgHelloFile, 2);
    debugger.resume(new ResumeActionImpl());
}
Also used : ResumeActionImpl(org.eclipse.che.api.debug.shared.model.impl.action.ResumeActionImpl) Test(org.testng.annotations.Test)

Example 5 with ResumeActionImpl

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

the class ZendDbgSessionTest method testVariables.

@Test(groups = { "zendDbg" }, dependsOnGroups = { "checkPHP" })
public void testVariables() throws Exception {
    List<Breakpoint> breakpoints = new ArrayList<>();
    Breakpoint bp1 = new BreakpointImpl(ZendDbgLocationHandler.createDBG(dbgClassesFile, 16));
    Breakpoint bp2 = new BreakpointImpl(ZendDbgLocationHandler.createDBG(dbgClassesFile, 25));
    breakpoints.add(bp1);
    breakpoints.add(bp2);
    triggerSession(dbgHelloFile, getDbgSettings(false, false), breakpoints);
    awaitBreakpointActivated(bp1);
    awaitBreakpointActivated(bp2);
    awaitSuspend(dbgClassesFile, 16);
    StackFrameDump stackFrameDump = debugger.dumpStackFrame();
    assertEquals(stackFrameDump.getVariables().size(), 1);
    assertEquals(stackFrameDump.getVariables().get(0).getName(), "$this");
    assertEquals(stackFrameDump.getVariables().get(0).getValue(), "A");
    assertEquals(stackFrameDump.getVariables().get(0).getType(), "object");
    debugger.resume(new ResumeActionImpl());
    awaitSuspend(dbgClassesFile, 25);
    stackFrameDump = debugger.dumpStackFrame();
    assertEquals(stackFrameDump.getVariables().size(), 3);
    assertEquals(stackFrameDump.getVariables().get(0).getName(), "$this");
    assertEquals(stackFrameDump.getVariables().get(0).getValue(), "B");
    assertEquals(stackFrameDump.getVariables().get(0).getType(), "object");
    assertEquals(stackFrameDump.getVariables().get(1).getName(), "$p");
    assertEquals(stackFrameDump.getVariables().get(1).getValue(), "123");
    assertEquals(stackFrameDump.getVariables().get(1).getType(), "int");
    assertEquals(stackFrameDump.getVariables().get(2).getName(), "$v");
    assertEquals(stackFrameDump.getVariables().get(2).getValue(), "\"B\"");
    assertEquals(stackFrameDump.getVariables().get(2).getType(), "string");
}
Also used : Breakpoint(org.eclipse.che.api.debug.shared.model.Breakpoint) BreakpointImpl(org.eclipse.che.api.debug.shared.model.impl.BreakpointImpl) ArrayList(java.util.ArrayList) StackFrameDump(org.eclipse.che.api.debug.shared.model.StackFrameDump) ResumeActionImpl(org.eclipse.che.api.debug.shared.model.impl.action.ResumeActionImpl) Test(org.testng.annotations.Test)

Aggregations

ResumeActionImpl (org.eclipse.che.api.debug.shared.model.impl.action.ResumeActionImpl)6 Test (org.testng.annotations.Test)5 DebuggerEvent (org.eclipse.che.api.debug.shared.model.event.DebuggerEvent)3 BreakpointImpl (org.eclipse.che.api.debug.shared.model.impl.BreakpointImpl)3 ArrayList (java.util.ArrayList)2 Breakpoint (org.eclipse.che.api.debug.shared.model.Breakpoint)2 SuspendEvent (org.eclipse.che.api.debug.shared.model.event.SuspendEvent)2 Location (org.eclipse.che.api.debug.shared.model.Location)1 StackFrameDump (org.eclipse.che.api.debug.shared.model.StackFrameDump)1 BreakpointActivatedEvent (org.eclipse.che.api.debug.shared.model.event.BreakpointActivatedEvent)1 DisconnectEvent (org.eclipse.che.api.debug.shared.model.event.DisconnectEvent)1 LocationImpl (org.eclipse.che.api.debug.shared.model.impl.LocationImpl)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