So, I'm new to android unit testing. I'm trying to write a unit test for the Phone application:
package com.android.phone;
import android.content.Intent;
import android.net.Uri;
import android.test.ApplicationTestCase;
import android.test.suitebuilder.annotation.MediumTest;
import com.android.phone.PhoneApp;
import dalvik.annotation.TestTargetClass;
@TestTargetClass(PhoneApp.class)
public class TestPhone extends ApplicationTestCase<PhoneApp> {
public TestPhone() {
super(PhoneApp.class);
}
private PhoneApp phone;
@Override
protected void setUp() throws Exception {
super.setUp();
phone = getApplication();
}
@MediumTest
public void testDialerIsUp() {
assertNotNull("Phone app does not exist", phone);
// TODO add tests
}
}
Then I start an emulator, wait till it boots up, and run those tests:
adb shell am instrument -e class com.android.phone.TestPhone -r -w com.android.phone.tests/android.test.InstrumentationTestRunner
And now I'm getting a junit.framework.AssertionFailedError: PhoneApp does not exist
. What is wrong here, why isn't PhoneApp up?