tag:blogger.com,1999:blog-25456655.post1302022437667520554..comments2024-03-23T07:01:55.848-04:00Comments on Diego Torres Milano's blog: Android Testing: ContentProvider integration tests using mock conDiego Torres Milanohttp://www.blogger.com/profile/12030778501784140349noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-25456655.post-58579781009260334112012-02-17T08:49:09.555-05:002012-02-17T08:49:09.555-05:00Hi Diego,
nice post, i'd also like to get my h...Hi Diego,<br />nice post, i'd also like to get my hands on the source code .. <br /><br />Could you provide a new link plsease?<br /><br />Cheers,<br />FabianFaBhttps://www.blogger.com/profile/15936443349997321591noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-87889273818354725292011-09-15T08:32:04.115-04:002011-09-15T08:32:04.115-04:00Hi Diego,
I just bought your Android Testing book...Hi Diego,<br /><br />I just bought your Android Testing book, and look forward to reading all of it.<br /><br />However, I scanned it for a tip on combining mocked database access with ActivityInstrumentationTestCase2 as I would like to use Robotium.<br /><br />However, it seems this blog entry is the latest on the issue?<br />I read the Google Docs paper, but the link to the source at http://sites.codtech.com/android/Home/source-code seems to be outdated? Can you provide a new link, so I can dig deeper?<br /><br />- JanJan Schoubohttps://www.blogger.com/profile/00330157728472900192noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-48291559059815530742010-09-29T18:05:18.393-04:002010-09-29T18:05:18.393-04:00Hi Free,
Thanks for posting your comments here and...Hi Free,<br />Thanks for posting your comments here and feel free to publish your improvements.Diego Torres Milanohttps://www.blogger.com/profile/12030778501784140349noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-58986820132023042492010-09-29T17:29:13.315-04:002010-09-29T17:29:13.315-04:00Thanks for linking to my article (Tenacious33). T...Thanks for linking to my article (Tenacious33). This approach is better than mine and I'm using it now. However, I needed small modifications and am still having problems getting the UI to display in the emulator in certain situations. I finally delved more into the mechanics of how instrumentation activities are being started. There's room for progress in that area. Unless you object, I'm going to post the modifications I made on my blog (since also the source link here is stale). This functionality should be in the test pkg and it'd make sense to propose adding it to the SDK.Unknownhttps://www.blogger.com/profile/05092263957325188935noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-9756419206017973182010-08-30T17:17:05.494-04:002010-08-30T17:17:05.494-04:00Hi again Diego :)
I was stuck trying to test-driv...Hi again Diego :)<br /><br />I was stuck trying to test-drive a searchable activity, I found out I can't inject an Intent with setActivityIntent in your ActivityAndContentProviderInstrumentationTestCase2.<br /><br />So I extended it overriding the above method:<br /><br />@Override<br />public void setActivityIntent(Intent intent)<br />{<br /> this.intent = intent;<br />}<br /><br />declaring a field:<br /><br />private Intent intent;<br /><br />and then modifying your setUp() method:<br /><br />if(intent == null)<br />{<br /> intent = new Intent(targetContext, activityClass);<br />}<br /><br />So I could start the activity in my tests with a custom intent (with ACTION_SEARCH in my case).<br /><br />Please let me know if I missed something from your implementation!<br /><br />gianpiUnknownhttps://www.blogger.com/profile/07531165246844301044noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-39611821400210036052010-08-30T12:09:23.027-04:002010-08-30T12:09:23.027-04:00Thanks for your comments.Thanks for your comments.Diego Torres Milanohttps://www.blogger.com/profile/12030778501784140349noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-69607173546541617422010-08-30T01:27:12.153-04:002010-08-30T01:27:12.153-04:00Hi Diego,
this is great. I was stuck with the sam...Hi Diego,<br /><br />this is great. I was stuck with the same problem and I was going to implement the same classes, but now I don't have to :)<br /><br />Tenacious33's approach is good, but I really don't like writing ad hoc methods that are only used for testing and are not real production code (to inject the mock context and content resolver). This solution is much neater.<br /><br />Keep up the good work!<br /><br />gianpiUnknownhttps://www.blogger.com/profile/07531165246844301044noreply@blogger.com