Honza-cz opened a new pull request, #4919:
URL: https://github.com/apache/netbeans/pull/4919

   I noticed sometime ago, that netbeans is not able to execute IT tests which 
were located in "src/it/java". This folder was added to maven by 
"build-helper-maven-plugin" as
   
   > <plugin>
       <groupId>org.codehaus.mojo</groupId>
       <artifactId>build-helper-maven-plugin</artifactId>
       <version>1.9.1</version>
       <executions>
           <execution>
               <id>add-test-source</id>
               <phase>generate-test-sources</phase>
               <goals>
                   <goal>add-test-source</goal>
               </goals>
               <configuration>
                   <sources>
                       <source>src/it/java</source>
                   </sources>
               </configuration>
           </execution>
       </executions>
   </plugin>
   
   I tried to execute a test in that folder by netbeans, either by CTRL+F6 (or 
by mouse) but I noticed that netbeans is not able to correctly defined 
"-Dtest=" as:
   
   `cd /.../repository; JAVA_HOME=/.../jdk-19.0.1 /.../maven/bin/mvn 
-Dtest=${packageClassName} surefire:test`
   
   I searched in neatbeans source code and the root cause is, that the extra 
source folder is not consider as root one. It seems that only folders as 
/src/main/java and /src/test/java are supported. I was not able to find our how 
to add additional folder, but based on input FileObject, I was able to 
construct test names for
   - 1 test file 
   - n test files (even in different folder)
   - package
   as
   
   After my changes, netbeans is able to resolve _packageClassName_:
   
   `cd /.../repository; JAVA_HOME=/.../jdk-19.0.1 /.../maven/bin/mvn 
-Dtest=**.It3Test,some.it.pkg.It2Test surefire:test`
   
   It is covered by UT for execution files individually (one as one liner + 
normal formatting) and by folder/package.


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

Reply via email to