Remove use of deprecated API from test sample code.

Modify tests sample code to use ActivityInstrumentationTestCase2 and its new
constructor.

Change-Id: Idf927b6641c8dfb4aede8cb2bba45de29320bcf5
This commit is contained in:
Brett Chabot
2010-03-18 18:47:53 -07:00
parent 75a73dc9fb
commit 880855ed20
7 changed files with 98 additions and 55 deletions

View File

@@ -16,18 +16,27 @@
package com.example.android.notepad;
import android.test.ActivityInstrumentationTestCase;
import android.test.ActivityInstrumentationTestCase2;
import com.example.android.notepad.NotesList;
/**
* Make sure that the main launcher activity opens up properly, which will be
* verified by {@link ActivityTestCase#testActivityTestCaseSetUpProperly}.
* verified by {@link #testActivityTestCaseSetUpProperly}.
*/
public class NotePadTest extends ActivityInstrumentationTestCase<NotesList> {
public class NotePadTest extends ActivityInstrumentationTestCase2<NotesList> {
public NotePadTest() {
super("com.example.android.notepad", NotesList.class);
}
/**
* Creates an {@link ActivityInstrumentationTestCase2} for the {@link NotesList} activity.
*/
public NotePadTest() {
super(NotesList.class);
}
/**
* Verifies that the activity under test can be launched.
*/
public void testActivityTestCaseSetUpProperly() {
assertNotNull("activity should be launched successfully", getActivity());
}
}