简体   繁体   中英

What is the difference between junit vs psvm

What is the difference between junit and psvm (public static void main, so if we are gonna test without test frameworks). We can use psvm for all test purposes, JUnit seems more comfortable, but this answer is wrong i think

Simply spoken: no, you can't use psvm for all test purposes. With Junit, I go into my test classes, and by adding/removing the @Test annotation, I influence what will happen when I click on "run as unit test" within eclipse. I also can select a whole package in eclipse and "run as unit test" - you cant do that for the multiple mains in there.

Besides: my test code sits in the test project; your psvm test code lives in your production class!

And beyond that: with JUnit, I get automated full scale information about passes/fails ...

I could probably go on and on; the main thing here is: if you think that you can do the same things with "psvm" that JUnit allows for then my guess is: you haven't been using JUnit in real life for more than 5 minutes.

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