dbalek commented on a change in pull request #2878:
URL: https://github.com/apache/netbeans/pull/2878#discussion_r612214199



##########
File path: 
java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/WorkspaceServiceImpl.java
##########
@@ -179,27 +180,25 @@
 
     private CompletableFuture<Set<URL>> getTestRootURLs(Project prj) {
         final Set<URL> testRootURLs = new HashSet<>();
-        List<CompletableFuture<?>> futures = new ArrayList<>();
+        List<FileObject> contained = null;
         if (prj != null) {
             for (SourceGroup sg : 
ProjectUtils.getSources(prj).getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA))
 {
                 for (URL url : 
UnitTestForSourceQuery.findUnitTests(sg.getRootFolder())) {
                     testRootURLs.add(url);
                 }
             }
-            for (Project containedPrj : ProjectUtils.getContainedProjects(prj, 
true)) {
-                boolean testRootFound = false;
-                for (SourceGroup sg : 
ProjectUtils.getSources(containedPrj).getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA))
 {
+            contained = ProjectUtils.getContainedProjects(prj, 
true).stream().map(p -> p.getProjectDirectory()).collect(Collectors.toList());
+        }
+        return server.asyncOpenSelectedProjects(contained).thenApply(projects 
-> {

Review comment:
       Yes. All the subprojects are opened first, test roots are identified 
among their source groups then and finally all test roots are searched for 
individual test suites and tests.




-- 
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.

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

Reply via email to