-
引入hamcrest-core-1.3.jar & junit-4.12.jar
-
新建一個test路徑
-
標記成test sources root
-
到要測試的類方法,ctrl + shift + t,選擇create new test
-
選擇Junit4 和要測試的方法
-
左鍵點擊,run
ps:Junit不能是static,java.lang.Exception: Method main() should not be static
不能有變量,java.lang.Exception: Method main should have no parameters
測試方法必須是public void
IDEA使用Junit單元測試
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
SGDMA與普通DMA
藍天上的雲℡
2024-05-02 14:21:20
用json來存數據的思路. json類型數據庫的思路.
張博的博客
2024-05-02 14:19:50
Vue | babel.config.js 配置詳解
emanlee
2024-05-02 14:10:29
Vue項目中main.js、App.vue、import...from...等的作用和意義
emanlee
2024-05-02 14:10:29
Vue .eslintignore
emanlee
2024-05-02 14:10:29
Vue mockjs mock.js
emanlee
2024-05-02 14:10:29
Vue .gitignore
emanlee
2024-05-02 14:10:29
vue 項目構建之 jsconfig.json 作用
emanlee
2024-05-02 14:10:29
Vue .eslintrc.js
emanlee
2024-05-02 14:10:29
Vue 生命週期 Vue進階(三十六):created() 詳解
emanlee
2024-05-02 14:10:29
Vue .browserslistrc
emanlee
2024-05-02 14:10:29
前端Vue 啓動過程 啓動流程 執行流程
emanlee
2024-05-02 14:10:29