設備文件報告器

public class DeviceFileReporter
extends Object

java.lang.Object
com.android.tradefed.result.DeviceFileReporter


一個實用程序類,用於檢查設備中的文件並將它們發送到ITestInvocationListener#testLog(String, LogDataType, InputStreamSource)如果找到)。

概括

公共構造函數

DeviceFileReporter (ITestDevice device, ITestInvocationListener listener)

使用提供的ITestDevice初始化一個新的 DeviceFileReporter

公共方法

void addPatterns ( patterns) addPatterns ( patterns)

添加具有相應日誌數據類型的模式

void addPatterns (String... patterns)

添加將日誌數據類型設置為默認值的模式。

run ()

實際上在文件系統中搜索指定的模式並將它們發送到ITestInvocationListener#testLog如果找到

void setDefaultLogDataType (LogDataType type)

為沒有關聯類型的模式設置默認日誌數據類型集。

void setInferUnknownDataTypes (boolean infer)

要或不要嘗試通過對照列表檢查文件擴展名來推斷UNKNOWN文件的數據類型。

void setSkipRepeatFiles (boolean skip)

是否跳過已報告的文件。

公共構造函數

設備文件報告器

public DeviceFileReporter (ITestDevice device, 
                ITestInvocationListener listener)

使用提供的ITestDevice初始化一個新的 DeviceFileReporter

參數
device ITestDevice

listener ITestInvocationListener

公共方法

添加模式

public void addPatterns ( patterns)

添加具有相應日誌數據類型的模式

參數
patternsString文件名全局模式的ERROR(/Map)到它們各自的LogDataType 。球體應該是絕對的。

添加模式

public void addPatterns (String... patterns)

添加將日誌數據類型設置為默認值的模式。

參數
patterns String : String文件名 glob 模式的 varargs 數組。應該是絕對的。

public  run ()

實際上在文件系統中搜索指定的模式並將它們發送到ITestInvocationListener#testLog如果找到

退貨

投擲
DeviceNotAvailableException

setDefaultLogDataType

public void setDefaultLogDataType (LogDataType type)

為沒有關聯類型的模式設置默認日誌數據類型集。

參數
type LogDataTypeLogDataType

也可以看看:

setInferUnknownDataTypes

public void setInferUnknownDataTypes (boolean infer)

要或不要嘗試通過對照列表檢查文件擴展名來推斷UNKNOWN文件的數據類型。

請注意,啟用後,這些推斷僅適用於文件類型為UNKNOWN的模式(包括添加的模式但沒有特定類型,並且沒有手動設置默認類型)。如果推理失敗,數據類型將保持為UNKNOWN

參數
infer boolean

設置跳過重複文件

public void setSkipRepeatFiles (boolean skip)

是否跳過已報告的文件。這僅在使用多個模式並且其中兩個或多個模式匹配同一個文件時才相關。

請注意,這必須只在調用run()之前調用。否則會導致未定義的行為。

參數
skip boolean