开发者

Speed up compilation with mockito on Android

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.开发者_如何学Go 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?


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/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