Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Setup for non-maven

Received: by 10.52.178.166 with SMTP id cz6mr5065565vdc.1.1339800279491;
        Fri, 15 Jun 2012 15:44:39 -0700 (PDT)
X-BeenThere: robolectric@googlegroups.com
Received: by 10.220.119.137 with SMTP id z9ls1009269vcq.2.gmail; Fri, 15 Jun
 2012 15:44:39 -0700 (PDT)
Received: by 10.52.68.134 with SMTP id w6mr74682vdt.6.1339800279096;
        Fri, 15 Jun 2012 15:44:39 -0700 (PDT)
Date: Fri, 15 Jun 2012 15:44:38 -0700 (PDT)
From: Chuck Greb <charles.g...@gmail.com>
To: robolectric@googlegroups.com
Message-Id: <49aa0134-a3f9-43a6-9e7d-2b587e0816eb@googlegroups.com>
In-Reply-To: <e94e0bfa-cc31-4e7a-8441-cec7d4b039fa@googlegroups.com>
References: <44edcaf5-748d-4f6a-a480-4a53e4f96f16@googlegroups.com>
 <e9b27290-71fd-42d2-ac37-0b0654ca6733@googlegroups.com>
 <3d482a5b-ff76-4ce7-9e33-7ecba2a1cdad@googlegroups.com>
 <e5a4ced3-23b3-49fe-990f-94a94a620355@googlegroups.com>
 <e94e0bfa-cc31-4e7a-8441-cec7d4b039fa@googlegroups.com>
Subject: Re: Setup for non-maven
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_3791_196033.1339800278779"

------=_Part_3791_196033.1339800278779
Content-Type: multipart/alternative; 
	boundary="----=_Part_3792_6405164.1339800278780"

------=_Part_3792_6405164.1339800278780
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

I have never seen this error before. It looks like it's coming from this=20
line but I'm not sure why. Are you using a custom test runner or class=20
loader?

https://github.com/pivotal/robolectric/blob/master/src/main/java/com/xtreme=
labs/robolectric/RobolectricTestRunner.java#L234


On Friday, June 15, 2012 6:28:31 PM UTC-4, Leif Ashley wrote:
>
> Thanks again... that gets me further along, but now I get:
>
> java.lang.RuntimeException: java.lang.ClassCastException:=20
> com.xtremelabs.robolectric.RobolectricTestRunner cannot be cast to=20
> com.xtremelabs.robolectric.internal.RobolectricTestRunnerInterface
>
> It looks like the RobolectricTestRunner didn't implement=20
> the RobolectricTestRunnerInterface in this jar. Sound right to you?
>
>
> On Friday, June 15, 2012 6:24:21 PM UTC-4, Chuck Greb wrote:
>>
>> Highlight robolectric-1.2-SNAPSHOT-jar-with-dependencies.jar and then=20
>> from the bottom-right panel choose the "Artifact Information" tab and th=
en=20
>> you will see a button to Download.
>>
>>
>> On Friday, June 15, 2012 6:19:32 PM UTC-4, Leif Ashley wrote:
>>>
>>> Cool - I'll look at the starter. I have it somewhat running with a quic=
k=20
>>> test setup of my own, but I think I'm missing dependencies. I found thi=
s on=20
>>> their site:
>>>
>>> "If you=E2=80=99re not using Maven to build your project, you=E2=80=99l=
l probably want=20
>>> to grab the latest robolectric-X.X.X-jar-with-dependencies.jar from=20
>>> Sonatype<https://oss.sonatype.org/index.html#nexus-search;quick~robolec=
tric>
>>> "
>>>
>>> But for the life of me, I cannot figure out how to download the jar fro=
m=20
>>> Sonatype. lol
>>>
>>>
>>>
>>> On Friday, June 15, 2012 6:13:12 PM UTC-4, Chuck Greb wrote:
>>>>
>>>> Using IntelliJ, you can either include Robolectric as a module (source=
)=20
>>>> or a library (jar). Robolectric should be added as a dependency to you=
r=20
>>>> application module (above Android platform, scope TEST).
>>>>
>>>> You should setup the tests as Java/JUnit (not an Android project test)=
.=20
>>>> Robolectric tests live inside the same module as your application. No=
=20
>>>> emulator/device is required.
>>>>
>>>> Also, check out the AndroidIntelliJStarter project for a good example=
=20
>>>> of integration as a submodule.
>>>>
>>>> https://github.com/pivotal/AndroidIntelliJStarter
>>>>
>>>> Best,
>>>> Chuck
>>>>
>>>> On Friday, June 15, 2012 5:50:56 PM UTC-4, Leif Ashley wrote:
>>>>>
>>>>> I am wanting to use Robolectric in our development efforts and I'm a=
=20
>>>>> bit confused on a few points.
>>>>>
>>>>> The examples all show maven. However we are using Idea to run/test vi=
a=20
>>>>> the IDE launch and scripted ant scripts for test builds. What's the b=
est=20
>>>>> method to unit test an android application with Robolectric in this=
=20
>>>>> senario? Do I create a separate java project or an Android test proje=
ct?=20
>>>>> Personally, I want to have it just run as a local test (i.e. not runn=
ing on=20
>>>>> a USB/simulator device).
>>>>>
>>>>
------=_Part_3792_6405164.1339800278780
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

