talira

Test Runner for Java

Run and debug JUnit and TestNG tests in VS Code

open sourceMITfree

Test Runner for Java is Microsoft's extension (vscjava.vscode-java-test) that runs and debugs Java tests in Visual Studio Code: JUnit 4, 5 and 6 and TestNG, though not JUnit 3-style tests. It puts run buttons beside test classes and methods, lists tests in VS Code's Test Explorer, shows a test report and lets you customize test configurations. It works with Red Hat's Language Support for Java and Microsoft's Debugger for Java, needs JDK 17 or later, and is on the VS Code Marketplace and Open VSX.

Problems it solves

  • run a single JUnit test from VS Code
  • see my Java test results in the editor
  • debug a failing TestNG test in VS Code

Features

  • run and debug tests from the editor
  • JUnit 4, 5 and 6 and TestNG
  • Test Explorer integration
  • test reports
  • custom test configurations

Limitations

  • Doesn't support JUnit 3-style tests (classes extending junit.framework.TestCase)1
  • Needs JDK 17 or later, Language Support for Java and Debugger for Java1

Alternatives

The same job

These do what Test Runner for Java does.

  1. Jest Runner Runs and debugs a single JavaScript or TypeScript test from VS Code, for Jest, Vitest, Playwright and more

Compare Test Runner for Java with the top 3