use of com.google.api.services.clouddebugger.v2.model.Variable in project google-cloud-intellij by GoogleCloudPlatform.
the class CloudStackFrame method computeChildren.
@Override
public void computeChildren(@NotNull XCompositeNode node) {
final XValueChildrenList list = new XValueChildrenList();
List<Variable> arguments = frame.getArguments();
if (arguments != null && arguments.size() > 0) {
for (Variable variable : arguments) {
if (!Strings.isNullOrEmpty(variable.getName())) {
list.add(variable.getName(), new MyValue(variable, variableTable));
}
}
}
List<Variable> locals = frame.getLocals();
if (locals != null && locals.size() > 0) {
for (Variable variable : locals) {
if (!Strings.isNullOrEmpty(variable.getName())) {
list.add(variable.getName(), new MyValue(variable, variableTable));
}
}
}
if (evaluatedExpressions != null && evaluatedExpressions.size() > 0) {
list.addTopGroup(new CustomWatchGroup());
}
node.addChildren(list, true);
}
use of com.google.api.services.clouddebugger.v2.model.Variable in project google-cloud-intellij by GoogleCloudPlatform.
the class CloudExecutionStackTest method testGetTopFrame_nonNull.
@Test
public void testGetTopFrame_nonNull() {
List<StackFrame> frames = new ArrayList<StackFrame>();
StackFrame frame1 = new StackFrame();
SourceLocation location1 = new SourceLocation();
location1.setLine(1);
frame1.setLocation(location1);
List<Variable> variables = new ArrayList<Variable>();
Variable variable = new Variable();
variable.setName("foo");
variables.add(variable);
frame1.setLocals(variables);
StackFrame frame2 = new StackFrame();
SourceLocation location2 = new SourceLocation();
location2.setLine(2);
frame2.setLocation(location2);
frames.add(frame1);
frames.add(frame2);
CloudExecutionStack stack = new CloudExecutionStack(project, "name", frames, null, null);
CloudStackFrame localFrame = stack.getTopFrame();
Assert.assertNotNull(localFrame);
SpyNode node = new SpyNode();
localFrame.computeChildren(node);
Assert.assertEquals(1, node.seenChildren.size());
Assert.assertEquals("foo", node.seenChildren.get(0));
}
Aggregations