測試檔案推送設定

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 ()

公共方法

reportDependencies ()
void setUp ( TestInformation testInfo)

受保護的方法

void addTestFileName (String fileName)

將文件新增至要推送的項目清單中

void clearTestFileName ()
getFailedToPushFiles ()

傳回推送失敗的檔案集。

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

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

getTestFileNames ()

檢索要從測試 zip 推送到裝置上的檔案列表

void setThrowIfNoFile (boolean throwIfNoFile)

公共構造函數

測試檔案推送設定

public TestFilePushSetup ()

公共方法

報告依賴關係

public  reportDependencies ()

退貨

設定

public void setUp (TestInformation testInfo)

參數
testInfo TestInformation

投擲
BuildError
DeviceNotAvailableException
TargetSetupError

受保護的方法

新增測試檔名

protected void addTestFileName (String fileName)

將文件新增至要推送的項目清單中

清除測試檔名

protected void clearTestFileName ()

取得推送檔案失敗

protected  getFailedToPushFiles ()

傳回推送失敗的檔案集。只有當 'throw-if-not-found' 為 false 時才能使用,否則第一次失敗的推送將引發異常。

退貨

取得檔案名稱的本機路徑

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

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

參數
buildInfo IBuildInfo :建置工件訊息

fileName String : 要推送的工件的檔名

device ITestDevice

退貨
File表示主機上的實體檔案/路徑ERROR(/File)

投擲
TargetSetupError

取得測試檔名

protected  getTestFileNames ()

檢索要從測試 zip 推送到裝置上的檔案列表

退貨

如果沒有檔案則設定拋出異常

protected void setThrowIfNoFile (boolean throwIfNoFile)

參數
throwIfNoFile boolean