简体   繁体   中英

JUnit: Run via eclipse and maven test. Big difference in the speed, why?

I have one JUnit class and this class contains couple test methods. I am trying run this test class via Eclipse IDE menu Run As -> Junit Test.

Execution Speed:

1 time. 30 sec.

2 time: 29 sec.

3 time: 23 sec.

After this, I am trying execute test class via maven run in the terminal. In this case execution speed:

1 time: 1 min. 10 sec.

2 time: 59 sec.

3 time: 56 sec.

So, as you can see, wee have really big difference between those two cases. But how can we explain this big difference?

PS I am using latest version Eclipse IDE and maven.

Maven has a build lifecycle, which involves the following steps:

  1. validate
  2. compile
  3. test
  4. package
  5. integration-test
  6. verify
  7. install
  8. deploy

Eclipse just compiles and runs the test.
I think this might be the reason.

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