PushFilePreparer

public class PushFilePreparer
extends BaseTargetPreparer implements IAbiReceiver, IDiscoverDependencies, IInvocationContextReceiver

java.lang.Object
   ↳ com.android.tradefed.targetprep.BaseTargetPreparer
     ↳ com.android.tradefed.targetprep.PushFilePreparer


一种 ITargetPreparer,用于尝试将任意数量的文件从任意主机路径推送到任意设备路径。

应在刷入新 build 之后以及运行 DeviceSetup(如果已启用)之后执行

摘要

公共构造函数

PushFilePreparer()

公共方法

IAbi getAbi()

final Map<String, File> getPushSpecs(ITestDevice device)

创建要推送的文件列表。

boolean isCleanUpEnabled()
Set<String> reportDependencies()
File resolveRelativeFilePath(IBuildInfo buildInfo, String fileName)

通过 IBuildInfo 和测试用例目录解析相对文件路径。

void setAbi(IAbi abi)

void setInvocationContext(IInvocationContext invocationContext)

void setUp(TestInformation testInfo)

boolean shouldAbortOnFailure()

是否在推送失败时中止。

boolean shouldRemountSystem()
boolean shouldRemountVendor()
void tearDown(TestInformation testInfo, Throwable e)

公共构造函数

PushFilePreparer

public PushFilePreparer ()

公共方法

getAbi

public IAbi getAbi ()

返回
IAbi

getPushSpecs

public final Map<String, File> getPushSpecs (ITestDevice device)

创建要推送的文件列表。

参数
device ITestDevice

返回
Map<String, File>

抛出
TargetSetupError

isCleanUpEnabled

public boolean isCleanUpEnabled ()

返回
boolean

reportDependencies

public Set<String> reportDependencies ()

返回
Set<String>

resolveRelativeFilePath

public File resolveRelativeFilePath (IBuildInfo buildInfo, 
                String fileName)

通过 IBuildInfo 和测试用例目录解析相对文件路径。

参数
buildInfo IBuildInfo:构建工件信息

fileName String:要解析的相对文件路径

返回
File 来自 build 信息或测试用例目录的文件

setAbi

public void setAbi (IAbi abi)

参数
abi IAbi

setInvocationContext

public void setInvocationContext (IInvocationContext invocationContext)

参数
invocationContext IInvocationContext

setUp

public void setUp (TestInformation testInfo)

参数
testInfo TestInformation

抛出
BuildError
DeviceNotAvailableException
TargetSetupError

shouldAbortOnFailure

public boolean shouldAbortOnFailure ()

是否在推送失败时中止。

返回
boolean

shouldRemountSystem

public boolean shouldRemountSystem ()

返回
boolean

shouldRemountVendor

public boolean shouldRemountVendor ()

返回
boolean

tearDown

public void tearDown (TestInformation testInfo, 
                Throwable e)

参数
testInfo TestInformation

e Throwable

抛出
DeviceNotAvailableException