Skip to content

Commit

Permalink
Merge pull request #4866 from HindujaB/fix-object-debugger
Browse files Browse the repository at this point in the history
Modify debugger tests to remove invalid service breakpoints
  • Loading branch information
warunalakshitha committed Sep 6, 2023
2 parents 6248341 + c7948f4 commit 7cdf870
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 7cdf870

Please sign in to comment.