Skip to content
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

NoSuchMethodException on invalidateRAM #28

Closed
piandrus opened this issue Jul 2, 2016 · 1 comment
Closed

NoSuchMethodException on invalidateRAM #28

piandrus opened this issue Jul 2, 2016 · 1 comment

Comments

@piandrus
Copy link

piandrus commented Jul 2, 2016

Hi,

When running unit tests with RobolectricGradleTestRunner I get a NoSuchMethodException exception stack trace when invalidating cache:

java.lang.NoSuchMethodException: java.util.LinkedHashMap.eldest()
    at java.lang.Class.getMethod(Class.java:1786)
    at com.vincentbrison.openlibraries.android.dualcache.RamLruCache.trimToSize(RamLruCache.java:210)
    at com.vincentbrison.openlibraries.android.dualcache.ReferenceLruCache.trimToSize(ReferenceLruCache.java:7)
    at com.vincentbrison.openlibraries.android.dualcache.RamLruCache.evictAll(RamLruCache.java:316)
    at com.vincentbrison.openlibraries.android.dualcache.DualCache.invalidateRAM(DualCache.java:415)
    at com.vincentbrison.openlibraries.android.dualcache.DualCache.invalidate(DualCache.java:407)

I guess this is due to difference between Oracle and Dalvik implementation. Maybe an iterator mechanism could be used when calling "eldest()" fails? This could make unit tests outside Android environment work better. What do you think?

Thanks for working on this library! :)

@vincentbrison
Copy link
Owner

Hi,

Thanks for your feedback.

The library is not made of pur java code. If it was the case, I would wrote unit tests which could be run on regular Java VMs. But this is not the case, the library include Android specific code, and thus the instrumentation tests I wrote are made to be run on regular Android devices. Genymotion and official emulators are supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants