Search in sources :

Example 1 with StackFrame

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));
}
Also used : SourceLocation(com.google.api.services.clouddebugger.v2.model.SourceLocation) Variable(com.google.api.services.clouddebugger.v2.model.Variable) StackFrame(com.google.api.services.clouddebugger.v2.model.StackFrame) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Aggregations

SourceLocation (com.google.api.services.clouddebugger.v2.model.SourceLocation)1 StackFrame (com.google.api.services.clouddebugger.v2.model.StackFrame)1 Variable (com.google.api.services.clouddebugger.v2.model.Variable)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1