use of com.google.api.services.clouddebugger.v2.model.StackFrame 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