We are using the Gradle-based build system to create modules using the MicroEJ SDK in Android Studio IDE. We are running into the following issues:
-
Using Mockito to write tests: We were able to add Mockito-enabled tests to the project however the tests failed as they ran in the MicroEJ VM. How do I switch to using the J2SE VM while using the Gradle Build system? We were referring to this post, however, how do we do the same in Gradle? Unit tests with Mockito
-
Generate Test Report and Coverage Report for the tests: While using the MicroEJ IDE and Ivy-based build system, the test report is auto-generated when the tests are executed. Also, there are options to generate the coverage report using the generated .cc files. (as discussed here: Test Suite with JUnit — MicroEJ Documentation) How can similar reports be generated while using the Gradle-based build system and Android Studio?
Note:
- We are exploring the use of Android Studio and Gradle as an environment for our projects
- We would need the tests to run on the Virtual device
Any help in this regard will be appreciated.