From 880855ed20bf9e95ca02e88ab54b71efa6dce45b Mon Sep 17 00:00:00 2001 From: Brett Chabot Date: Thu, 18 Mar 2010 18:47:53 -0700 Subject: Remove use of deprecated API from test sample code. Modify tests sample code to use ActivityInstrumentationTestCase2 and its new constructor. Change-Id: Idf927b6641c8dfb4aede8cb2bba45de29320bcf5 --- .../android/lunarlander/LunarLanderTest.java | 23 +++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'samples/LunarLander') 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 { +public class LunarLanderTest extends ActivityInstrumentationTestCase2 { - 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()); + } } -- cgit v1.2.3