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:
@@ -16,17 +16,26 @@
|
||||
|
||||
package com.example.android.skeletonapp;
|
||||
|
||||
import android.test.ActivityInstrumentationTestCase;
|
||||
|
||||
import com.example.android.skeletonapp.SkeletonActivity;
|
||||
import android.test.ActivityInstrumentationTestCase2;
|
||||
|
||||
/**
|
||||
* Make sure that the main launcher activity opens up properly, which will be
|
||||
* verified by {@link ActivityTestCase#testActivityTestCaseSetUpProperly}.
|
||||
* verified by {@link #testActivityTestCaseSetUpProperly}.
|
||||
*/
|
||||
public class SkeletonAppTest extends ActivityInstrumentationTestCase<SkeletonActivity> {
|
||||
public class SkeletonAppTest extends ActivityInstrumentationTestCase2<SkeletonActivity> {
|
||||
|
||||
public SkeletonAppTest() {
|
||||
super("com.example.android.skeletonapp", SkeletonActivity.class);
|
||||
}
|
||||
/**
|
||||
* Creates an {@link ActivityInstrumentationTestCase2} for the {@link SkeletonActivity}
|
||||
* activity.
|
||||
*/
|
||||
public SkeletonAppTest() {
|
||||
super(SkeletonActivity.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifies that the activity under test can be launched.
|
||||
*/
|
||||
public void testActivityTestCaseSetUpProperly() {
|
||||
assertNotNull("activity should be launched successfully", getActivity());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user