• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 static com.google.common.truth.Truth.assertThat;
21 
22 import android.provider.SearchIndexablesContract;
23 import android.support.test.filters.SmallTest;
24 import android.support.test.runner.AndroidJUnit4;
25 
26 import org.junit.Test;
27 import org.junit.runner.RunWith;
28 
29 @SmallTest
30 @RunWith(AndroidJUnit4.class)
31 public class SearchIndexablesContractTest {
32 
33     @Test
testRawColumns_matchContractIndexing()34     public void testRawColumns_matchContractIndexing() {
35         assertThat(SearchIndexablesContract.RawData.COLUMN_RANK)
36                 .isEqualTo(SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[0]);
37         assertThat(SearchIndexablesContract.RawData.COLUMN_TITLE)
38                 .isEqualTo(SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[1]);
39         assertThat(SearchIndexablesContract.RawData.COLUMN_SUMMARY_ON)
40                 .isEqualTo(SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[2]);
41         assertThat(SearchIndexablesContract.RawData.COLUMN_SUMMARY_OFF)
42                 .isEqualTo(SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[3]);
43         assertThat(SearchIndexablesContract.RawData.COLUMN_ENTRIES)
44                 .isEqualTo(SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[4]);
45         assertThat(SearchIndexablesContract.RawData.COLUMN_KEYWORDS)
46                 .isEqualTo(SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[5]);
47         assertThat(SearchIndexablesContract.RawData.COLUMN_SCREEN_TITLE)
48                 .isEqualTo(SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[6]);
49         assertThat(SearchIndexablesContract.RawData.COLUMN_CLASS_NAME)
50                 .isEqualTo(SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[7]);
51         assertThat(SearchIndexablesContract.RawData.COLUMN_ICON_RESID)
52                 .isEqualTo(SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[8]);
53         assertThat(SearchIndexablesContract.RawData.COLUMN_INTENT_ACTION)
54                 .isEqualTo(SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[9]);
55         assertThat(SearchIndexablesContract.RawData.COLUMN_INTENT_TARGET_PACKAGE)
56                 .isEqualTo(SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[10]);
57         assertThat(SearchIndexablesContract.RawData.COLUMN_INTENT_TARGET_CLASS)
58                 .isEqualTo(SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[11]);
59         assertThat(SearchIndexablesContract.RawData.COLUMN_KEY)
60                 .isEqualTo(SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[12]);
61         assertThat(SearchIndexablesContract.RawData.COLUMN_USER_ID)
62                 .isEqualTo(SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[13]);
63         assertThat(SearchIndexablesContract.RawData.PAYLOAD_TYPE)
64                 .isEqualTo(SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[14]);
65         assertThat(SearchIndexablesContract.RawData.PAYLOAD)
66                 .isEqualTo(SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[15]);
67     }
68 }
69