New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Parameter wrapper to support older Android versions #3
Add Parameter wrapper to support older Android versions #3
Conversation
try { | ||
return Java8.create(method.getParameters()); | ||
} catch (NoSuchMethodError ignored) { | ||
return Legacy.create(method); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not always use the Legacy version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Java8
wrapper correctly propagates parameter names (assuming they're available in the class file). I did not look to see how the name is used in practice, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter name is to (optionally) format the name of the test:
myTest[myParameter=true]
In any case, I've been investigating whether we can use AnnotationWithMetadata
a bit earlier in the process. I'm fine with merging this PR for now and see if I can improve on it at a later point.
Thanks a lot for this PR! So this PR avoids a dependency on FYI: TestParametersMethodProcessor.java also has a dependency on
However, In any case, I think this runner can be quite useful, even without |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I asked a colleague who added Anroid support to have a look. Since he's from the US, I'll allow him to get back to me first.
Even if you opt-in to parameter name retention, Android's toolchain drops the information because there's nowhere to put it in the Dalvik bytecode format. So yeah it sounds like that functionality is going to be a complete non-starter. |
LGTM, thanks! |
Closes #2.
Note: I haven't tested this on an actual pre-26 Android device yet. Will do later tonight or tomorrow. Just wanted to get the conversation started on the workaround.