Search in sources :

Example 6 with VariableImpl

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

VariableImpl (org.eclipse.che.api.debug.shared.model.impl.VariableImpl)6 Variable (org.eclipse.che.api.debug.shared.model.Variable)5 VariablePathImpl (org.eclipse.che.api.debug.shared.model.impl.VariablePathImpl)4 ArrayList (java.util.ArrayList)3 StackFrameDump (org.eclipse.che.api.debug.shared.model.StackFrameDump)3 Breakpoint (org.eclipse.che.api.debug.shared.model.Breakpoint)2 VariablePath (org.eclipse.che.api.debug.shared.model.VariablePath)2 Test (org.testng.annotations.Test)2 IOException (java.io.IOException)1 Map (java.util.Map)1 VariablePathDto (org.eclipse.che.api.debug.shared.dto.VariablePathDto)1 SimpleValue (org.eclipse.che.api.debug.shared.model.SimpleValue)1 BreakpointImpl (org.eclipse.che.api.debug.shared.model.impl.BreakpointImpl)1 FieldImpl (org.eclipse.che.api.debug.shared.model.impl.FieldImpl)1 SimpleValueImpl (org.eclipse.che.api.debug.shared.model.impl.SimpleValueImpl)1 StackFrameDumpImpl (org.eclipse.che.api.debug.shared.model.impl.StackFrameDumpImpl)1 DebuggerException (org.eclipse.che.api.debugger.server.exceptions.DebuggerException)1 Debugger (org.eclipse.che.ide.debug.Debugger)1 GdbParseException (org.eclipse.che.plugin.gdb.server.exception.GdbParseException)1 GdbTerminatedException (org.eclipse.che.plugin.gdb.server.exception.GdbTerminatedException)1