Skip to content

Commit

Permalink
Modify debugger tests to remove invalid breakpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
HindujaB committed Sep 1, 2023
1 parent 8f69e5a commit c7948f4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ public void testModuleServiceDebugScenarios() throws BallerinaTestException {
String fileName = "hello_service.bal";
Path filePath = debugTestRunner.testProjectPath.resolve(fileName);

debugTestRunner.addBreakPoint(new BallerinaTestDebugPoint(filePath, 20));
debugTestRunner.addBreakPoint(new BallerinaTestDebugPoint(filePath, 24));
debugTestRunner.addBreakPoint(new BallerinaTestDebugPoint(filePath, 23));
debugTestRunner.addBreakPoint(new BallerinaTestDebugPoint(filePath, 28));
debugTestRunner.initDebugSession(DebugUtils.DebuggeeExecutionKind.TEST);

// test for debug hits in service level variables
Expand All @@ -77,13 +77,13 @@ public void serviceCallStackDebugTest() throws BallerinaTestException {
String fileName = "hello_service.bal";
Path filePath = debugTestRunner.testProjectPath.resolve(fileName);

debugTestRunner.addBreakPoint(new BallerinaTestDebugPoint(filePath, 20));
debugTestRunner.addBreakPoint(new BallerinaTestDebugPoint(filePath, 23));
debugTestRunner.initDebugSession(DebugUtils.DebuggeeExecutionKind.TEST);

// Test for service call stack representation
Pair<BallerinaTestDebugPoint, StoppedEventArguments> debugHitInfo = debugTestRunner.waitForDebugHit(30000);
StackFrame[] frames = debugTestRunner.fetchStackFrames(debugHitInfo.getRight());
debugTestRunner.assertCallStack(frames[0], "service", 20, "hello_service.bal");
debugTestRunner.assertCallStack(frames[0], "init", 23, "hello_service.bal");
}

@Test(description = "Test for single bal file debug engage")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
import ballerina/http;

service / on new http:Listener(9191) {
final int x = 5;
final int x;

function init() {
self.x = 5;
}

resource function get sayHello() returns string {
return "Hello, World!";
Expand Down

0 comments on commit c7948f4

Please sign in to comment.