1 /* 2 * Copyright (C) 2008 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.example.android.apis; 18 19 import android.test.ApplicationTestCase; 20 21 import androidx.test.filters.MediumTest; 22 import androidx.test.filters.SmallTest; 23 24 /** 25 * This is a simple framework for a test of an Application. See 26 * {@link android.test.ApplicationTestCase ApplicationTestCase} for more information on 27 * how to write and extend Application tests. 28 * 29 * To run this test, you can type: 30 * adb shell am instrument -w \ 31 * -e class com.example.android.apis.ApiDemosApplicationTests \ 32 * com.example.android.apis.tests/android.test.InstrumentationTestRunner 33 */ 34 public class ApiDemosApplicationTests extends ApplicationTestCase<ApiDemosApplication> { 35 ApiDemosApplicationTests()36 public ApiDemosApplicationTests() { 37 super(ApiDemosApplication.class); 38 } 39 40 @Override setUp()41 protected void setUp() throws Exception { 42 super.setUp(); 43 } 44 45 /** 46 * The name 'test preconditions' is a convention to signal that if this 47 * test doesn't pass, the test case was not set up properly and it might 48 * explain any and all failures in other tests. This is not guaranteed 49 * to run before other tests, as junit uses reflection to find the tests. 50 */ 51 @SmallTest testPreconditions()52 public void testPreconditions() { 53 } 54 55 /** 56 * Test basic startup/shutdown of Application 57 */ 58 @MediumTest testSimpleCreate()59 public void testSimpleCreate() { 60 createApplication(); 61 } 62 63 } 64