Robolectric Eclipse IDE setup

Posted: March 14, 2011 in Android, Java
Tags: ,

PivotalLabs Eclipse IDE instructions for using Robolectric is wrong. It is wrong in that you are not able to run junit tests from the Eclipse IDE as the Eclipse workspace and Eclipse IDE combination will not recognize linked-source individual files and files such as the AndroidManifest are required for robolectric to operate correctly during the junit tests.

I did put up a sample project(Wabash) with the eclipse IDE project layout of App-Parent project and the child JVMTest and child AndroidTestProject with a correct set of ant build scripts. It is left to you to fill-in or add the codeqa reports targets and logic. Also, under Eclipse 3.6 the openfile feature can open junit.xml files on junit view if you are executing a command line command sequence of:


eclipse --launcher.openFile absolute path of file to open

Thus, you can set an exec bash target to execute that after you have the junit tests run and the junit reports generated as if the Eclipse IDE is open that junit view will come up with the junit report.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s