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 public interface IModuleRepo { 31 32 /** 33 * @return true if this repository has been initialized. 34 */ isInitialized()35 boolean isInitialized(); 36 37 /** 38 * Initializes the repository. 39 */ 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)40 void initialize(int shards, Integer shardIndex, File testsDir, Set<IAbi> abis, 41 List<String> deviceTokens, List<String> testArgs, List<String> moduleArgs, 42 Set<String> mIncludeFilters, Set<String> mExcludeFilters, 43 MultiMap<String, String> metadataIncludeFilters, 44 MultiMap<String, String> metadataExcludeFilters, 45 IBuildInfo buildInfo); 46 47 /** 48 * @return a {@link LinkedList} of all modules to run on the device referenced by the given 49 * serial. 50 */ getModules(String serial, int shardIndex)51 LinkedList<IModuleDef> getModules(String serial, int shardIndex); 52 53 /** 54 * @return the number of shards this repo is initialized for. 55 */ getNumberOfShards()56 int getNumberOfShards(); 57 58 /** 59 * @return the modules which do not have token and have not been assigned to a device. 60 */ getNonTokenModules()61 List<IModuleDef> getNonTokenModules(); 62 63 /** 64 * @return the modules which have token and have not been assigned to a device. 65 */ getTokenModules()66 List<IModuleDef> getTokenModules(); 67 68 /** 69 * @return An array of all module ids in the repo. 70 */ getModuleIds()71 String[] getModuleIds(); 72 73 /** 74 * Clean up all internal references. 75 */ tearDown()76 void tearDown(); 77 } 78