Cov txheej txheem:

Yuav ua li cas rub tawm JUnit hauv dab noj hnub?
Yuav ua li cas rub tawm JUnit hauv dab noj hnub?

Video: Yuav ua li cas rub tawm JUnit hauv dab noj hnub?

Video: Yuav ua li cas rub tawm JUnit hauv dab noj hnub?
Video: Mark Hais Lus Hmoob EP. 34 RAUG TUS HLUB TSO, YUAV UA LI CAS? 2024, Hlis ntuj nqeg
Anonim

JUnit - Plug nrog dab noj hnub

  1. Kauj ruam 1: Download tau JUnit Cov ntaub ntawv. Download tau a JUnit jar raws li lub operating system koj muaj nyob rau hauv koj lub cev.
  2. Kauj ruam 2: Teeb Dab tuag Ib puag ncig. Qhib dab noj hnub → txoj nyem rau ntawm qhov project thiab nyem rau ntawm cov cuab yeej> Tsim Txoj Kev> Configure Build Path thiab ntxiv rau junit -4.10.
  3. Kauj Ruam 3: Tshawb xyuas JUnit installation nyob rau hauv Dab tuag .

Tsis tas li ntawd, kuv yuav rub tawm JUnit li cas?

Pib pib

  1. Ua ntej, rub tawm qhov tseeb version ntawm JUnit, xa mus rau hauv qab no li junit. zip.
  2. Tom qab ntawd nruab JUnit ntawm koj lub platform xaiv: Windows.
  3. (Optional) Unzip lub $JUNIT_HOME/src. jar ntaub ntawv.
  4. Kuaj qhov kev teeb tsa los ntawm kev khiav cov qauv xeem uas tau muab faib nrog JUnit.
  5. Thaum kawg, nyeem cov ntaub ntawv.

Kuj Paub, Kuv yuav siv JUnit li cas hauv dab noj hnub? Rau siv JUnit koj yuav tsum tsim ib qho kev sib cais. java cov ntaub ntawv hauv koj qhov project uas yuav sim ib qho ntawm koj cov chav kawm uas twb muaj lawm. Nyob rau hauv lub pob Explorer cheeb tsam ntawm sab laug ntawm lub Dab tuag lub qhov rais, right-click lub chav kawm koj xav sim thiab nias Tshiab → JUnit Kuaj Case. Lub dialog box yuav tshwm sim los pab koj tsim koj cov ntaub ntawv xeem.

Ib yam li ib tug yuav nug, Kuv yuav import JUnit li cas rau hauv dab noj hnub?

import org. junit tsis tuaj yeem daws tau hauv dab noj hnub

  1. Txoj nyem rau ntawm qhov project Java thiab xaiv Build Path> Configure Build Path.
  2. Nyem Ntxiv Library.
  3. Xaiv JUnit, ces nyem Next.
  4. Tam sim no xaiv qhov tseeb version ntawm JUnit lub tsev qiv ntawv, tom qab ntawd nyem Ua tiav.

Kuv yuav teeb tsa JUnit li cas?

Tsis xav tau yam tsawg kawg nkaus

  1. Kauj ruam 1: Txheeb xyuas Java Installation hauv koj lub tshuab.
  2. Kauj ruam 2: Teem JAVA Ib puag ncig.
  3. Kauj ruam 3: Download JUnit Archive.
  4. Kauj ruam 4: Teeb JUnit Ib puag ncig.
  5. Kauj ruam 5: Teem CLASSPATH Variable.
  6. Kauj ruam 6: Kuaj JUnit Teeb.
  7. Kauj Ruam 7: Txheeb xyuas qhov tshwm sim.

Pom zoo: