Cov txheej txheem:

Kuv yuav ua li cas thiaj li xeem JUnit hauv dab noj hnub?
Kuv yuav ua li cas thiaj li xeem JUnit hauv dab noj hnub?

Video: Kuv yuav ua li cas thiaj li xeem JUnit hauv dab noj hnub?

Video: Kuv yuav ua li cas thiaj li xeem JUnit hauv dab noj hnub?
Video: Mam saib koj ua neej # 2. 10/14/2017 2024, Kaum ib hlis
Anonim

Txoj kev yooj yim tshaj plaws ntawm kev khiav ib txoj kev xeem JUnit yog khiav nws los ntawm qhov kev xeem cov ntaub ntawv hauv chav kawm editor:

  1. Muab koj tus cursor rau ntawm txoj kev lub npe nyob rau hauv lub xeem chav kawm.
  2. Nias Alt+Shift+X, T rau khiav tus xeem (los yog right-click, Khiav Raws li > JUnit Test ).
  3. Yog tias koj xav rov ua qhov qub xeem txoj kev, tsuas yog nias Ctrl + F11.

Tsis tas li ntawd, kuv yuav ua li cas thiaj li khiav qhov kev xeem hauv dab noj hnub?

Khiav kev xeem los ntawm hauv dab noj hnub

  1. Hauv Package Explorer, xaiv qhov kev xeem lossis cov ntawv xeem uas koj xav khiav.
  2. Xaiv Khiav> Khiav
  3. Xaiv "JUnit Plug-in Test" qeb, thiab nyem lub pob los tsim qhov kev xeem tshiab.
  4. Nyob rau ntawm lub tab "Main", xaiv daim ntawv thov tsim nyog rau qhov kev xeem ntawd.
  5. Nyem Khiav.

Ib tug kuj yuav nug, 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.

Tom qab ntawd, ib tus tuaj yeem nug, Kuv yuav ua li cas thiaj li xeem JUnit?

Rau khiav a xeem , xaiv cov xeem class, right-click rau nws thiab xaiv Khiav -as JUnit Test . Qhov no pib JUnit thiab ua txhua yam xeem txoj hauv kev no. Dab noj hnub muab Alt + Ua haujlwm + X, T shortcut rau khiav tus xeem nyob rau hauv chav kawm xaiv.

JUnit test case yog dab tsi?

JUnit yog chav tsev nrov tshaj plaws Kev sim lub moj khaum hauv Java. Nws raug pom zoo rau Unit Kev sim . JUnit lub moj khaum kuj tso cai sai thiab yooj yim tiam ntawm kuaj mob thiab xeem cov ntaub ntawv. Lub org. Junit pob muaj ntau yam interfaces thiab cov chav kawm rau JUnit Kev Xeem xws li Kuaj , Qhia , Tom qab, Ua ntej, thiab lwm yam.

Pom zoo: