
最新版本的AndroID开发人员工具包包括对可模拟AndroID库的支持,该库与普通的AndroID支持库相同,但在任何地方都删除了最终修饰符.这将允许您模拟VIEw和Context等类,而不必担心最终的限制.
请参阅此处的文档
> Android Tools Project Site – Unit testing support
Unit tests run on a local JVM on your development machine. Our gradle plugin will compile source code found in src/test/java and execute it using the usual Gradle testing mechanisms. At runtime,tests will be executed against a modifIEd version of androID.jar where all final modifIErs have been stripped off. This lets you use popular mocking librarIEs,like Mockito.
> Android Plugin for Gradle Release Notes
总结Added sharing of the mockable
androID.jar,which the plugin generates only once and uses for unit testing. Multiple modules,such asappandlib,Now share it. Delete$rootDir/buildto regenerate it.
以上是内存溢出为你收集整理的mockito – 如何使用mockableAndroidJar?全部内容,希望文章能够帮你解决mockito – 如何使用mockableAndroidJar?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)