Search in sources :

Example 6 with StackFrameDump

use of org.eclipse.che.api.debug.shared.model.StackFrameDump in project che by eclipse.

the class ZendDbgSessionTest method testSetValue.

@Test(groups = { "zendDbg" }, dependsOnGroups = { "checkPHP" })
public void testSetValue() throws Exception {
    List<Breakpoint> breakpoints = new ArrayList<>();
    Breakpoint bp1 = new BreakpointImpl(ZendDbgLocationHandler.createDBG(dbgHelloFile, 5));
    breakpoints.add(bp1);
    triggerSession(dbgHelloFile, getDbgSettings(false, false), breakpoints);
    awaitBreakpointActivated(bp1);
    awaitSuspend(dbgHelloFile, 5);
    StackFrameDump stackFrameDump = debugger.dumpStackFrame();
    int lastVar = stackFrameDump.getVariables().size() - 1;
    Variable variableToFind = new VariableImpl(null, null, "123", false, new VariablePathImpl(String.valueOf(lastVar)), Collections.emptyList(), false);
    debugger.setValue(variableToFind);
    assertEquals(stackFrameDump.getVariables().get(lastVar).getValue(), "123");
    variableToFind = new VariableImpl(null, null, "\"ABC\"", false, new VariablePathImpl(String.valueOf(lastVar)), Collections.emptyList(), false);
    debugger.setValue(variableToFind);
    assertEquals(stackFrameDump.getVariables().get(lastVar).getValue(), "\"ABC\"");
}
Also used : Breakpoint(org.eclipse.che.api.debug.shared.model.Breakpoint) VariableImpl(org.eclipse.che.api.debug.shared.model.impl.VariableImpl) BreakpointImpl(org.eclipse.che.api.debug.shared.model.impl.BreakpointImpl) Variable(org.eclipse.che.api.debug.shared.model.Variable) VariablePathImpl(org.eclipse.che.api.debug.shared.model.impl.VariablePathImpl) ArrayList(java.util.ArrayList) StackFrameDump(org.eclipse.che.api.debug.shared.model.StackFrameDump) Breakpoint(org.eclipse.che.api.debug.shared.model.Breakpoint) Test(org.testng.annotations.Test)

Aggregations

StackFrameDump (org.eclipse.che.api.debug.shared.model.StackFrameDump)6 VariableImpl (org.eclipse.che.api.debug.shared.model.impl.VariableImpl)3 VariablePathImpl (org.eclipse.che.api.debug.shared.model.impl.VariablePathImpl)3 Test (org.testng.annotations.Test)3 ArrayList (java.util.ArrayList)2 Breakpoint (org.eclipse.che.api.debug.shared.model.Breakpoint)2 Variable (org.eclipse.che.api.debug.shared.model.Variable)2 BreakpointImpl (org.eclipse.che.api.debug.shared.model.impl.BreakpointImpl)2 PromiseError (org.eclipse.che.api.promises.client.PromiseError)2 StackFrameDumpDto (org.eclipse.che.api.debug.shared.dto.StackFrameDumpDto)1 SimpleValue (org.eclipse.che.api.debug.shared.model.SimpleValue)1 VariablePath (org.eclipse.che.api.debug.shared.model.VariablePath)1 ResumeActionImpl (org.eclipse.che.api.debug.shared.model.impl.action.ResumeActionImpl)1 Operation (org.eclipse.che.api.promises.client.Operation)1 OperationException (org.eclipse.che.api.promises.client.OperationException)1 Debugger (org.eclipse.che.ide.debug.Debugger)1 BaseTest (org.eclipse.che.plugin.debugger.ide.BaseTest)1 Test (org.junit.Test)1 Matchers.anyString (org.mockito.Matchers.anyString)1