I tried using Junit on Mac VScode Maven

Introduction

For those who want to experience unit testing using JUnit with VS Code for the time being. I haven't even put Java on my Mac yet! Please refer to here.

Operating environment

You can use another JDK, but this time I will use 1.8 for the time being.

Install Java extensions in VScode

First, let's put the Java Extension Pack into VS Code. スクリーンショット 2020-06-20 1.47.40.png

This also includes Maven extensions, which are required this time.

Create a Maven project

After installing the extension, open the command palette with Cmd + Shift + p and select Maven: Create Maven Project.

スクリーンショット 2020-06-20 1.52.33.png

For archtype, select ʻarchtype-quickstart-jdk8. If you are using other than JDK1.8, please select maven-archtype-quickstart`. In that case, please note that the execution result after this may change. I'm just thinking about running JUnit easily for the time being.

スクリーンショット 2020-06-20 2.45.45.png

For the version, select the latest 2.0.0 for the time being.

スクリーンショット 2020-06-20 2.00.32.png

You will be asked in which directory to create it, so select any directory. Then you will be asked what kind of project you want to create interactively in the VS Code terminal. This time, I created it as follows.

スクリーンショット 2020-06-20 2.07.47.png

groupID is demo, ʻartifactID` is com.demo. If the creation is successful as described above, the directory structure will be as follows.

スクリーンショット 2020-06-20 2.20.39.png

Try running a test

ʻWhen you open AppTest.java, the test code will be displayed as shown below. Click Run Test`. The test will be run.

スクリーンショット 2020-06-20 2.35.53.png

Recommended Posts

I tried using Junit on Mac VScode Maven
I tried putting Java on my Mac easily
I tried using Gson
[For beginners] I tried using JUnit 5 in Eclipse
I tried using TestNG
I tried using Galasa
I tried running Java on a Mac terminal
Install java and maven using brew on new mac
I tried using Log4j2 on a Java EE server
I tried using YOLO v4 on Ubuntu and ROS
I tried using Docker Desktop for Windows on Windows 10 Home
I tried using azure cloud-init
I tried using Apache Wicket
I tried using Java REPL
I tried running WordPress with docker preview on M1 Mac.
I tried using anakia + Jing now
I tried using Spring + Mybatis + DbUnit
Try using Redmine on Mac docker
I tried using JOOQ with Gradle
Installed on Lombok Mac (using STS)
I tried using Java8 Stream API
I tried using JWT in Java
[Android] I tried using Coordinator Layout.
I tried installing CentOS 8 on ESXi 6.7
I tried using Pari gp container
I tried using WebAssembly Stadio (2018/4/17 version)
I tried using Java memo LocalDate
I tried using GoogleHttpClient of Java
I just want to write Java using Eclipse on my Mac
I tried to integrate Docker and Maven / Netbean nicely using Jib
I tried to create a Spring MVC development environment on Mac
I tried to display the calendar on the Eclipse console using Java.
I tried using Elasticsearch API in Java
I tried using Realm with Swift UI
I tried running Docker on Windows Server 2019
I tried using Java's diagnostic tool Arthas
I tried using UICollectionViewListCell added from Xcode12.
I tried using Scalar DL with Docker
I can't install rails on my mac
I tried using OnlineConverter with SpringBoot + JODConverter
It's new, but I tried using Groonga
I tried using OpenCV with Java + Tomcat
Microservices 101-I tried putting Docker on Ubuntu-
I tried to build AdoptOpenjdk 11 on CentOS 7
I tried using "nifty cloud mobile backend" and "Firebase" Authentication on Kotlin + Android
I tried using Docker for the first time
I was addicted to using RXTX on Sierra
[For beginners] I tried using DBUnit in Eclipse
Install java and android-sdk on Mac using homebrew
I tried barcode scanning using Rails + React + QuaggaJS
Using JUnit from the command line on Ubuntu
[Android] I quit SQLite and tried using Realm
I made blackjack with Ruby (I tried using minitest)
I tried OmniSci on CentOS 7 + GeForce RTX 2080 Ti.
[API] I tried using the zip code search API
I tried running Ansible on a Docker container
I tried setting up a Maven remote repository
I tried installing docker on an EC2 instance
I tried to implement a server using Netty
I tried using the profiler of IntelliJ IDEA
I tried Getting Started with Gradle on Heroku