1 /*
2  * Copyright (C) 2015 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 package com.android.compatibility.common.tradefed.testtype;
17 
18 import com.android.tradefed.build.IBuildInfo;
19 import com.android.tradefed.testtype.IAbi;
20 import com.android.tradefed.util.MultiMap;
21 
22 import java.io.File;
23 import java.util.LinkedList;
24 import java.util.List;
25 import java.util.Set;
26 
27 /**
28  * Interface for accessing tests from the Compatibility repository.
29  *
30  * @deprecated This class is associated with {@link CompatibilityTest} which is deprecate
31  */
32 @Deprecated
33 public interface IModuleRepo {
34 
35     /**
36      * @return true if this repository has been initialized.
37      */
isInitialized()38     boolean isInitialized();
39 
40     /**
41      * Initializes the repository.
42      */
initialize(int shards, Integer shardIndex, File testsDir, Set<IAbi> abis, List<String> deviceTokens, List<String> testArgs, List<String> moduleArgs, Set<String> mIncludeFilters, Set<String> mExcludeFilters, MultiMap<String, String> metadataIncludeFilters, MultiMap<String, String> metadataExcludeFilters, IBuildInfo buildInfo)43     void initialize(int shards, Integer shardIndex, File testsDir, Set<IAbi> abis,
44             List<String> deviceTokens, List<String> testArgs, List<String> moduleArgs,
45             Set<String> mIncludeFilters, Set<String> mExcludeFilters,
46             MultiMap<String, String> metadataIncludeFilters,
47             MultiMap<String, String> metadataExcludeFilters,
48             IBuildInfo buildInfo);
49 
50     /**
51      * @return a {@link LinkedList} of all modules to run on the device referenced by the given
52      * serial.
53      */
getModules(String serial, int shardIndex)54     LinkedList<IModuleDef> getModules(String serial, int shardIndex);
55 
56     /**
57      * @return the number of shards this repo is initialized for.
58      */
getNumberOfShards()59     int getNumberOfShards();
60 
61     /**
62      * @return the modules which do not have token and have not been assigned to a device.
63      */
getNonTokenModules()64     List<IModuleDef> getNonTokenModules();
65 
66     /**
67      * @return the modules which have token and have not been assigned to a device.
68      */
getTokenModules()69     List<IModuleDef> getTokenModules();
70 
71     /**
72      * @return An array of all module ids in the repo.
73      */
getModuleIds()74     String[] getModuleIds();
75 
76     /**
77      * Clean up all internal references.
78      */
tearDown()79     void tearDown();
80 }
81