GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - microsoft/vscode-java-test: Run and debug Java test cases in Visual Studio Code.

BranchesTags
Open more actions menu

Latest commit

 

History

962 Commits
962 Commits

Folders and files

NameName
Last commit message
Last commit date
.azure-pipelines
.azure-pipelines
 
 
.github
.github
 
 
.vscode
.vscode
 
 
demo
demo
 
 
java-extension
java-extension
 
 
resources
resources
 
 
scripts
scripts
 
 
src
src
 
 
test
test
 
 
.eslintrc.js
.eslintrc.js
 
 
.gitignore
.gitignore
 
 
.vscodeignore
.vscodeignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE.txt
LICENSE.txt
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
ThirdPartyNotices.txt
ThirdPartyNotices.txt
 
 
extension.bundle.ts
extension.bundle.ts
 
 
javaConfig.json
javaConfig.json
 
 
main.js
main.js
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
package.nls.json
package.nls.json
 
 
package.nls.zh.json
package.nls.zh.json
 
 
tsconfig.json
tsconfig.json
 
 
webpack.config.js
webpack.config.js
 
 

Repository files navigation

Test Runner for Java

Run and debug Java test cases in Visual Studio Code

Overview

A lightweight extension to run and debug Java test cases in Visual Studio Code. The extension support following test frameworks:

  • JUnit 4 (v4.8.0+)
  • JUnit 5 (v5.1.0+)
  • JUnit 6 (v6.0.1+)
  • TestNG (v6.9.13.3+)

Note: JUnit 3 styled tests are not supported in this extension (i.e. extends junit.framework.TestCase).

The Test Runner for Java works with Language Support for Java by Red Hat and Debugger for Java to provide the following features:

  • Run/Debug test cases
  • Customize test configurations
  • View test report
  • View tests in Test Explorer

Requirements

  • JDK (version 17 or later)
  • VS Code (version 1.59.0 or later)
  • Language Support for Java by Red Hat
  • Debugger for Java

Features

Run/Debug Test Cases

Run/Debug Test Cases

  • The extension will generate shortcuts (the green play button) on the left side of the class and method definition. To run the target test cases, simply click on the green play button. You can also right click on it to see more options.

Test Explorer

Test Explorer

  • The Test Explorer is the place to show all the test cases in your workspace. You can also run/debug your test cases from here.

Customize Test Configurations

Customize Test Configurations

  • Sometimes you may want to customize the configuration to run your test cases. To achieve this, you can add the configuration into your workspace settings under the section: java.test.config.

Note: More details can be found here.


View Test Result

View Test Result

  • After running/debugging the test cases, the state of the related test items will be updated in both editor decoration and test explorer.
  • You can trigger the command Test: Peek Output to peek the result view.
  • You can click on the links in the stack trace to navigate to the source location.

VS Code Embedded Commands for Testing

VS Code Embedded Commands for Testing

There are other VS Code embedded commands for testing, which can be found by searching Test: in the Command Palette.

Settings

Setting Name Description Default Value
java.test.config Specify the configuration for the test cases to run with. More details. {}
java.test.defaultConfig Specify the name of the default test configuration. ""

VS Code Embedded Settings for Testing

VS Code Embedded Settings for Testing

There are some other VS Code embedded settings for testing, which can be found by searching testing in the Settings view.

Project Setup

JUnit 6

Please refer to Getting Started from the JUnit 6's official document for getting started documentation.

JUnit 5

Please refer to Getting Started from the JUnit 5's official document for getting started documentation.

Note: If your project does not use build tools(Maven/Gradle/...), please make sure junit-platform-console-standalone.jar is on your project classpath.

JUnit 4

Please refer to Download and Install from the JUnit 4's official document for the getting started documentation.

TestNG

Please refer to TestNG Docs from the TestNG's official document for getting started documentation.

FAQ

If you meet any problem when using the extension, please refer to the FAQ and our issue list to check if there is an answer to your problem.

Contributing and Feedback

If you are interested in providing feedback or contributing directly to the code base, please check the document Contributing to Test Runner for Java, which covers the following parts:

  • Questions and Feedback
  • Reporting Issues
  • Contributing Fixes

License

This extension is licensed under MIT License.

Telemetry

This extension collects telemetry data to help improve our products. Please read Microsoft privacy statement to learn more. If you opt out to send telemetry data to Microsoft, please set below configuration in settings.json: telemetry.enableTelemetry = false. Learn more in our FAQ.

About

Run and debug Java test cases in Visual Studio Code.

marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-test

Topics

javajunittesttestngvscode

Resources

Readme
License

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

343 stars

Watchers

20 watching

Forks

176 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.