Java on Visual Studio Code Update – January 2021

Java on Visual Studio Code Update – January 2021

Welcome to the first edition of VS Code update for Java in 2021. We got some questions around how to run tests on VS Code, so in this blog we will walk you through the how.

Welcome to the first edition of VS Code update for Java in 2021. We got some questions around how to run tests on VS Code, so in this blog we will walk you through the how. Meanwhile, we will share the news of releasing Azure Spring Cloud extension. The extension is for you to create, manage and deploy apps to Azure Spring Cloud, a fully-managed Azure Service jointly built and operated with VMware. Let’s start.

Testing

To run Java tests on VS Code, we recommend using Java Test Runner extension. Our Java Extension Pack also includes the extension. The extension support JUnit4, JUnit5 and TestNG frameworks.

Running tests

When a project with test cases imported into VS Code, VS Code can automatically detect the test cases and get ready for you to run. There are a couple of options to run.

1. Running from Test Explorer

Test Explorer offers the most comprehensive support for testing. In addition to run cases individually, you can Run All Tests as shown below.

2. Running from JAVA PROJECT Explorer

JAVA PROJECT Explorer provides access to all project related functionality including testing. You can run tests at project level or at individual package or class level as demonstrated below.

3. Running from CodeLens

CodeLens is a VS Code feature that provides context-aware actions through link next to your code. When VS Code detects testing annotation in code, it will provide a link of “Run Test” and a link of “Debug Test” next to the annotation for you to quickly place an action without jumping out of your code. It’s a handy feature that allows you focusing on coding by minimizing context switch.

Accessing testing report

After running tests, VS Code generates a testing report for you. You can access the report through status bar as shown in demos above or using Command Palette by Ctrl+Shift+P to launch the palette and then typing “java show test report” to open the report.

Azure Spring Cloud extension and more

Microsoft just released Azure Spring Cloud extension. The extension is for you to create, manage and deploy apps to Azure Spring Cloud, a fully-managed Azure Service jointly built and operated with VMware. The release underlines that VS Code is not only good for tasks like editing, running, debugging and testing, but also provides a seamless end-to-end experience for working with services. For Java developers on Azure, extensions are also available for other services like Azure App ServicesAzure Functions, and many more. Please refer to VC Code documentation for more details. Meanwhile, we welcome communities and companies to develop extensions for your services. Let us know if you need support.

java open source azure

What is Geek Coin

What is GeekCash, Geek Token

Best Visual Studio Code Themes of 2021

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Top 8 Java Open Source Projects You Should Get Your Hands-on [2021]

Top 8 Java Open Source Projects You Should Get Your Hands-on [2021]. Learning about Java is no easy feat. It’s a prevalent and in-demand programming language with applications in numerous sectors. We all know that if you want to learn a new skill, the best way to do so is through using it. That’s why we recommend working on projects.  So if you’re a Java student, then […]

How to Install OpenJDK 11 on CentOS 8

What is OpenJDK? OpenJDk or Open Java Development Kit is a free, open-source framework of the Java Platform, Standard Edition (or Java SE).

An Open-Source Book About the Open Source World

Open source today is a word that often include a lot of things, such as open knowledge (Wikimedia projects), open hardware (Arduino, Raspberry Pi), open formats (ODT/ODS/ODP) and so on.

Going Beyond Java 8: Local Variable Type Inference (var) - DZone Java

In this article, we will talk about the most important new feature introduced with Java 10, officially called local variable type inference. An extremely important function in java. You will regret skipping this article.

Did Google Open Sourcing Kubernetes Backfired?

With Google not owning the trademarks or control for Kubernetes, it also provided a competitive edge to AWS, Microsoft, IBM etc.