Gradle Android unit tests that depend on multiple module

梦想的初衷 提交于 2019-12-10 10:03:03

问题


I am working on a project which has multiple modules. We are writing junit test cases for application and we are using below exception.

Test running started java.lang.RuntimeException: java.lang.ClassNotFoundException:

Below is the project dependency

 Library project 1

 Library project 2 – depends on Library project 1

 Library project 3– depends on Library project 1

 Main launch project– depends on Library project 2 and Library project 3

From Library project 1 we are accessing the classes of Library project 2 using factory pattern to get the object. When we are writing the test cases for Library project 1. Could you please let us know how we can get the instance of classes from Library project 2 while running the unit test for Library project 1 class?

来源:https://stackoverflow.com/questions/35917846/gradle-android-unit-tests-that-depend-on-multiple-module

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!