Achal1607 commented on code in PR #8897:
URL: https://github.com/apache/netbeans/pull/8897#discussion_r2446803155
##########
ide/lsp.client/test/unit/src/org/netbeans/modules/lsp/client/debugger/DebuggerTest.java:
##########
@@ -125,7 +125,8 @@ private static void nestedPrint(String toPrint) { //10
.addConfiguration(Map.of("type", "java+",
"request", "launch",
"file",
FileUtil.toFile(testFile).getAbsolutePath(),
- "classPaths", List.of("any")))
+ "classPaths", List.of("any"),
+ "testRun", false))
Review Comment:
Earlier, the logic checked if a file wasn’t a test file by trying to find
the source of the root file of that test file. If no source was found, it would
assume the file was a `mainSource: true`. However, this approach was a bit
hacky for determining whether a file is a `mainClass`. As a result, in some
cases, files inside the `test` sources that were actually `mainClass` files
were incorrectly classified as test files, causing tests to run instead of
executing the `mainClass`.
The new approach uses `sourceCP` directly to check whether a file is a
`mainClass`.
However, since indexing wasn’t run in the tests scenario , it fails to
identify `mainClass` files correctly in the failing test scenarios.
If there are any changes required in the changed behaviour, please let me
know.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists