1. Getting started with IntelliJ IDEA @Test unit testing
Step 1) Create a new project and create the JunitTestDemo class:
Step 2) Write @Test test code:
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):
Step 4) In the "Libraries" interface, click the green "+" sign on the right and select "java":
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 d77c
code: )
Step 6) The import is complete:
Step 7) Double-click @Test, it will prompt "import class", and click "import class" (shortcut key Alt + Shift + Enter):
Step 8) Right-click on "Run", it prompts "This is a junitTestDemo class!!", the operation is complete:
• Written by ChiKong_Tam on September 13, 2020