Java big data platform development study notes (14)-IntelliJ IDEA manually import the junit4.jar package, @Test Getting started with unit testing

1. Getting started with IntelliJ IDEA @Test unit testing


Step 1) Create a new project and create the JunitTestDemo class:

Insert picture description here

Step 2) Write @Test test code:

Insert picture description here
The code is as follows:

    @Test
    public void junitTestDemo(){
    
    
        System.out.println("This is a junitTestDemo class !!");
    }

Step 3) Click File -> Project Structure (shortcut key Ctrl + Alt + Shift + S):

Insert picture description here

Step 4) In the "Libraries" interface, click the green "+" sign on the right and select "java":

Insert picture description here

Step 5) Find "junit-4.8.2.jar" and import the JAR package:

Download (Baidu network disk): https://pan.baidu.com/s/1e8GrzeQMiZpFjnD-zukayg· (extraction d77ccode: )

Insert picture description here

Step 6) The import is complete:

Insert picture description here

Step 7) Double-click @Test, it will prompt "import class", and click "import class" (shortcut key Alt + Shift + Enter):

Insert picture description here

Step 8) Right-click on "Run", it prompts "This is a junitTestDemo class!!", the operation is complete:

Insert picture description here


• Written by ChiKong_Tam on September 13, 2020

Guess you like

Origin blog.csdn.net/qq_42209354/article/details/108568115