1 /* 2 * Copyright (C) 2010 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.android.cts.tradefed.testtype; 18 19 import com.android.cts.util.AbiUtils; 20 21 import java.util.List; 22 import java.util.Map; 23 24 /** 25 * Interface for accessing tests from the CTS repository. 26 */ 27 public interface ITestPackageRepo { 28 29 /** 30 * Get a {@link TestPackageDef} given an id. 31 * 32 * @param id the unique identifier of this test package, generated by 33 * {@link AbiUtils#createId(String, String)}. 34 * @return a {@link TestPackageDef} 35 */ getTestPackage(String id)36 public ITestPackageDef getTestPackage(String id); 37 38 /** 39 * @return a sorted {@link List} of all package ids found in repo. 40 */ getPackageIds()41 public List<String> getPackageIds(); 42 43 /** 44 * @return a sorted {@link List} of test package names 45 */ getPackageNames()46 public List<String> getPackageNames(); 47 48 /** 49 * @return A {@link Map} of test package name to a {@link List} of {@link ITestPackageDef}s. 50 */ getTestPackageDefsByName()51 public Map<String, List<ITestPackageDef>> getTestPackageDefsByName(); 52 53 /** 54 * Attempt to find the package ids for a given test class name 55 * 56 * @param testClassName the test class name 57 * @return a {@link List} of package ids. 58 */ findPackageIdsForTest(String testClassName)59 public List<String> findPackageIdsForTest(String testClassName); 60 } 61