summaryrefslogtreecommitdiffstats
path: root/samples/LunarLander
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/LunarLander
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/LunarLander')
-rw-r--r--samples/LunarLander/tests/src/com/example/android/lunarlander/LunarLanderTest.java23
1 files changed, 16 insertions, 7 deletions
diff --git a/samples/LunarLander/tests/src/com/example/android/lunarlander/LunarLanderTest.java b/samples/LunarLander/tests/src/com/example/android/lunarlander/LunarLanderTest.java
index fae02da64..491748a9f 100644
--- a/samples/LunarLander/tests/src/com/example/android/lunarlander/LunarLanderTest.java
+++ b/samples/LunarLander/tests/src/com/example/android/lunarlander/LunarLanderTest.java
@@ -16,18 +16,27 @@
package com.example.android.lunarlander;
-import android.test.ActivityInstrumentationTestCase;
+import android.test.ActivityInstrumentationTestCase2;
import com.example.android.lunarlander.LunarLander;
/**
* Make sure that the main launcher activity opens up properly, which will be
- * verified by {@link ActivityTestCase#testActivityTestCaseSetUpProperly}.
+ * verified by {@link #testActivityTestCaseSetUpProperly}.
*/
-public class LunarLanderTest extends ActivityInstrumentationTestCase<LunarLander> {
+public class LunarLanderTest extends ActivityInstrumentationTestCase2<LunarLander> {
- public LunarLanderTest() {
- super("com.example.android.lunarlander", LunarLander.class);
- }
-
+ /**
+ * Creates an {@link ActivityInstrumentationTestCase2} for the {@link LunarLander} activity.
+ */
+ public LunarLanderTest() {
+ super(LunarLander.class);
+ }
+
+ /**
+ * Verifies that the activity under test can be launched.
+ */
+ public void testActivityTestCaseSetUpProperly() {
+ assertNotNull("activity should be launched successfully", getActivity());
+ }
}