views:

16

answers:

1

Hi all,

I'm new in android testing. All I've used in the testing is only the ActivityInstrumentationTestCase2 (AITC2) which is explained in the Hello, Testing tutorial.

I've made a test class using AITC2 and it runs well. But once I changed the base test class to SingleLaunchActivityTestCase (SLATC) I got RuntimeException specifying "Unable to resolve intent.. blabla.." which I suspect was originated from launchActivity().

I thought AITC2 and SLATC are pretty much the same, besides that in SLATC the activity being tested only launched once (setUp() only launched once for all test cases) and in AITC2 the activity will be launced for every test cases.

I've tried to find some example or documentation about how to use SLATC but still no luck.. :(.

Anybody knows why the activity cannot be launched in SLATC? Thanks in advance :)

A: 

Solved it. I put a wrong package string in the constructor because I have several different subpackages in my project.

I put [package].activity, it should be only [package].

Kind of weird answering my own question, but just in case someone looking for an answer from the same mistake as mine.

swMadjid