Search in sources :

Example 11 with BreakPointDTO

use of org.ballerinalang.util.debugger.dto.BreakPointDTO in project ballerina by ballerina-lang.

the class VMDebuggerTest method testDebuggingWorkers.

@Test(description = "Testing debug paths in workers")
public void testDebuggingWorkers() {
    BreakPointDTO[] breakPoints = Util.createBreakNodeLocations(".", "test-worker.bal", 3, 9, 10, 18, 19, 23, 46);
    String file = "test-worker.bal";
    List<DebugPoint> debugPoints = new ArrayList<>();
    debugPoints.add(Util.createDebugPoint(".", file, 3, RESUME, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 9, STEP_OVER, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 10, STEP_OVER, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 12, STEP_IN, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 31, STEP_OUT, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 13, RESUME, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 18, STEP_OVER, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 19, RESUME, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 46, RESUME, 5));
    debugPoints.add(Util.createDebugPoint(".", file, 23, RESUME, 1));
    ExpectedResults expRes = new ExpectedResults(debugPoints, 14);
    VMDebuggerUtil.startDebug("test-src/debugger/test-worker.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)

Example 12 with BreakPointDTO

use of org.ballerinalang.util.debugger.dto.BreakPointDTO in project ballerina by ballerina-lang.

the class VMDebuggerTest method testStepOverIfStmt.

@Test(description = "Testing Step over in IfCondition.")
public void testStepOverIfStmt() {
    BreakPointDTO[] breakPoints = Util.createBreakNodeLocations(".", FILE, 26);
    List<DebugPoint> debugPoints = new ArrayList<>();
    debugPoints.add(Util.createDebugPoint(".", FILE, 26, STEP_OVER, 1));
    debugPoints.add(Util.createDebugPoint(".", FILE, 28, STEP_OVER, 1));
    debugPoints.add(Util.createDebugPoint(".", FILE, 29, STEP_OVER, 1));
    debugPoints.add(Util.createDebugPoint(".", FILE, 35, STEP_OVER, 1));
    debugPoints.add(Util.createDebugPoint(".", FILE, 36, STEP_OVER, 1));
    debugPoints.add(Util.createDebugPoint(".", FILE, 42, RESUME, 1));
    ExpectedResults expRes = new ExpectedResults(debugPoints, 6);
    VMDebuggerUtil.startDebug("test-src/debugger/test-debug.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)

Example 13 with BreakPointDTO

use of org.ballerinalang.util.debugger.dto.BreakPointDTO in project ballerina by ballerina-lang.

the class VMDebuggerTest method testDebuggingPackageInit.

@Test(description = "Testing debug paths in package init")
public void testDebuggingPackageInit() {
    BreakPointDTO[] breakPoints = Util.createBreakNodeLocations(".", "test-package-init.bal", 3, 9);
    String file = "test-package-init.bal";
    List<DebugPoint> debugPoints = new ArrayList<>();
    debugPoints.add(Util.createDebugPoint(".", file, 3, STEP_OVER, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 5, STEP_IN, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 14, STEP_OVER, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 15, STEP_OVER, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 16, STEP_OVER, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 20, STEP_OVER, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 14, STEP_OVER, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 15, STEP_OVER, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 16, STEP_OVER, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 20, STEP_OVER, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 14, STEP_OVER, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 22, RESUME, 1));
    debugPoints.add(Util.createDebugPoint(".", file, 9, RESUME, 1));
    ExpectedResults expRes = new ExpectedResults(debugPoints, 13);
    VMDebuggerUtil.startDebug("test-src/debugger/test-package-init.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)

Example 14 with BreakPointDTO

use of org.ballerinalang.util.debugger.dto.BreakPointDTO 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

BreakPointDTO (org.ballerinalang.util.debugger.dto.BreakPointDTO)14 ArrayList (java.util.ArrayList)12 DebugPoint (org.ballerinalang.test.utils.debug.DebugPoint)11 ExpectedResults (org.ballerinalang.test.utils.debug.ExpectedResults)11 Test (org.testng.annotations.Test)11 JsonNode (org.ballerinalang.model.util.JsonNode)1 BBlob (org.ballerinalang.model.values.BBlob)1 BBoolean (org.ballerinalang.model.values.BBoolean)1 BFloat (org.ballerinalang.model.values.BFloat)1 BInteger (org.ballerinalang.model.values.BInteger)1 BString (org.ballerinalang.model.values.BString)1 LineNumberInfo (org.ballerinalang.util.codegen.LineNumberInfo)1 LocalVariableAttributeInfo (org.ballerinalang.util.codegen.attributes.LocalVariableAttributeInfo)1 FrameDTO (org.ballerinalang.util.debugger.dto.FrameDTO)1 MessageDTO (org.ballerinalang.util.debugger.dto.MessageDTO)1 VariableDTO (org.ballerinalang.util.debugger.dto.VariableDTO)1