Cov txheej txheem:

Tsim JUnit Test Case in Eclipse: 9 Kauj Ruam
Tsim JUnit Test Case in Eclipse: 9 Kauj Ruam

Video: Tsim JUnit Test Case in Eclipse: 9 Kauj Ruam

Video: Tsim JUnit Test Case in Eclipse: 9 Kauj Ruam
Video: IEE 475: Lecture K1 (2019-11-19) - Variance Reduction Techniques, Part 1 [slides with audio overlay] 2024, Kaum ib hlis
Anonim
Tsim JUnit Test Case in Eclipse
Tsim JUnit Test Case in Eclipse

Txhawm rau sim Java cov cai hauv dab noj hnub, tus kws sau ntawv yuav tsum sau nws qhov kev xeem. Kev sim JUnit feem ntau siv los ntawm cov kws paub dhau los txhawm rau txheeb xyuas qhov raug thiab ua tau zoo ntawm lawv cov cai. Qhov kev ntsuas ntsuas no tau qhia hauv ntau lub Tsev Kawm Qib Siab, xws li DePaul University, thiab raug txhawb kom siv los ntawm cov tub ntxhais kawm los sim lawv cov ntawv daws teeb meem hauv tsev. Theem nyuaj ntawm kev tsim cov ntawv xeem yog tsawg, txawm li cas los xij tsim JUnit Test cov ntaub ntawv nyuaj rau txhua tus pib. Ib qho piv txwv JUnit Test file yog daim duab.

Kauj ruam 1: Qhib dab noj hnub

Qhib dab noj hnub
Qhib dab noj hnub

Nyem rau ntawm Eclipse Java Neon Icon ntawm lub desktop, lossis tshawb rau dab noj hnub hauv qhov Tshawb Nrhiav.

Kauj ruam 2: Cov khoom

Khoom
Khoom

Nyob rau sab saum toj navigation bar, Nyem Project. Hauv cov ntawv qhia zaub mov nco-down, nyem Properties.

Kauj ruam 3: Java Tsim Txoj Kev

Java Tsim Txoj Kev
Java Tsim Txoj Kev

Ua ntej, Nyem rau 'Java Build Path' ntawm sab laug. Tom qab ntawd, nyem rau ntawm 'Cov Tsev Qiv Ntawv' ntawm sab xis ze rau saum.

Kauj ruam 4: Ntxiv Library

Ntxiv Tsev Qiv Ntawv
Ntxiv Tsev Qiv Ntawv

Nyem rau ntawm 'Ntxiv Lub Tsev Qiv Ntawv …' Icon ntawm sab xis.

Kauj ruam 5: JUnit

JUnit
JUnit

Ua ntej, Nyem 'JUnit' kom paub tseeb tias nws tau hais meej. Tom qab ntawv, Nyem rau 'Next>' Icon nyob hauv qab.

Kauj ruam 6: JUnit Version

YUS Version
YUS Version

Nyem rau ntawm cov ntawv qhia zaub mov nco qab ntawm 'JUnit library version:'. Xaiv qhov tseeb Version muaj, piv txwv li JUnit 4 lossis JUnit 5. Tom qab ntawv nyem 'Ua tiav'.

Kauj Ruam 7: Thov Hloov

Thov Hloov
Thov Hloov

Nyem rau 'Thov thiab Kaw' nyob ze rau hauv qab txoj cai ntawm lub qhov rais.

Kauj Ruam 8: Tshiab JUnit Test File

Tshiab JUnit Test File
Tshiab JUnit Test File

Ua ntawm lub vijtsam tseem ceeb hauv Dab noj hnub, Nyem rau ntawm File, New, JUnit Test Case siv cov ntawv qhia zaub mov nco-down.

Kauj Ruam 9: Ua Kom tiav Cov Ntaub Ntawv

Tiav Tsim Cov Ntaub Ntawv
Tiav Tsim Cov Ntaub Ntawv

Ib sab ntawm 'Lub Npe:' Lub thawv, sau lub npe ntawm cov ntawv xeem. Lub npe cov ntaub ntawv tsis raug sau los ntawm Eclipse, tab sis qhov no tuaj yeem hloov pauv. Tom qab ntawd, Nyem 'Ua tiav' hauv qab.

Pom zoo: