EmbracingJUnitwithEclipse

Junit with Eclipse

1.新增 Junit 5

設定 Build Path

點選專案右邊 Build Path »> Configuer Build Path

 Configuer Build Path

選擇 Libraies »Classpath »Add Libray

 JavaBuildPath

Add Library »» junit

AddLibraryJunit.png

Add Library »» junit5

 AddLibraryJunit-2

加入完成

 JavaBuildPath-2.png

2.Junit 參數設定

1.點選 於 Test.java(測試的類別) 點右鍵 »>Run AS »»Run Configuations

juint.png

2.打開設定

Test runner : 可以選擇 版本

Enbironment : 可以選擇 環境變數

juint2.png

juint3.png

參考

Embracing JUnit 5 with Eclipse | The Eclipse Foundation