views:

158

answers:

1

I am currently developing an android app in eclipse using:

  • One project for the app
  • One project for the tests (Instrumentation and Pojo tests)

In the test project, I am importing the mockito library for standard POJO testing. However, when I import the library, the compilation time skyrockets from 1 second to about 30 seconds in eclipse. The cause seems to be that the whole library is converted each time. So basically, each time a make a modification that I want to test, I have to wait 30 seconds.

The only workarounds that I have found so far would be:

  • Disable "Build Automatically"
  • Create a project that includes only pojo tests and put mockito only there.
  • Use another library that compiles faster (e.g. easymock)

Any other suggestion?

A: 

Do you need the test project to be an android project? If can get aware with creating a Java project and mocking out any of the android specific classes for the tests that would be my suggestion.

Have a look at this article: https://sites.google.com/site/androiddevtesting/

Jarle Hansen