Hello all,

I am trying to do unit tests for a Widget that does not have any
activity, only RemoteViews, etc.
I tried to use android.test.AndroidTestCase but I have and issue and
question:

1. When trying to instantiate a service via
context.getSystemService... the test fails with the error,
"java.lang.NullPointerException"
2. How to run tests on Methods inside a AppWidgetProvider? I guess it
is not possible to create instances of AppWidgetProvider and use the
methods inside.

Also I tried to use JUnit, but since the AppWidgetProvider depends on
a context, I was not able to get a context in pure JUnit (with
AndroidTestCase I could use getContext()).

I tried to google and look into source code in the web, but I could
not find any unit tests done for AppWidgetProviders (most were on
Activities).

I would appreciate any information.

Regards.

Carl
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to