vscode-java-test icon indicating copy to clipboard operation
vscode-java-test copied to clipboard

Support TestNG class level annotations

Open andywarren86 opened this issue 4 years ago • 1 comments

Consider adding support for TestNG class level annotations.

https://testng.org/doc/documentation-main.html#class-level

With TestNG the @Test annotation can be placed on a class instead of the method. In this case all public void methods are considered tests even if they are not annotated.

Example:

@Test
public class TestNGTest {

  public void test1() {
    System.out.println("Test 1");
  }

  public void test2() {
      System.out.println("Test 2");
  }

  private void privateMethod() {
    System.out.println( "Not a test" );
  }
}

Currently there does not appear to be any way to run a test unless it is explicitly annotated. Right clicking and selecting Run just pops up an alert with No tests in file: .... No code lens appear at either class or method level. No tests appear under the class in the Test panel.

andywarren86 avatar Jan 31 '21 23:01 andywarren86

This issue is the only reason why I can not completely move away from Eclipse, what is the progress for this issue?

CarlPer avatar Sep 23 '21 15:09 CarlPer