Search in sources :

Example 11 with ExpectedResults

use of org.ballerinalang.test.utils.debug.ExpectedResults in project ballerina by ballerina-lang.

the class VMDebuggerTest method testTryCatchScenarioForPath.

@Test(description = "Testing try catch finally scenario for path")
public void testTryCatchScenarioForPath() {
    BreakPointDTO[] breakPoints = Util.createBreakNodeLocations(".", "try-catch-finally.bal", 19);
    String file = "try-catch-finally.bal";
    List<DebugPoint> debugPoints = new ArrayList<>();
    debugPoints.add(Util.createDebugPoint(".", file, 19, STEP_IN, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 27, STEP_OVER, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 29, STEP_OVER, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 31, STEP_OVER, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 32, STEP_OVER, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 33, STEP_OVER, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 34, STEP_OVER, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 35, STEP_OVER, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 43, STEP_OVER, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 44, STEP_OVER, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 45, STEP_OVER, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 50, STEP_OVER, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 55, STEP_OVER, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 56, STEP_OVER, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 58, STEP_OVER, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 60, RESUME, 1));
    ExpectedResults expRes = new ExpectedResults(debugPoints, 16);
    VMDebuggerUtil.startDebug("test-src/debugger/try-catch-finally.bal", breakPoints, expRes);
}
Also used : BreakPointDTO(org.ballerinalang.util.debugger.dto.BreakPointDTO) DebugPoint(org.ballerinalang.test.utils.debug.DebugPoint) ArrayList(java.util.ArrayList) ExpectedResults(org.ballerinalang.test.utils.debug.ExpectedResults) Test(org.testng.annotations.Test)

Aggregations

ArrayList (java.util.ArrayList)11 DebugPoint (org.ballerinalang.test.utils.debug.DebugPoint)11 ExpectedResults (org.ballerinalang.test.utils.debug.ExpectedResults)11 BreakPointDTO (org.ballerinalang.util.debugger.dto.BreakPointDTO)11 Test (org.testng.annotations.Test)11