mas-mob-app-devs/techbook-app — pull request #11 by Kakarot (2013-11-17 17:53:53+00:00)
Title: Added Testing Framework that works with Android

I wanted a way for us to unit test our code, so I researched how to do unit testing with Android.

Basically, unlike other JUnits, an Android JUnit needs to be it's own "project" inside Eclipse. It's a special project that needs to target our TechBook project. After building it, you can place regular JUnits inside of it and click "Run as Android JUnit" which will deploy an APK to an emulator or phone and run the JUnits (that is why it was't working, it needs that special Dalvik JVM not our regular Java SE).

It isn't that difficult to setup, and the good news is that once it is setup, you don't need to ever modify anything but the JUnit. For example, if you break something in the TechBook project, the TechBookTest project can detect it without needing to be created again, just run the JUnit. Also, the reason that Android wants it's own JUnit project, is because unlike regular JUnit, it can test Activities and Components as well, so it needs that sandboxed layer.

Honestly I was hesitant to upload this and make it a pull request, since it looks like another project, but I checked the file size and the testing project is really just a fancy folder and the file size is only 256KB, including the JUnit itself.

If you think we should each run our tests locally outside the project, let me know and I'll remove the directory from future commits and you can close this pull request.