Thursday, January 28, 2010

Android Testing: testing XML or JSON parsers

There are many occasions where your Android application relies on external XML or JSON messages or documents obtained from web services. These documents are used for data interchange between the local application and the server. There are many use cases where XML or JSON documents are generated by the local application to be sent to the server. Ideally, methods invoked by these activities have to be tested in isolation to have real unit tests and to achieve this we need to include some mock files somewhere in our APK to run the tests.
But the question is where can we include these files ?
Let's find it out.


Read the complete article in Google Docs:
http://docs.google.com/View?id=ddwc44gs_239fhchvfds

3 comments:

annie said...
This comment has been removed by a blog administrator.
redsolo said...

I have an app that parses JSON and communicates with a website. Since I put everything into a separate maven/eclipse project, my development speed has increased a lot since I dont have to test everything through the Android emulator.

It is very easy to use JSON and the Apache HttpClient APIs outside the android emulator. Also outside the emulator you can use virtually any mocking framework and use JUnit 4. So my tip is to lift out most of the things into a separate project and "only" have the GUI parts in the Android project.

Android app development said...

How we can easily develop this Android application by read your post I came to know.This is one of the effective post.
Android app developers