问题
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