Replies: 1 comment 1 reply
-
@cmathew Sorry, we missed this idea. I think https://robolectric.org/extending/ can cover the custom shadow. If you encounter the issue that internal class can't be found, you can add Robolectric's |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Crossposting from the Google Group.
I'm looking to create my own shadow for a low-level Android class. My current implementation extends the one included in Robolectric 4.9.2, and adds some additional functionality:
To allow my project to reference ViewRootImpl, I found that I could include the android-all library. However, I'm not sure whether this is the correct next step to take. Also, having this on my classpath seems to be stomping on some framework classes in ways that result in runtime exceptions. For example, my Android Log calls now result in linking errors.
I would like to learn more about:
1.) How do I create low-level Shadows? What is android-all, and what roles does it play?
2.) Besides android-all, I noticed other interesting-sounding libraries surrounding Robolectric e.g. shadows-framework, shadowapi, sandbox, and android-all-instrumented. What are these libraries, and how should developers use them?
Thanks for any help!
Beta Was this translation helpful? Give feedback.
All reactions