Hi there,

sorry for asking the same question again (http://groups.google.com/
group/android-developers/browse_thread/thread/c6f695eddde1b135) but I
could not find an answer to this anywhere.

I want to run an Activity in an InstrumentationTestCase. This is my
test class:

public class MainMenuTest extends
 ActivityInstrumentationTestCase2<MainMenu> {

        private Activity mainMenu;

        public MainMenuTest() {
                super("de.htw_berlin.vosw.Activity", MainMenu.class);
        }

        public void setUp() throws Exception {
                super.setUp();
                this.setActivityIntent(new Intent(Intent.ACTION_MAIN));
                this.mainMenu = this.getActivity();
        }

        public void testActivityShowsMainMenu() throws Throwable {
                // testing here
        }
}

I keep getting the following error:

java.lang.RuntimeException: Unable to resolve activity for: Intent
{ act=android.intent.action.MAIN flg=0x10000000
cmp=de.htw_berlin.vosw.Activity/.MainMenu }
at android.app.Instrumentation.startActivitySync(Instrumentation.java:
447)
at
android.test.InstrumentationTestCase.launchActivityWithIntent(InstrumentationTestCase.java:
106)
at
android.test.ActivityInstrumentationTestCase2.getActivity(ActivityInstrumentationTestCase2.java:
89)
at
de.htw_berlin.vosw.test.Activity.TestMainMenu.setUp(TestMainMenu.java:
22)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:164)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:151)
at
android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:
425)
at android.app.Instrumentation
$InstrumentationThread.run(Instrumentation.java:1520)

Can someone give any clue on what I am doing wrong? Any help would be
much appreciated.

Greetings from Berlin,
Ste

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to