简体   繁体   中英

How JUnit starts

I'm figuring out how JUnit works. I can't understand how it runs itself, I understand that the surefire plugin interacts with JUnit, but I don't understand how JUnit itself runs. I'm trying to understand the debug output, and came across the getRunner method, but I can't get down to it, I can't understand what kind of package com.intellij.rt.junit is. Can you help me.

在此处输入图像描述

com.intellij.rt.junit is a package of IntelliJ for its built-in runner for JUnit tests, just like Surefire is the runner when tests are run from Maven.

JUnit itself also contains a basic commandline runner. For JUnit 5, see Console Launcher , for JUnit 4, see Test runners . These are probably - but I didn't check it - easier to understand than the internals of the runners of Surefire or IntelliJ.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM