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.device.DeviceNotAvailableException; 19 import com.android.tradefed.testtype.IAbi; 20 import com.android.tradefed.testtype.IBuildReceiver; 21 import com.android.tradefed.testtype.IDeviceTest; 22 import com.android.tradefed.testtype.IRemoteTest; 23 import com.android.tradefed.testtype.IRuntimeHintProvider; 24 25 import java.io.File; 26 import java.util.Set; 27 28 /** 29 * Container for Compatibility test info. 30 */ 31 public interface IModuleDef extends Comparable<IModuleDef>, IBuildReceiver, IDeviceTest, 32 IRemoteTest, IRuntimeHintProvider { 33 34 /** 35 * @return The name of this module. 36 */ getName()37 String getName(); 38 39 /** 40 * @return a {@link String} to uniquely identify this module. 41 */ getId()42 String getId(); 43 44 /** 45 * @return the abi of this test module. 46 */ getAbi()47 IAbi getAbi(); 48 49 /** 50 * @return the {@link Set} of tokens a device must have in order to run this module. 51 */ getTokens()52 Set<String> getTokens(); 53 54 /** 55 * @return the {@link IRemoteTest} that runs the tests. 56 */ getTest()57 IRemoteTest getTest(); 58 59 /** 60 * Set a list of preparers to allow to run before or after a test. 61 * If this list is empty, then all configured preparers will run. 62 * 63 * @param a list containing the simple name of the preparer to run. 64 */ setPreparerWhitelist(Set<String> preparerWhitelist)65 void setPreparerWhitelist(Set<String> preparerWhitelist); 66 67 /** 68 * Runs the module's precondition checks and setup tasks. 69 */ prepare(boolean skipPrep)70 void prepare(boolean skipPrep) throws DeviceNotAvailableException; 71 72 } 73