I have never seen this error before. It looks like it's coming from this li=
ne but I'm not sure why. Are you using a custom test runner or class loader=
?<div><br></div><div>https://github.com/pivotal/robolectric/blob/master/src=
/main/java/com/xtremelabs/robolectric/RobolectricTestRunner.java#L234</div>=
<div><br></div><div><div><br>On Friday, June 15, 2012 6:28:31 PM UTC-4, Lei=
f Ashley wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-=
left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Thanks again...=
 that gets me further along, but now I get:<div><br></div><div>java.lang.Ru=
ntimeException: java.lang.ClassCastException: com.xtremelabs.robolectric.<w=
br>RobolectricTestRunner cannot be cast to com.xtremelabs.robolectric.<wbr>=
internal.<wbr>RobolectricTestRunnerInterface</div><div><br></div><div>It lo=
oks like the&nbsp;RobolectricTestRunner didn't implement the&nbsp;<wbr>Robo=
lectricTestRunnerInterface in this jar. Sound right to you?</div><div><br><=
br>On Friday, June 15, 2012 6:24:21 PM UTC-4, Chuck Greb wrote:<blockquote =
class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #=
ccc solid;padding-left:1ex">Highlight&nbsp;robolectric-1.2-<wbr>SNAPSHOT-ja=
r-with-<wbr>dependencies.jar and then from the bottom-right panel choose th=
e "Artifact Information" tab and then you will see a button to Download.<di=
v><br><br>On Friday, June 15, 2012 6:19:32 PM UTC-4, Leif Ashley wrote:<blo=
ckquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-le=
ft:1px #ccc solid;padding-left:1ex">Cool - I'll look at the starter. I have=
 it somewhat running with a quick test setup of my own, but I think I'm mis=
sing dependencies. I found this on their site:<div><br></div><div>"<span st=
yle=3D"color:rgb(51,51,51);font-family:helvetica,arial,sans-serif;font-size=
:14px;line-height:19px">If you=E2=80=99re not using Maven to build your pro=
ject, you=E2=80=99ll probably want to grab the latest robolectric-X.X.X-jar=
-with-<wbr>dependencies.jar from&nbsp;</span><a href=3D"https://oss.sonatyp=
e.org/index.html#nexus-search;quick~robolectric" style=3D"color:rgb(119,119=
,119);border-bottom-style:solid;border-bottom-width:1px;border-bottom-color=
:rgb(204,204,204);font-family:helvetica,arial,sans-serif;font-size:14px;lin=
e-height:19px" target=3D"_blank">Sonatype</a>"</div><div><br></div><div>But=
 for the life of me, I cannot figure out how to download the jar from Sonat=
ype. lol</div><div><br></div><div><br><br>On Friday, June 15, 2012 6:13:12 =
PM UTC-4, Chuck Greb wrote:<blockquote class=3D"gmail_quote" style=3D"margi=
n:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Usi=
ng IntelliJ, you can either include Robolectric as a module (source) or a l=
ibrary (jar).&nbsp;Robolectric should be added as a dependency to your appl=
ication module (above Android platform, scope TEST).<br></div><div><br></di=
v><div>You should setup the tests as Java/JUnit (not an Android project tes=
t). Robolectric tests live inside the same module as your application. No e=
mulator/device is required.</div><div><div><div><br></div><div>Also, check =
out the AndroidIntelliJStarter project for a good example of integration as=
 a submodule.<br></div><div><br></div><div><a href=3D"https://github.com/pi=
votal/AndroidIntelliJStarter" target=3D"_blank">https://github.com/pivotal/=
<wbr>AndroidIntelliJStarter</a></div><div><br></div><div>Best,</div><div>Ch=
uck<br><br>On Friday, June 15, 2012 5:50:56 PM UTC-4, Leif Ashley wrote:<bl=
ockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-l=
eft:1px #ccc solid;padding-left:1ex">I am wanting to use Robolectric in our=
 development efforts and I'm a bit confused on a few points.<div><br></div>=
<div>The examples all show maven. However we are using Idea to run/test via=
 the IDE launch and scripted ant scripts for test builds. What's the best m=
ethod to unit test an android application with Robolectric in this senario?=
 Do I create a separate java project or an Android test project? Personally=
, I want to have it just run as a local test (i.e. not running on a USB/sim=
ulator device).</div></blockquote></div></div></div></blockquote></div></bl=
ockquote></div></blockquote></div></blockquote></div></div>
------=_Part_3792_6405164.1339800278780--

------=_Part_3791_196033.1339800278779--