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 2022/12/01 22:42:08 UTC

[GitHub] [netbeans] Honza-cz commented on a diff in pull request #4924: The improvement to let netbeans/maven to execute tests in non default…

Honza-cz commented on code in PR #4924:
URL: https://github.com/apache/netbeans/pull/4924#discussion_r1037626622


##########
java/maven/src/org/netbeans/modules/maven/execute/DefaultReplaceTokenProvider.java:
##########
@@ -215,8 +214,13 @@ private static FileObject[] extractFileObjectsfromLookup(Lookup lookup) {
                 HashSet<String> test = new HashSet<String>();
                 addSelectedFiles(false, fos, test);
                 addSelectedFiles(true, fos, test);
-                String files2test = test.toString().replace(" ", "");
-                packClassname.append(files2test.substring(1, files2test.length() - 1));
+                
+                packClassname.append(test
+                        .stream()
+                        .map(String::trim)
+                        .collect(Collectors.joining(","))

Review Comment:
   I made a test with junit:4.12 and maven-surefire-plugin:2.8. In Netbeans I selected 2 packages and execute them. It generated `-Dtest=some.it.pkg.other.**,some.it.pkg.**` and it run the tests in those packages as expected:
   
   `
   Running some.it.pkg.ItTest
   ...
   Running some.it.pkg.other.It3Test
   ...`
   
   Is a such manual test enough?



-- 
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: notifications-unsubscribe@netbeans.apache.org

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