Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
185 views
in Technique[技术] by (71.8m points)

java - 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.

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...