ratcashdev commented on issue #3975:
URL: https://github.com/apache/netbeans/issues/3975#issuecomment-3151949030

   Found the difference. I had a different test project and a different test 
class.
   My test project was using:
   ```
   <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-surefire-plugin</artifactId>
           <version>2.22.2</version>
         </plugin>
   ```
   
   Observation:
   1. Hitting CTRL+F6 with version `2.22.2` of the `maven-surefire-plugin` 
executed only a single test (`test4`). FAIL.
   2. Hitting CTRL+F6 with version `3.5.3` of the `maven-surefire-plugin` 
executed all the tests. PASS.
   3. clicking `Run test5 method` on the left gutter resulted in the test 
properly executed. PASS
   
   
   I then added a new test class:
   ```java
   package test;
   
   import org.junit.jupiter.api.Nested;
   import org.junit.jupiter.api.Test;
   
   public class SampleTest {
     @Test
     public void testMyMethod1() {
       System.out.println("write this");
     }
   
     @Nested
     class NestedClass {
       @Test
       public void testMyMethod2() {
         System.out.println("nested write 2");
       }
     }
   
     @Nested
     class NestedClass2 {
       @Test
       public void testMyMethod3() {
         System.out.println("nested write 1");
       }
   
       @Test
       public void testMyMethod4() {
         System.out.println("nested write 3");
       }
   
       @Nested
       class DoubleNestedClass3 {
         @Test
         public void testMyMethod5() {
           System.out.println("double nested write 4");
         }
   
         @Test
         public void testmyMethod6() throws Exception {
           throw new Exception();
         }
       }
     }
   }
   
   ```
   Here, trying to `Run testMyMethod2` resulted in no tests executed. The maven 
output showed:
   ```
   cd ~/Downloads/nested-test; JAVA_HOME=/usr/lib/jvm/default 
~/Downloads/netbeans/java/maven/bin/mvn -Dtest=test.SampleTest#testMyMethod2 
--no-transfer-progress process-test-classes surefire:test
   ```
   
   Here, as it can be seen, the nested class was not handed over to maven at 
all.
   Same was observed when using `Run again` in the test results window after 
CTRL+F6.
   I am unable to explain why this does not work.


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