How to Make Your JUnit Tests Run Faster in Eclipse

TBD: more tips and examples are comming (work is still in progress)

 

  1. Consider mocking for eclipse interfaces rather trying to obtain real one from eclipse
  2. Consider using core tests instead of ui tests, which is required to start eclipse workbench
  3. If you need test project during test execution try to make it as simpler as it possible:
    • remove all unused jars and remove all unused classes from jars you need to make java indexing faster
    • remove all builders from .project file that doesn't required in your test or disable them during runtime
    • disable validation if your tests are not for validation issues
    • disable java indexing if you cannot create test project without jars
    • disable auto builder if you do not need to test incremental builder functionality
    • disable decoration calculation (not sure if that possible)
  4. Try to reuse test projects between several tests to import it only ones during test execution. Use TestSetup wrapper to achieve this, because setUp and tearDown methods are executed before and after each test* methods in class.
  5. Try to fit all tests in one eclipse session, because eclipse start takes time
  6. Add missing xml schemas and dtd's into exml catalog and map them to local resources in test/runtime plugins to avoid downloading them from internet during test execution