summaryrefslogtreecommitdiffstats
path: root/samples/NotePad
diff options
context:
space:
mode:
authorBrett Chabot <brettchabot@android.com>2010-03-18 18:47:53 -0700
committerBrett Chabot <brettchabot@android.com>2010-03-18 18:54:57 -0700
commit880855ed20bf9e95ca02e88ab54b71efa6dce45b (patch)
treeab0b976cbff10d8f4c80abc5963ff5c0b9dc8f88 /samples/NotePad
parent75a73dc9fb5345844c9529b578b473d84b04a158 (diff)
downloadandroid_development-880855ed20bf9e95ca02e88ab54b71efa6dce45b.tar.gz
android_development-880855ed20bf9e95ca02e88ab54b71efa6dce45b.tar.bz2
android_development-880855ed20bf9e95ca02e88ab54b71efa6dce45b.zip
Remove use of deprecated API from test sample code.
Modify tests sample code to use ActivityInstrumentationTestCase2 and its new constructor. Change-Id: Idf927b6641c8dfb4aede8cb2bba45de29320bcf5
Diffstat (limited to 'samples/NotePad')
-rw-r--r--samples/NotePad/tests/src/com/example/android/notepad/NotePadTest.java21
1 files changed, 15 insertions, 6 deletions
diff --git a/samples/NotePad/tests/src/com/example/android/notepad/NotePadTest.java b/samples/NotePad/tests/src/com/example/android/notepad/NotePadTest.java
index 452c5991c..80f71d289 100644
--- a/samples/NotePad/tests/src/com/example/android/notepad/NotePadTest.java
+++ b/samples/NotePad/tests/src/com/example/android/notepad/NotePadTest.java
@@ -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());
+ }
}