Sam97305421562
Sam97305421562

Reputation: 3037

Alternative to JUnit in Android

As there is JUnit test tool for Desktop java, is there some thing similiar in android so one can apply on android also?

Upvotes: 0

Views: 808

Answers (2)

charroch
charroch

Reputation: 2220

You want to look into robolectric in order to run JUnit or any unit test locally on the JVM rather then device. The android.jar only contains stubs which will throw Runtime exceptions every time you hit it. To overcome this problem, robolectric shadows the android.jar which in terms lets you run local unit test.

Upvotes: 0

CommonsWare
CommonsWare

Reputation: 1006549

JUnit is available inside of Android, along with Android-specific test case base classes, to help exercise activities, services, etc.

Upvotes: 3

Related Questions