Code review comment: The visible type name for the service variable should be `service`

Code before review:
public void globalVariableVisibilityTest() throws BallerinaTestException {
debugTestRunner.resumeProgram(debugHitInfo.getRight(), DebugTestRunner.DebugResumeKind.NEXT_BREAKPOINT);
debugHitInfo = debugTestRunner.waitForDebugHit(10000);
globalVariables = debugTestRunner.fetchVariables(debugHitInfo.getRight(), VariableScope.GLOBAL);
Assert.assertEquals(globalVariables.size(), 14);
debugTestRunner.resumeProgram(debugHitInfo.getRight(), DebugTestRunner.DebugResumeKind.NEXT_BREAKPOINT);
debugHitInfo = debugTestRunner.waitForDebugHit(10000);
globalVariables = debugTestRunner.fetchVariables(debugHitInfo.getRight(), VariableScope.GLOBAL);
localVariables = debugTestRunner.fetchVariables(debugHitInfo.getRight(), VariableScope.LOCAL);
Assert.assertEquals(globalVariables.size(), 14);
debugTestRunner.assertVariable(globalVariables, "nameWithoutType", "Ballerina", "string");
debugTestRunner.assertVariable(globalVariables, "nameWithType", "Ballerina", "string");
debugTestRunner.assertVariable(globalVariables, "nameMap", "map<string> (size = 1)", "map");
debugTestRunner.assertVariable(globalVariables, "nilWithoutType", "()", "nil");
debugTestRunner.assertVariable(globalVariables, "nilWithType", "()", "nil");
debugTestRunner.assertVariable(globalVariables, "RED", "RED", "string");
debugTestRunner.assertVariable(globalVariables, "BLUE", "Blue", "string");
debugTestRunner.assertVariable(globalVariables, "stringValue", "Ballerina", "string");
debugTestRunner.assertVariable(globalVariables, "decimalValue", "100.0", "decimal");
debugTestRunner.assertVariable(globalVariables, "byteValue", "2", "int");
debugTestRunner.assertVariable(globalVariables, "floatValue", "2.0", "float");
debugTestRunner.assertVariable(globalVariables, "jsonVar", "map<json> (size = 2)", "json");
debugTestRunner.assertVariable(globalVariables, " /:@[`{~π_IL", "IL with global var", "string");
debugTestRunner.assertVariable(globalVariables, "port", "9090", "int");
}
@Test(dependsOnMethods = "globalVariableVisibilityTest",
description = "Variable visibility test for local variables at the last line of main() method")
public void localVariableVisibilityTest() {
debugTestRunner.assertVariable(localVariables, "varVariable", "()", "nil");
debugTestRunner.assertVariable(localVariables, "booleanVar", "true", "boolean");
debugTestRunner.assertVariable(localVariables, "intVar", "5", "int");
debugTestRunner.assertVariable(localVariables, "floatVar", "-10.0", "float");
debugTestRunner.assertVariable(localVariables, "decimalVar", "3.5", "decimal");
debugTestRunner.assertVariable(localVariables, "stringVar", "foo", "string");
debugTestRunner.assertVariable(localVariables, "xmlVar",
"<person gender=\"male\"><firstname>Praveen</firstname><lastname>Nada</lastname></person>",
"xml");
debugTestRunner.assertVariable(localVariables, "arrayVar", "any[4]", "array");
debugTestRunner.assertVariable(localVariables, "tupleVar", "tuple[int,string] (size = 2)", "tuple");
debugTestRunner.assertVariable(localVariables, "mapVar", "map<string> (size = 4)", "map");
debugTestRunner.assertVariable(localVariables, "recordVar", " /:@[`{~π_123_ƮέŞŢ_Student", "record");
debugTestRunner.assertVariable(localVariables, "anonRecord",
"record {| string city; string country; |}", "record");
debugTestRunner.assertVariable(localVariables, "errorVar", "SimpleErrorType", "error");
debugTestRunner.assertVariable(localVariables, "anonFunctionVar",
"isolated function (string,string) returns (string)", "function");
debugTestRunner.assertVariable(localVariables, "futureVar", "future<int>", "future");
debugTestRunner.assertVariable(localVariables, "objectVar", "Person_\\ /<>:@[`{~π_ƮέŞŢ", "object");
debugTestRunner.assertVariable(localVariables, "anonObjectVar", "Person_\\ /<>:@[`{~π_ƮέŞŢ", "object");
debugTestRunner.assertVariable(localVariables, "typedescVar", "int", "typedesc");
debugTestRunner.assertVariable(localVariables, "unionVar", "foo", "string");
debugTestRunner.assertVariable(localVariables, "optionalVar", "foo", "string");
debugTestRunner.assertVariable(localVariables, "anyVar", "15.0", "float");
debugTestRunner.assertVariable(localVariables, "anydataVar", "619", "int");
debugTestRunner.assertVariable(localVariables, "byteVar", "128", "int");
debugTestRunner.assertVariable(localVariables, "jsonVar", "map<json> (size = 3)", "json");
debugTestRunner.assertVariable(localVariables, "tableWithKeyVar", "table<Employee> (entries = 3)", "table");
debugTestRunner.assertVariable(localVariables, "tableWithoutKeyVar", "table<Employee> (entries = 3)", "table");
debugTestRunner.assertVariable(localVariables, "oddNumberStream", "stream<int, error>", "stream");
debugTestRunner.assertVariable(localVariables, " /:@[`{~π_var", "IL with special characters in var", "string");
debugTestRunner.assertVariable(localVariables, "üňĩćőđę_var", "IL with unicode characters in var", "string");
debugTestRunner.assertVariable(localVariables, "ĠĿŐΒȂɭ_ /:@[`{~π_json", "map<json> (size = 0)", "json");
debugTestRunner.assertVariable(localVariables, "serviceVar", "service", "object");
}
@Test(dependsOnMethods = "globalVariableVisibilityTest",
description = "Child variable visibility test for local variables at the last line of main() method")
public void localVariableChildrenVisibilityTest() throws BallerinaTestException {
Map<String, Variable> xmlChildVariables = debugTestRunner.fetchChildVariables(localVariables.get("xmlVar"));
debugTestRunner.assertVariable(xmlChildVariables, "attributes", "map", "map");
debugTestRunner.assertVariable(xmlChildVariables, "children", "XMLSequence (size = 2)", "xml");
Map<String, Variable> xmlAttributesChildVariables =
debugTestRunner.fetchChildVariables(xmlChildVariables.get("attributes"));
debugTestRunner.assertVariable(xmlAttributesChildVariables, "gender", "male", "string");
Map<String, Variable> xmlChildrenVariables =
debugTestRunner.fetchChildVariables(xmlChildVariables.get("children"));
debugTestRunner.assertVariable(xmlChildrenVariables, "[0]", "<firstname>Praveen</firstname>", "xml");
debugTestRunner.assertVariable(xmlChildrenVariables, "[1]", "<lastname>Nada</lastname>", "xml");
Map<String, Variable> xmlGrandChildrenVariables =
debugTestRunner.fetchChildVariables(xmlChildrenVariables.get("[0]"));
debugTestRunner.assertVariable(xmlGrandChildrenVariables, "children", "XMLSequence (size = 1)", "xml");
Map<String, Variable> arrayChildVariables = debugTestRunner.fetchChildVariables(localVariables.get("arrayVar"));
debugTestRunner.assertVariable(arrayChildVariables, "[0]", "1", "int");
debugTestRunner.assertVariable(arrayChildVariables, "[1]", "20", "int");
debugTestRunner.assertVariable(arrayChildVariables, "[2]", "-10.0", "float");
debugTestRunner.assertVariable(arrayChildVariables, "[3]", "foo", "string");
Map<String, Variable> byteChildVars = debugTestRunner.fetchChildVariables(localVariables.get("byteArrayVar"));
debugTestRunner.assertVariable(byteChildVars, "[0]", "105", "byte");
debugTestRunner.assertVariable(byteChildVars, "[1]", "166", "byte");
Map<String, Variable> tupleChildVariables = debugTestRunner.fetchChildVariables(localVariables.get("tupleVar"));
debugTestRunner.assertVariable(tupleChildVariables, "[0]", "20", "int");
debugTestRunner.assertVariable(tupleChildVariables, "[1]", "foo", "string");
Map<String, Variable> mapChildVariables = debugTestRunner.fetchChildVariables(localVariables.get("mapVar"));
debugTestRunner.assertVariable(mapChildVariables, "city", "Colombo 03", "string");
debugTestRunner.assertVariable(mapChildVariables, "country", "Sri Lanka", "string");
debugTestRunner.assertVariable(mapChildVariables, "line1", "No. 20", "string");
debugTestRunner.assertVariable(mapChildVariables, "line2", "Palm Grove", "string");
Map<String, Variable> studentRecordChildVariables =
debugTestRunner.fetchChildVariables(localVariables.get("recordVar"));
debugTestRunner.assertVariable(studentRecordChildVariables, "1st_name", "John Doe", "string");
debugTestRunner.assertVariable(studentRecordChildVariables, "grades", "Grades", "record");
debugTestRunner.assertVariable(studentRecordChildVariables, "Ȧɢέ_ /:@[`{~π", "20", "int");
Map<String, Variable> gradesChildVariables =
debugTestRunner.fetchChildVariables(studentRecordChildVariables.get("grades"));
debugTestRunner.assertVariable(gradesChildVariables, "chemistry", "65", "int");
debugTestRunner.assertVariable(gradesChildVariables, "maths", "80", "int");
debugTestRunner.assertVariable(gradesChildVariables, "physics", "75", "int");
Map<String, Variable> recordChildVariables =
debugTestRunner.fetchChildVariables(localVariables.get("anonRecord"));
debugTestRunner.assertVariable(recordChildVariables, "city", "London", "string");
debugTestRunner.assertVariable(recordChildVariables, "country", "UK", "string");
Map<String, Variable> errorChildVariables = debugTestRunner.fetchChildVariables(localVariables.get("errorVar"));
debugTestRunner.assertVariable(errorChildVariables, "details", "map<(ballerina/lang.value:1.0.0:Cloneable " +
"(size = 1)", "map");
debugTestRunner.assertVariable(errorChildVariables, "message", "SimpleErrorType", "string");
Map<String, Variable> errorDetailsChildVariables =
debugTestRunner.fetchChildVariables(errorChildVariables.get("details"));
debugTestRunner.assertVariable(errorDetailsChildVariables, "message", "Simple error occurred", "string");
Map<String, Variable> futureChildVariables =
debugTestRunner.fetchChildVariables(localVariables.get("futureVar"));
debugTestRunner.assertVariable(futureChildVariables, "isDone", "true", "boolean");
debugTestRunner.assertVariable(futureChildVariables, "result", "90", "int");
Map<String, Variable> personObjectChildVariables =
debugTestRunner.fetchChildVariables(localVariables.get("objectVar"));
debugTestRunner.assertVariable(personObjectChildVariables, "1st_name", "John", "string");
debugTestRunner.assertVariable(personObjectChildVariables, "address", "No 20, Palm grove", "string");
debugTestRunner.assertVariable(personObjectChildVariables, "parent", "()", "nil");
debugTestRunner.assertVariable(personObjectChildVariables, "email", "default@abc.com", "string");
debugTestRunner.assertVariable(personObjectChildVariables, "Ȧɢέ_ /:@[`{~π", "0", "int");
Map<String, Variable> anonObjectChildVariables =
debugTestRunner.fetchChildVariables(localVariables.get("anonObjectVar"));
debugTestRunner.assertVariable(anonObjectChildVariables, "1st_name", "John", "string");
debugTestRunner.assertVariable(anonObjectChildVariables, "address", "No 20, Palm grove", "string");
debugTestRunner.assertVariable(anonObjectChildVariables, "parent", "()", "nil");
debugTestRunner.assertVariable(anonObjectChildVariables, "email", "default@abc.com", "string");
debugTestRunner.assertVariable(anonObjectChildVariables, "Ȧɢέ_ /:@[`{~π", "0", "int");
Map<String, Variable> jsonChildVariables = debugTestRunner.fetchChildVariables(localVariables.get("jsonVar"));
debugTestRunner.assertVariable(jsonChildVariables, "color", "red", "string");
debugTestRunner.assertVariable(jsonChildVariables, "name", "apple", "string");
debugTestRunner.assertVariable(jsonChildVariables, "price", "40", "int");
Map<String, Variable> tableWithKeyChildVariables =
debugTestRunner.fetchChildVariables(localVariables.get("tableWithKeyVar"));
debugTestRunner.assertVariable(tableWithKeyChildVariables, "[0]", "Employee", "record");
debugTestRunner.assertVariable(tableWithKeyChildVariables, "[1]", "Employee", "record");
debugTestRunner.assertVariable(tableWithKeyChildVariables, "[2]", "Employee", "record");
Map<String, Variable> tableWithoutKeyChildVariables =
debugTestRunner.fetchChildVariables(localVariables.get("tableWithoutKeyVar"));
debugTestRunner.assertVariable(tableWithoutKeyChildVariables, "[0]", "Employee", "record");
debugTestRunner.assertVariable(tableWithoutKeyChildVariables, "[1]", "Employee", "record");
debugTestRunner.assertVariable(tableWithoutKeyChildVariables, "[2]", "Employee", "record");
Map<String, Variable> serviceChildVariables =
debugTestRunner.fetchChildVariables(localVariables.get("serviceVar"));
debugTestRunner.assertVariable(serviceChildVariables, "i", "5", "int");
}
@AfterClass(alwaysRun = true)
public void cleanUp() {
debugTestRunner.terminateDebugSession();
globalVariables.clear();
localVariables.clear();
}
}

