Reputation: 22553
I have a suite of 54 tests (a handful of which are properly integration that write some data to a mysql database and delete it). It takes 117 seconds to run my junit tests with the eclipse test runner. I have another app with 244 tests in a similar mix that work with couch and these take 308 seconds.
A VS 2010 c# project with a similar mix of ~50 similar tests (using spring.net) runs in ~10 seconds.
I also have a mocha node test suite with 260 tests (similar mix to the above) that takes 2 seconds to run.
My understanding is that the application contexts loaded by ContextConfiguration are cached, so that shouldn't be an issue. I'm finding myself increasingly frustrated by the length of time it takes to run my java application tests.
I guess I'm wondering whether 2 seconds per test is about what I should be expecting. Whether anything can be done to speed things up.
Finally, if one can only hope to get some incremental improvements with junit and eclipse, I'm wondering how folks can stand it.
Upvotes: 1
Views: 714
Reputation: 5341
Make sure you don't use @DirtiesContext
, this will cause context reloading per class or test.
Also <beans default-lazy-init="true">
in your test context may help by initializing only the beans needed on the current test
Upvotes: 1