kelemen / netbeans-gradle-project

This project is a NetBeans plugin able to open Gradle based Java projects. The implementation is based on Geertjan Wielenga's plugin.
173 stars 57 forks source link

Test Results window showing 'Running' when AfterClass writes to the console #437

Closed ratcashdev closed 4 years ago

ratcashdev commented 4 years ago

NOTE: this issue predominantly concerns the built-in Netbeans12 Gradle plugin, but since I don't know where exactly to post it, hopefully @kelemen will be able to pick it up and move where needed.

Reproduction scenario:

  1. Create a new JAVA Gradle project in NB12
  2. Create a new Test code as follows (using either JUnit 4 or TestNG 6+)
    
    import org.junit.AfterClass;
    import org.junit.Test;

public class ExampleTest {

@AfterClass
public static void cleanup() {
    // if you comment out the next line, the TestResults window will properly show the test results
    System.out.println("Cleaned");
}

@Test
public void testSomeMethod() {
    System.out.println("Doing something.");
}

}


3. Hit `CTLR+F6` and check the the results in the `Test Results` window. It will still show 'Running' as opposed to the actual test result.
4. Comment out the line `System.out.println("Cleaned");` and hit `CTLR+F6` again and check the TestResults window.

Bug applies to NB11 and above. Tested on LINUX, JDK11 and JDK8. It does not matter, if the write to the console is directly, or through a logger.
Using a MAVEN project works just OK.
kelemen commented 4 years ago

Seems very weird. Anyway, NB has a JIRA page where all issues are reported (including Gradle, since it has built-in support for Gradle now): https://issues.apache.org/jira/projects/NETBEANS/issues

ratcashdev commented 4 years ago

Thanks for the link. Have you been able to reproduce?

kelemen commented 4 years ago

No, I didn't try though with the built-in plugin. I'm not the developer of the built-in Gradle plugin.

ratcashdev commented 4 years ago

Posted as https://issues.apache.org/jira/browse/NETBEANS-4528