Line under review: debugTestRunner.assertVariable(localVariables, "serviceVar", "service", "object");

Code after addressing the review:
public void globalVariableVisibilityTest() throws BallerinaTestException {
debugTestRunner.resumeProgram(debugHitInfo.getRight(), DebugTestRunner.DebugResumeKind.NEXT_BREAKPOINT);
debugHitInfo = debugTestRunner.waitForDebugHit(10000);
globalVariables = debugTestRunner.fetchVariables(debugHitInfo.getRight(), VariableScope.GLOBAL);
Assert.assertEquals(globalVariables.size(), 14);
debugTestRunner.resumeProgram(debugHitInfo.getRight(), DebugTestRunner.DebugResumeKind.NEXT_BREAKPOINT);
debugHitInfo = debugTestRunner.waitForDebugHit(10000);
globalVariables = debugTestRunner.fetchVariables(debugHitInfo.getRight(), VariableScope.GLOBAL);
localVariables = debugTestRunner.fetchVariables(debugHitInfo.getRight(), VariableScope.LOCAL);
Assert.assertEquals(globalVariables.size(), 14);
debugTestRunner.assertVariable(globalVariables, "nameWithoutType", "Ballerina", "string");
debugTestRunner.assertVariable(globalVariables, "nameWithType", "Ballerina", "string");
debugTestRunner.assertVariable(globalVariables, "nameMap", "map<string> (size = 1)", "map");
debugTestRunner.assertVariable(globalVariables, "nilWithoutType", "()", "nil");
debugTestRunner.assertVariable(globalVariables, "nilWithType", "()", "nil");
debugTestRunner.assertVariable(globalVariables, "RED", "RED", "string");
debugTestRunner.assertVariable(globalVariables, "BLUE", "Blue", "string");
debugTestRunner.assertVariable(globalVariables, "stringValue", "Ballerina", "string");
debugTestRunner.assertVariable(globalVariables, "decimalValue", "100.0", "decimal");
debugTestRunner.assertVariable(globalVariables, "byteValue", "2", "int");
debugTestRunner.assertVariable(globalVariables, "floatValue", "2.0", "float");
debugTestRunner.assertVariable(globalVariables, "jsonVar", "map<json> (size = 2)", "json");
debugTestRunner.assertVariable(globalVariables, " /:@[`{~π_IL", "IL with global var", "string");
debugTestRunner.assertVariable(globalVariables, "port", "9090", "int");
}
@Test(dependsOnMethods = "globalVariableVisibilityTest",
description = "Variable visibility test for local variables at the last line of main() method")
public void localVariableVisibilityTest() {
debugTestRunner.assertVariable(localVariables, "varVariable", "()", "nil");
debugTestRunner.assertVariable(localVariables, "booleanVar", "true", "boolean");
debugTestRunner.assertVariable(localVariables, "intVar", "5", "int");
debugTestRunner.assertVariable(localVariables, "floatVar", "-10.0", "float");
debugTestRunner.assertVariable(localVariables, "decimalVar", "3.5", "decimal");
debugTestRunner.assertVariable(localVariables, "stringVar", "foo", "string");
debugTestRunner.assertVariable(localVariables, "xmlVar",
"<person gender=\"male\"><firstname>Praveen</firstname><lastname>Nada</lastname></person>",
"xml");
debugTestRunner.assertVariable(localVariables, "arrayVar", "any[4]", "array");
debugTestRunner.assertVariable(localVariables, "tupleVar", "tuple[int,string] (size = 2)", "tuple");
debugTestRunner.assertVariable(localVariables, "mapVar", "map<string> (size = 4)", "map");
debugTestRunner.assertVariable(localVariables, "recordVar", " /:@[`{~π_123_ƮέŞŢ_Student", "record");
debugTestRunner.assertVariable(localVariables, "anonRecord",
"record {| string city; string country; |}", "record");
debugTestRunner.assertVariable(localVariables, "errorVar", "SimpleErrorType", "error");
debugTestRunner.assertVariable(localVariables, "anonFunctionVar",
"isolated function (string,string) returns (string)", "function");
debugTestRunner.assertVariable(localVariables, "futureVar", "future<int>", "future");
debugTestRunner.assertVariable(localVariables, "objectVar", "Person_\\ /<>:@[`{~π_ƮέŞŢ", "object");
debugTestRunner.assertVariable(localVariables, "anonObjectVar", "Person_\\ /<>:@[`{~π_ƮέŞŢ", "object");
debugTestRunner.assertVariable(localVariables, "typedescVar", "int", "typedesc");
debugTestRunner.assertVariable(localVariables, "unionVar", "foo", "string");
debugTestRunner.assertVariable(localVariables, "optionalVar", "foo", "string");
debugTestRunner.assertVariable(localVariables, "anyVar", "15.0", "float");
debugTestRunner.assertVariable(localVariables, "anydataVar", "619", "int");
debugTestRunner.assertVariable(localVariables, "byteVar", "128", "int");
debugTestRunner.assertVariable(localVariables, "jsonVar", "map<json> (size = 3)", "json");
debugTestRunner.assertVariable(localVariables, "tableWithKeyVar", "table<Employee> (entries = 3)", "table");
debugTestRunner.assertVariable(localVariables, "tableWithoutKeyVar", "table<Employee> (entries = 3)", "table");
debugTestRunner.assertVariable(localVariables, "oddNumberStream", "stream<int, error>", "stream");
debugTestRunner.assertVariable(localVariables, " /:@[`{~π_var", "IL with special characters in var", "string");
debugTestRunner.assertVariable(localVariables, "üňĩćőđę_var", "IL with unicode characters in var", "string");
debugTestRunner.assertVariable(localVariables, "ĠĿŐΒȂɭ_ /:@[`{~π_json", "map<json> (size = 0)", "json");
debugTestRunner.assertVariable(localVariables, "serviceVar", "service", "service");
}
@Test(dependsOnMethods = "globalVariableVisibilityTest",
description = "Child variable visibility test for local variables at the last line of main() method")
public void localVariableChildrenVisibilityTest() throws BallerinaTestException {
Map<String, Variable> xmlChildVariables = debugTestRunner.fetchChildVariables(localVariables.get("xmlVar"));
debugTestRunner.assertVariable(xmlChildVariables, "attributes", "map", "map");
debugTestRunner.assertVariable(xmlChildVariables, "children", "XMLSequence (size = 2)", "xml");
Map<String, Variable> xmlAttributesChildVariables =
debugTestRunner.fetchChildVariables(xmlChildVariables.get("attributes"));
debugTestRunner.assertVariable(xmlAttributesChildVariables, "gender", "male", "string");
Map<String, Variable> xmlChildrenVariables =
debugTestRunner.fetchChildVariables(xmlChildVariables.get("children"));
debugTestRunner.assertVariable(xmlChildrenVariables, "[0]", "<firstname>Praveen</firstname>", "xml");
debugTestRunner.assertVariable(xmlChildrenVariables, "[1]", "<lastname>Nada</lastname>", "xml");
Map<String, Variable> xmlGrandChildrenVariables =
debugTestRunner.fetchChildVariables(xmlChildrenVariables.get("[0]"));
debugTestRunner.assertVariable(xmlGrandChildrenVariables, "children", "XMLSequence (size = 1)", "xml");
Map<String, Variable> arrayChildVariables = debugTestRunner.fetchChildVariables(localVariables.get("arrayVar"));
debugTestRunner.assertVariable(arrayChildVariables, "[0]", "1", "int");
debugTestRunner.assertVariable(arrayChildVariables, "[1]", "20", "int");
debugTestRunner.assertVariable(arrayChildVariables, "[2]", "-10.0", "float");
debugTestRunner.assertVariable(arrayChildVariables, "[3]", "foo", "string");
Map<String, Variable> byteChildVars = debugTestRunner.fetchChildVariables(localVariables.get("byteArrayVar"));
debugTestRunner.assertVariable(byteChildVars, "[0]", "105", "byte");
debugTestRunner.assertVariable(byteChildVars, "[1]", "166", "byte");
Map<String, Variable> tupleChildVariables = debugTestRunner.fetchChildVariables(localVariables.get("tupleVar"));
debugTestRunner.assertVariable(tupleChildVariables, "[0]", "20", "int");
debugTestRunner.assertVariable(tupleChildVariables, "[1]", "foo", "string");
Map<String, Variable> mapChildVariables = debugTestRunner.fetchChildVariables(localVariables.get("mapVar"));
debugTestRunner.assertVariable(mapChildVariables, "city", "Colombo 03", "string");
debugTestRunner.assertVariable(mapChildVariables, "country", "Sri Lanka", "string");
debugTestRunner.assertVariable(mapChildVariables, "line1", "No. 20", "string");
debugTestRunner.assertVariable(mapChildVariables, "line2", "Palm Grove", "string");
Map<String, Variable> studentRecordChildVariables =
debugTestRunner.fetchChildVariables(localVariables.get("recordVar"));
debugTestRunner.assertVariable(studentRecordChildVariables, "1st_name", "John Doe", "string");
debugTestRunner.assertVariable(studentRecordChildVariables, "grades", "Grades", "record");
debugTestRunner.assertVariable(studentRecordChildVariables, "Ȧɢέ_ /:@[`{~π", "20", "int");
Map<String, Variable> gradesChildVariables =
debugTestRunner.fetchChildVariables(studentRecordChildVariables.get("grades"));
debugTestRunner.assertVariable(gradesChildVariables, "chemistry", "65", "int");
debugTestRunner.assertVariable(gradesChildVariables, "maths", "80", "int");
debugTestRunner.assertVariable(gradesChildVariables, "physics", "75", "int");
Map<String, Variable> recordChildVariables =
debugTestRunner.fetchChildVariables(localVariables.get("anonRecord"));
debugTestRunner.assertVariable(recordChildVariables, "city", "London", "string");
debugTestRunner.assertVariable(recordChildVariables, "country", "UK", "string");
Map<String, Variable> errorChildVariables = debugTestRunner.fetchChildVariables(localVariables.get("errorVar"));
debugTestRunner.assertVariable(errorChildVariables, "details", "map<(ballerina/lang.value:1.0.0:Cloneable " +
"(size = 1)", "map");
debugTestRunner.assertVariable(errorChildVariables, "message", "SimpleErrorType", "string");
Map<String, Variable> errorDetailsChildVariables =
debugTestRunner.fetchChildVariables(errorChildVariables.get("details"));
debugTestRunner.assertVariable(errorDetailsChildVariables, "message", "Simple error occurred", "string");
Map<String, Variable> futureChildVariables =
debugTestRunner.fetchChildVariables(localVariables.get("futureVar"));
debugTestRunner.assertVariable(futureChildVariables, "isDone", "true", "boolean");
debugTestRunner.assertVariable(futureChildVariables, "result", "90", "int");
Map<String, Variable> personObjectChildVariables =
debugTestRunner.fetchChildVariables(localVariables.get("objectVar"));
debugTestRunner.assertVariable(personObjectChildVariables, "1st_name", "John", "string");
debugTestRunner.assertVariable(personObjectChildVariables, "address", "No 20, Palm grove", "string");
debugTestRunner.assertVariable(personObjectChildVariables, "parent", "()", "nil");
debugTestRunner.assertVariable(personObjectChildVariables, "email", "default@abc.com", "string");
debugTestRunner.assertVariable(personObjectChildVariables, "Ȧɢέ_ /:@[`{~π", "0", "int");
Map<String, Variable> anonObjectChildVariables =
debugTestRunner.fetchChildVariables(localVariables.get("anonObjectVar"));
debugTestRunner.assertVariable(anonObjectChildVariables, "1st_name", "John", "string");
debugTestRunner.assertVariable(anonObjectChildVariables, "address", "No 20, Palm grove", "string");
debugTestRunner.assertVariable(anonObjectChildVariables, "parent", "()", "nil");
debugTestRunner.assertVariable(anonObjectChildVariables, "email", "default@abc.com", "string");
debugTestRunner.assertVariable(anonObjectChildVariables, "Ȧɢέ_ /:@[`{~π", "0", "int");
Map<String, Variable> jsonChildVariables = debugTestRunner.fetchChildVariables(localVariables.get("jsonVar"));
debugTestRunner.assertVariable(jsonChildVariables, "color", "red", "string");
debugTestRunner.assertVariable(jsonChildVariables, "name", "apple", "string");
debugTestRunner.assertVariable(jsonChildVariables, "price", "40", "int");
Map<String, Variable> tableWithKeyChildVariables =
debugTestRunner.fetchChildVariables(localVariables.get("tableWithKeyVar"));
debugTestRunner.assertVariable(tableWithKeyChildVariables, "[0]", "Employee", "record");
debugTestRunner.assertVariable(tableWithKeyChildVariables, "[1]", "Employee", "record");
debugTestRunner.assertVariable(tableWithKeyChildVariables, "[2]", "Employee", "record");
Map<String, Variable> tableWithoutKeyChildVariables =
debugTestRunner.fetchChildVariables(localVariables.get("tableWithoutKeyVar"));
debugTestRunner.assertVariable(tableWithoutKeyChildVariables, "[0]", "Employee", "record");
debugTestRunner.assertVariable(tableWithoutKeyChildVariables, "[1]", "Employee", "record");
debugTestRunner.assertVariable(tableWithoutKeyChildVariables, "[2]", "Employee", "record");
Map<String, Variable> serviceChildVariables =
debugTestRunner.fetchChildVariables(localVariables.get("serviceVar"));
debugTestRunner.assertVariable(serviceChildVariables, "i", "5", "int");
}
@AfterClass(alwaysRun = true)
public void cleanUp() {
debugTestRunner.terminateDebugSession();
globalVariables.clear();
localVariables.clear();
}
}