My project has two projects:
main
mainTest
I created an “AndroidTestCase” in the “mainTest” and I tried to use getContext().getResources() to access the resources I created in the “mainTest” project. But I found the code is actually trying to get the resources in the “main” project. I think it is because when I use getContext() it returns an context representing the “main” project. But the AndroidTestCase class does not provide any methods to get its own resources.
P.S. I found I can directly use class.getResourceAsStream() to access the raw file, which is what I want. But still I hope there are more convenient way.
You can, from the application Context , request the resources from your test application.