From c7948f400af69a7ab19051b0d1860e2f52a1d360 Mon Sep 17 00:00:00 2001 From: hindujaB Date: Fri, 1 Sep 2023 16:34:42 +0530 Subject: [PATCH] Modify debugger tests to remove invalid breakpoints --- .../org/ballerina/devtools/debug/ServiceDebugTest.java | 8 ++++---- .../project-based-tests/service-tests/hello_service.bal | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/devtools-integration-tests/src/test/java/org/ballerina/devtools/debug/ServiceDebugTest.java b/devtools-integration-tests/src/test/java/org/ballerina/devtools/debug/ServiceDebugTest.java index 2a43b0839f..98600ec1e2 100644 --- a/devtools-integration-tests/src/test/java/org/ballerina/devtools/debug/ServiceDebugTest.java +++ b/devtools-integration-tests/src/test/java/org/ballerina/devtools/debug/ServiceDebugTest.java @@ -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 @@ -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 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") diff --git a/devtools-integration-tests/src/test/resources/debug/project-based-tests/service-tests/hello_service.bal b/devtools-integration-tests/src/test/resources/debug/project-based-tests/service-tests/hello_service.bal index 8af5b2de21..f173a1a19e 100644 --- a/devtools-integration-tests/src/test/resources/debug/project-based-tests/service-tests/hello_service.bal +++ b/devtools-integration-tests/src/test/resources/debug/project-based-tests/service-tests/hello_service.bal @@ -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!";