You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2021/04/12 13:03:07 UTC
[GitHub] [netbeans] dbalek opened a new pull request #2878: Test Explorer fixes.
dbalek opened a new pull request #2878:
URL: https://github.com/apache/netbeans/pull/2878
Fixing the following problems:
- Test results are not shown on the first run
- Test explorer does not show errors in test initialization
- Tests in multi-projects are not initially loaded
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] sdedic commented on a change in pull request #2878: Test Explorer fixes.
Posted by GitBox <gi...@apache.org>.
sdedic commented on a change in pull request #2878:
URL: https://github.com/apache/netbeans/pull/2878#discussion_r612175108
##########
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:
So the change here is first to open the subproject (to load all metadata), then look for source groups ?
##########
File path: java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/TextDocumentServiceImpl.java
##########
@@ -1462,10 +1471,12 @@ public void didChange(DidChangeTextDocumentParams params) {
@Override
public void didClose(DidCloseTextDocumentParams params) {
try {
+ String uri = params.getTextDocument().getUri();
+ upToDateTests.remove(uri);
// the order here is important ! As the file may cease to exist, it's
// important that the doucment is already gone form the client.
- openedDocuments.remove(params.getTextDocument().getUri());
- FileObject file = fromURI(params.getTextDocument().getUri(), true);
+ openedDocuments.remove(uri);
Review comment:
Sorry to write here, I've just realized that `openedDocuments` may be used from multiple threads - see l. 1250, called through `getJavaSource()` from a worker RP. Similar through call to `getSource` at l. 641, 1260. Access to the Map may need synchronization.
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] dbalek commented on a change in pull request #2878: Test Explorer fixes.
Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] dbalek commented on a change in pull request #2878: Test Explorer fixes.
Posted by GitBox <gi...@apache.org>.
dbalek commented on a change in pull request #2878:
URL: https://github.com/apache/netbeans/pull/2878#discussion_r612243951
##########
File path: java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/TextDocumentServiceImpl.java
##########
@@ -1462,10 +1471,12 @@ public void didChange(DidChangeTextDocumentParams params) {
@Override
public void didClose(DidCloseTextDocumentParams params) {
try {
+ String uri = params.getTextDocument().getUri();
+ upToDateTests.remove(uri);
// the order here is important ! As the file may cease to exist, it's
// important that the doucment is already gone form the client.
- openedDocuments.remove(params.getTextDocument().getUri());
- FileObject file = fromURI(params.getTextDocument().getUri(), true);
+ openedDocuments.remove(uri);
Review comment:
Fixed.
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] dbalek merged pull request #2878: Test Explorer fixes.
Posted by GitBox <gi...@apache.org>.
dbalek merged pull request #2878:
URL: https://github.com/apache/netbeans/pull/2878
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists