1 /* 2 * Copyright (C) 2016 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 18 package com.android.settings.search; 19 20 import android.provider.SearchIndexablesContract; 21 import android.test.AndroidTestCase; 22 import android.test.suitebuilder.annotation.SmallTest; 23 24 25 public class SearchIndexablesContractTest extends AndroidTestCase { 26 @SmallTest testRawColumns_IncludesRank()27 public void testRawColumns_IncludesRank() { 28 assertEquals(SearchIndexablesContract.RawData.COLUMN_RANK, 29 SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[0]); 30 } 31 32 @SmallTest testRawColumns_IncludesTitle()33 public void testRawColumns_IncludesTitle() { 34 assertEquals(SearchIndexablesContract.RawData.COLUMN_TITLE, 35 SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[1]); 36 } 37 38 @SmallTest testRawColumns_IncludesSummaryOn()39 public void testRawColumns_IncludesSummaryOn() { 40 assertEquals(SearchIndexablesContract.RawData.COLUMN_SUMMARY_ON, 41 SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[2]); 42 } 43 44 @SmallTest testRawColumns_IncludesSummaryOff()45 public void testRawColumns_IncludesSummaryOff() { 46 assertEquals(SearchIndexablesContract.RawData.COLUMN_SUMMARY_OFF, 47 SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[3]); 48 } 49 50 @SmallTest testRawColumns_IncludesEntries()51 public void testRawColumns_IncludesEntries() { 52 assertEquals(SearchIndexablesContract.RawData.COLUMN_ENTRIES, 53 SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[4]); 54 } 55 56 @SmallTest testRawColumns_IncludesKeywords()57 public void testRawColumns_IncludesKeywords() { 58 assertEquals(SearchIndexablesContract.RawData.COLUMN_KEYWORDS, 59 SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[5]); 60 } 61 62 @SmallTest testRawColumns_IncludesScreenTitle()63 public void testRawColumns_IncludesScreenTitle() { 64 assertEquals(SearchIndexablesContract.RawData.COLUMN_SCREEN_TITLE, 65 SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[6]); 66 } 67 68 @SmallTest testRawColumns_IncludesClassName()69 public void testRawColumns_IncludesClassName() { 70 assertEquals(SearchIndexablesContract.RawData.COLUMN_CLASS_NAME, 71 SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[7]); 72 } 73 74 @SmallTest testRawColumns_IncludesIcon()75 public void testRawColumns_IncludesIcon() { 76 assertEquals(SearchIndexablesContract.RawData.COLUMN_ICON_RESID, 77 SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[8]); 78 } 79 80 @SmallTest testRawColumns_IncludesIntentAction()81 public void testRawColumns_IncludesIntentAction() { 82 assertEquals(SearchIndexablesContract.RawData.COLUMN_INTENT_ACTION, 83 SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[9]); 84 } 85 86 @SmallTest testRawColumns_IncludesIntentTargetPackage()87 public void testRawColumns_IncludesIntentTargetPackage() { 88 assertEquals(SearchIndexablesContract.RawData.COLUMN_INTENT_TARGET_PACKAGE, 89 SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[10]); 90 } 91 92 @SmallTest testRawColumns_IncludesTargetClass()93 public void testRawColumns_IncludesTargetClass() { 94 assertEquals(SearchIndexablesContract.RawData.COLUMN_INTENT_TARGET_CLASS, 95 SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[11]); 96 } 97 98 @SmallTest testRawColumns_IncludesKey()99 public void testRawColumns_IncludesKey() { 100 assertEquals(SearchIndexablesContract.RawData.COLUMN_KEY, 101 SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[12]); 102 } 103 104 @SmallTest testRawColumns_IncludesUserId()105 public void testRawColumns_IncludesUserId() { 106 assertEquals(SearchIndexablesContract.RawData.COLUMN_USER_ID, 107 SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[13]); 108 } 109 110 @SmallTest testRawColumns_IncludesPayloadType()111 public void testRawColumns_IncludesPayloadType() { 112 assertEquals(SearchIndexablesContract.RawData.PAYLOAD_TYPE, 113 SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[14]); 114 } 115 116 @SmallTest testRawColumns_IncludesPayload()117 public void testRawColumns_IncludesPayload() { 118 assertEquals(SearchIndexablesContract.RawData.PAYLOAD, 119 SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[15]); 120 } 121 } 122