I just returned from a break, and discovered that one of our team wrote a shadow for AsyncTask#executeOnExecutor.
It's an API level 11 call, and as such the current Robolectric, built against API 10 jars, fails the RobolectricWiringTest:
testAllImplementationMethodsHaveCorrectSignature(com.xtremelabs.robolectric .bytecode.RobolectricWiringTest) Time elapsed: 0.416 sec <<< FAILURE! java.lang.AssertionError: @Implementation method mismatch: public final android.os.AsyncTask<Params, Progress, Result> com.xtremelabs.robolectric.shadows.ShadowAsyncTask.executeOnExecutor(java.u til.concurrent.Executor,Params[]) doesn't match a real method expected:<0> but was:<1>
I've fixed the build in the main repo, but we're using this in our app, and so we want Robolectric to support it.
1) Is there any reason Robolectric is still using the API level 10 (Android 2.3.3) jars, other than a lack of necessity to upgrade before now? 2) Can we update to a newer set of jars? Will there be anticipated problems, as with the Android support jar?
If no one has issues, I'd like to take a stab at the work.
I say go for it. I don't understand the issues that may be caused by
the compatibility/support jars... It would be interesting to understand
what the problems might be.
--Tyler
On Wed, Jun 6, 2012 at 10:09 AM, Michael Portuesi <mportues...@gmail.com>wrote:
> I just returned from a break, and discovered that one of our team wrote a
> shadow for AsyncTask#executeOnExecutor.
> It's an API level 11 call, and as such the current Robolectric, built
> against API 10 jars, fails the RobolectricWiringTest:
> testAllImplementationMethodsHaveCorrectSignature(com.xtremelabs.robolectric .bytecode.RobolectricWiringTest)
> Time elapsed: 0.416 sec <<< FAILURE!
> java.lang.AssertionError: @Implementation method mismatch: public final
> android.os.AsyncTask<Params, Progress, Result>
> com.xtremelabs.robolectric.shadows.ShadowAsyncTask.executeOnExecutor(java.u til.concurrent.Executor,Params[])
> doesn't match a real method expected:<0> but was:<1>
> I've fixed the build in the main repo, but we're using this in our app,
> and so we want Robolectric to support it.
> 1) Is there any reason Robolectric is still using the API level 10
> (Android 2.3.3) jars, other than a lack of necessity to upgrade before now?
> 2) Can we update to a newer set of jars? Will there be anticipated
> problems, as with the Android support jar?
> If no one has issues, I'd like to take a stab at the work.
Hey Michael, I was about to use AsyncTask#executeOnExecutor and noticed that lack of support. How is your implementation coming along? I'd like to grab that code from you if you're done.
It turned out that whatever test we were writing didn't explicitly need an
implmentation of AsyncTask#**executeOnExecutor. So, I haven't done any
work on building Robolectric with Android 4.x jars. I'm really sorry to
disappoint.
Regards,
m
On Fri, Jul 20, 2012 at 10:53 AM, Christopher Perry <
mr.christopher.pe...@gmail.com> wrote:
> Hey Michael, I was about to use AsyncTask#**executeOnExecutor and noticed
> that lack of support. How is your implementation coming along? I'd like to
> grab that code from you if you're done.
With the arrival of Jelly Bean, we've run into a situation where we need to
get Robolectric running on 4.1. In particular, Android's WebSettings has
become an abstract class in Android 4.1, and tests which use WebView fail
because Robolectric can no longer instantiate the abstract class via
reflection.
So, I've done the work to get Robolectric building and passing tests
against Android 4.0.1 in my local workarea (at least with the Maven build).
I'll likely be pushing those changes to master soon (including fixes for
ant I hope), so I wanted to give a heads-up to those who might have been
anticipating or fearing such a development.
4.0.1 still doesn't get me personally where I want to be - I need to build
against 4.1 - but the maven repo at maven.org does not have Android 4.1
jars available. Does anyone know anything about that process and how new
jars get added over there? I can do a local config and repository setup,
but it's kind of a pain to do, especially for everyone across a development
team.
Thanks,
Michael Portuesi
On Fri, Jul 20, 2012 at 1:35 PM, Michael Portuesi <mportues...@gmail.com>wrote:
> It turned out that whatever test we were writing didn't explicitly need an
> implmentation of AsyncTask#**executeOnExecutor. So, I haven't done any
> work on building Robolectric with Android 4.x jars. I'm really sorry to
> disappoint.
> Regards,
> m
> On Fri, Jul 20, 2012 at 10:53 AM, Christopher Perry <
> mr.christopher.pe...@gmail.com> wrote:
>> Hey Michael, I was about to use AsyncTask#**executeOnExecutor and
>> noticed that lack of support. How is your implementation coming along? I'd
>> like to grab that code from you if you're done.
I've just pushed to pivotal-robolectric the changes to build Robolectric against the Android 4.0 jars. Both the ant build.xml file and the maven POM are updated.
I would have targeted 4.1, but the public maven repositories don't yet have a 4.1 android.jar available, and I didn't want the build to get out of sync between the two build systems. Once the maven-android maintainers burp out a 4.1 jar, I'll look into getting Robolectric building there.
I didn't update the Travis configuration in the build.xml, so the Travis CI build is currently busted (it was already failing prior to this change). If there's anything I can do to help with that, please let me know.
On Wednesday, July 25, 2012 10:32:43 AM UTC-7, Michael Portuesi wrote:
> Chris,
> With the arrival of Jelly Bean, we've run into a situation where we need > to get Robolectric running on 4.1. In particular, Android's WebSettings > has become an abstract class in Android 4.1, and tests which use WebView > fail because Robolectric can no longer instantiate the abstract class via > reflection.
> So, I've done the work to get Robolectric building and passing tests > against Android 4.0.1 in my local workarea (at least with the Maven build). > I'll likely be pushing those changes to master soon (including fixes for > ant I hope), so I wanted to give a heads-up to those who might have been > anticipating or fearing such a development.
> 4.0.1 still doesn't get me personally where I want to be - I need to build > against 4.1 - but the maven repo at maven.org does not have Android 4.1 > jars available. Does anyone know anything about that process and how new > jars get added over there? I can do a local config and repository setup, > but it's kind of a pain to do, especially for everyone across a development > team.
> Thanks, > Michael Portuesi
> On Fri, Jul 20, 2012 at 1:35 PM, Michael Portuesi <mportues...@gmail.com>wrote:
>> Chris,
>> It turned out that whatever test we were writing didn't explicitly need >> an implmentation of AsyncTask#**executeOnExecutor. So, I haven't done >> any work on building Robolectric with Android 4.x jars. I'm really sorry >> to disappoint.
>> Regards, >> m
>> On Fri, Jul 20, 2012 at 10:53 AM, Christopher Perry < >> mr.christopher.pe...@gmail.com> wrote:
>>> Hey Michael, I was about to use AsyncTask#**executeOnExecutor and >>> noticed that lack of support. How is your implementation coming along? I'd >>> like to grab that code from you if you're done.
On Wednesday, July 25, 2012 10:32:43 AM UTC-7, Michael Portuesi wrote:
> Chris,
> With the arrival of Jelly Bean, we've run into a situation where we need > to get Robolectric running on 4.1. In particular, Android's WebSettings > has become an abstract class in Android 4.1, and tests which use WebView > fail because Robolectric can no longer instantiate the abstract class via > reflection.
> So, I've done the work to get Robolectric building and passing tests > against Android 4.0.1 in my local workarea (at least with the Maven build). > I'll likely be pushing those changes to master soon (including fixes for > ant I hope), so I wanted to give a heads-up to those who might have been > anticipating or fearing such a development.
> 4.0.1 still doesn't get me personally where I want to be - I need to build > against 4.1 - but the maven repo at maven.org does not have Android 4.1 > jars available. Does anyone know anything about that process and how new > jars get added over there? I can do a local config and repository setup, > but it's kind of a pain to do, especially for everyone across a development > team.
> Thanks, > Michael Portuesi
> On Fri, Jul 20, 2012 at 1:35 PM, Michael Portuesi <mport...@gmail.com<javascript:> > > wrote:
>> Chris,
>> It turned out that whatever test we were writing didn't explicitly need >> an implmentation of AsyncTask#**executeOnExecutor. So, I haven't done >> any work on building Robolectric with Android 4.x jars. I'm really sorry >> to disappoint.
>> Regards, >> m
>> On Fri, Jul 20, 2012 at 10:53 AM, Christopher Perry < >> mr.christo...@gmail.com <javascript:>> wrote:
>>> Hey Michael, I was about to use AsyncTask#**executeOnExecutor and >>> noticed that lack of support. How is your implementation coming along? I'd >>> like to grab that code from you if you're done.