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 --- .../com/example/android/notepad/NotePadTest.java | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'samples/NotePad') 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 { +public class NotePadTest extends ActivityInstrumentationTestCase2 { - 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()); + } } -- cgit v1.2.3