tag:blogger.com,1999:blog-6931502956661392072.post7169527450208100889..comments2024-02-05T11:53:03.039+01:00Comments on gsusmonzon: Testing with Robolectric in Androidgsusmonzonhttp://www.blogger.com/profile/01676733640860072666noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-6931502956661392072.post-47455403326218124802014-02-11T09:24:13.309+01:002014-02-11T09:24:13.309+01:00HI! It's really doesn't work with new vers...HI! It's really doesn't work with new version of robolectric. How to fix this?Anonymoushttps://www.blogger.com/profile/06097552621033541801noreply@blogger.comtag:blogger.com,1999:blog-6931502956661392072.post-21376695325584808172013-10-07T14:18:08.748+02:002013-10-07T14:18:08.748+02:00Hi,
I have also tried to follow this guide but is...Hi, <br />I have also tried to follow this guide but is getting the same error as Madhushree. It looks like it tries to download its dependencies with Maven.Anonymoushttps://www.blogger.com/profile/08529606459309664660noreply@blogger.comtag:blogger.com,1999:blog-6931502956661392072.post-59498151508243084692013-10-05T14:40:07.843+02:002013-10-05T14:40:07.843+02:00Thank you very much for the post. Nice article :)
...Thank you very much for the post. Nice article :)<br />I am trying to setup Robolectric 2.1.1 jar with-dependencies in Eclipse(without maven). But unfortunately i get <br />Downloading: org/robolectric/android-base/4.1.2_r1_rc/android-base-4.1.2_r1_rc.pom from repository central at http://nexus:8081/nexus/content/groups/build.snapshots/ in console and hence not able to run my tests.<br />My tests fails saying unable to resolve artifact org.robolectric:android-base:jarreal:4.1.2_r1_rc<br />Is there something which I am missing. Please help me out.<br />But the tests are green if i use the older releases of robolectric jar. (Eg : 1.X.X jar with dependencies) Clueless as to why this is happenning.<br />Could you please guide me if possible.Anonymoushttps://www.blogger.com/profile/13117221950052405519noreply@blogger.comtag:blogger.com,1999:blog-6931502956661392072.post-29193583608859301582013-07-23T14:09:29.433+02:002013-07-23T14:09:29.433+02:00Sorry, I've been disconnected for some time.
I...Sorry, I've been disconnected for some time.<br />In latest versions of Roboelectric, you should instantiate the activity in the setUp method. Something like<br /><br /> public void setUp() throws Exception {<br /> super.setUp();<br /><br /> mockActivity = Robolectric.buildActivity(MockActivity.class).create().get();<br /> fooRes = (EditText) loginActivity.findViewById(R.id.fooRes);<br /> ...<br /> }gsusmonzonhttps://www.blogger.com/profile/01676733640860072666noreply@blogger.comtag:blogger.com,1999:blog-6931502956661392072.post-8673861690560947622013-06-11T02:35:56.221+02:002013-06-11T02:35:56.221+02:00Thanks for the post with simplified approach.
I w...Thanks for the post with simplified approach. <br />I was successful following these steps. But when I wrote this to test my Activity ,I got exception <br />mockActivity = new MockActivity();<br />mockActivity.onCreate(null); //fails during setContentView call.<br /><br />java.lang.NullPointerException<br />at org.robolectric.shadows.ShadowContextWrapper.getApplicationInfo(ShadowContextWrapper.java:192)<br />at android.content.ContextWrapper.getApplicationInfo(ContextWrapper.java)<br />at android.view.ViewGroup.initViewGroup(ViewGroup.java:447)<br />at android.view.ViewGroup.__constructor__(ViewGroup.java:417)<br />at android.view.ViewGroup.(ViewGroup.java:416)<br />at android.widget.FrameLayout.(FrameLayout.java:93)<br />at org.robolectric.tester.android.view.RoboWindow$1.(RoboWindow.java:218)<br />at org.robolectric.tester.android.view.RoboWindow.getDecorView(RoboWindow.java:218)<br />at org.robolectric.tester.android.view.RoboWindow.setContentView(RoboWindow.java:80)MKhttps://www.blogger.com/profile/01790139316166738853noreply@blogger.comtag:blogger.com,1999:blog-6931502956661392072.post-85854466709449655232013-06-10T21:07:37.180+02:002013-06-10T21:07:37.180+02:00This comment has been removed by the author.MKhttps://www.blogger.com/profile/01790139316166738853noreply@blogger.comtag:blogger.com,1999:blog-6931502956661392072.post-20468642811941145872013-05-22T23:54:52.800+02:002013-05-22T23:54:52.800+02:00It helped me a lot, thanks! I was having problems ...It helped me a lot, thanks! I was having problems with Roboelectric in Eclipse, and your post was very helpful.FLUIDhttps://www.blogger.com/profile/13187840645735853872noreply@blogger.com