TestFilePushSetup

public class TestFilePushSetup
extends BaseTargetPreparer implements IDiscoverDependencies

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


ITargetPreparer:將一或多個檔案/目錄從 IDeviceBuildInfo.getTestsDir() 資料夾推送至裝置。

如果測試 ZIP 檔不存在或不含必要 APK,這個準備工具會尋找替代目錄。搜尋順序會從最後一個替代目錄開始,依序到第一個。

摘要

公用建構函式

TestFilePushSetup()

公用方法

Set<String> reportDependencies()
void setUp(TestInformation testInfo)

受保護的方法

void addTestFileName(String fileName)

將檔案新增至要推送的項目清單

void clearTestFileName()
Set<String> getFailedToPushFiles()

傳回無法推送的檔案集。

File getLocalPathForFilename(IBuildInfo buildInfo, String fileName, ITestDevice device)

根據建構資訊中的測試構件資訊,解析主機端路徑。

List<String> getTestFileNames()

從測試 ZIP 檔案擷取要推送至裝置的檔案清單

void setThrowIfNoFile(boolean throwIfNoFile)

公用建構函式

TestFilePushSetup

public TestFilePushSetup ()

公用方法

reportDependencies

public Set<String> reportDependencies ()

傳回
Set<String>

setUp

public void setUp (TestInformation testInfo)

參數
testInfo TestInformation

擲回
BuildError
DeviceNotAvailableException
TargetSetupError

受保護的方法

addTestFileName

protected void addTestFileName (String fileName)

將檔案新增至要推送的項目清單

clearTestFileName

protected void clearTestFileName ()

getFailedToPushFiles

protected Set<String> getFailedToPushFiles ()

傳回無法推送的檔案集。只有在「throw-if-not-found」為 false 時才能使用,否則第一次推送失敗就會擲回例外狀況。

傳回
Set<String>

getLocalPathForFilename

protected File getLocalPathForFilename (IBuildInfo buildInfo, 
                String fileName, 
                ITestDevice device)

根據建構資訊中的測試構件資訊,解析主機端路徑。

參數
buildInfo IBuildInfo:建構構件資訊

fileName String:要推送的構件檔案名稱

device ITestDevice

傳回
File 代表主機上實體檔案/路徑的 File

擲回
TargetSetupError

getTestFileNames

protected List<String> getTestFileNames ()

擷取要從測試 ZIP 檔案推送至裝置的檔案清單

傳回
List<String>

setThrowIfNoFile

protected void setThrowIfNoFile (boolean throwIfNoFile)

參數
throwIfNoFile boolean