unit testing - Is it possible to find out if an Android application runs as part of an instrumentation test -


is there runtime check application find out if runs part of instrumentation test?

background: our application performs database sync when starting. should happen when started regularly. interferes instrumentation tests testing db sync. not surprisingly.

and other tests it's waste of cpu cycles.

if you're using activityunittestcase, set custom application object setapplication, , have flag in there switch database sync on or off? there's example of using custom application object on blog:

http://www.paulbutcher.com/2011/03/mock-objects-on-android-with-borachio-part-3/


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -