Skip to content

How to test? #2

@jlhonora

Description

@jlhonora

Hi Blake,

I've always wondered what's the best approach for testing SyncAdapters. Do you have any ideas on this? Since this project is mostly educational I thought it would be a not-so-bad place to ask.

No one seems to have a clue:

https://groups.google.com/forum/#!topic/android-developers/KsLyp9ryK4A
http://stackoverflow.com/questions/19926360/android-testing-syncadapter
http://stackoverflow.com/questions/24748536/how-to-test-sync-adapter-running

And considering the last issue we discussed, I began considering testing alternatives such as:

  1. Moving the SyncAdapter's logic to a separate library and test the methods with unit tests. Problem: doesn't test the SyncAdapter's lifecycle
  2. Fire up a test runner, make it wait and then check if things change, such as DB entries, etc. Problem: too much stuff happening behind the curtains, probably flaky

It would be great to have your input on this. Sorry if it's beyond the scope of the repo. Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions