ConfigurationDescriptor

public class ConfigurationDescriptor
extends Object

java.lang.Object
   ↳ com.android.tradefed.config.ConfigurationDescriptor


設定物件,用來說明設定本身的某些方面。例如會員測試套件標記。這個類別無法透過指令列接收選項值。只能直接在 XML 中設定。

摘要

常數

String ACTIVE_PARAMETER_KEY

設定參數化的中繼資料鍵 (選用)。

String LOCAL_SHARDED_KEY

設定的中繼資料鍵,用於指定設定已分片。

String MODULE_DIR_PATH_KEY

設定的中繼資料鍵,用於指定模組設定的模組目錄路徑。

String PRIORITIZE_HOST_CONFIG_KEY

設定的中繼資料鍵,用於指定是否優先處理主機設定。

公用建構函式

ConfigurationDescriptor()

公用方法

void addMetadata(String key, values)

在 metadata 項目中,為指定鍵新增更多值。

void addRerunOption(OptionDef optionDef)

將選項新增至可用於重新執行測試的選項清單。

ConfigurationDescriptor clone()

傳回 ConfigurationDescriptor 物件的深層副本。

static ConfigurationDescriptor fromProto(ConfigurationDescription.Descriptor protoDescriptor)

toProto() 執行反向作業,即可取回物件。

IAbi getAbi()

如果已知設定執行的 ABI,則傳回該 ABI,否則傳回空值。

MultiMap<String, String> getAllMetaData()

擷取所有已設定的中繼資料,並傳回地圖副本。

getMetaData(String name)

取得具名中繼資料項目

String getModuleName()

傳回模組設定的模組名稱。

getRerunOptions()

取得可用於重新執行的 OptionDef 清單。

Integer getShardIndex()

在本地分片期間取得呼叫的分片索引。

getSuiteTags()

傳回測試所屬的套件標記清單。

boolean isNotIRemoteTestShardable()

傳回設定是否應將 IRemoteTest 分割成不同模組。

boolean isNotShardable()

傳回設定是否可做為套件的一部分進行分片

boolean isNotStrictShardable()

傳回設定是否為嚴格可分片,或是否為套件的一部分

removeMetadata(String key)

移除指定中繼資料鍵的追蹤記錄。

void setAbi(IAbi abi)

設定要執行的設定所使用的 ABI。

void setMetaData(MultiMap<String, String> metadata)
void setModuleName(String name)

如果這項設定代表模組,我們可以設定與其相關聯的模組名稱。

void setNotIRemoteTestShardable(boolean notIRemoteTestShardable)
void setSandboxed(boolean useSandboxed)

設定是否要在沙箱模式下執行設定。

void setShardIndex(int index)

在本地分片中,設定呼叫的分片索引。

void setSuiteTags( suiteTags)

設定測試所屬的套件標記清單。

boolean shouldUseSandbox()

如果應以沙箱模式執行叫用,則傳回 true。

ConfigurationDescription.Descriptor toProto()

將目前的描述元例項轉換為 proto 格式。

常數

ACTIVE_PARAMETER_KEY

public static final String ACTIVE_PARAMETER_KEY

設定參數化的中繼資料鍵 (選用)。

常數值: "active-parameter"

LOCAL_SHARDED_KEY

public static final String LOCAL_SHARDED_KEY

設定的中繼資料鍵,用於指定設定已分片。

常數值: "sharded"

MODULE_DIR_PATH_KEY

public static final String MODULE_DIR_PATH_KEY

設定的中繼資料鍵,用於指定模組設定的模組目錄路徑。

常數值: "module-dir-path"

PRIORITIZE_HOST_CONFIG_KEY

public static final String PRIORITIZE_HOST_CONFIG_KEY

設定的中繼資料鍵,用於指定是否優先處理主機設定。

常數值: "prioritize-host-config"

公用建構函式

ConfigurationDescriptor

public ConfigurationDescriptor ()

公用方法

addMetadata

public void addMetadata (String key, 
                 values)

在該中繼資料項目中,為特定鍵新增更多值。

參數
key String:要新增值的鍵的 String

values :額外值的 String 清單。

addRerunOption

public void addRerunOption (OptionDef optionDef)

將這個選項新增至可用於重新執行測試的選項清單。

參數
optionDef OptionDef:測試選項的 OptionDef 物件。

複製

public ConfigurationDescriptor clone ()

傳回 ConfigurationDescriptor 物件的深層副本。

傳回
ConfigurationDescriptor

fromProto

public static ConfigurationDescriptor fromProto (ConfigurationDescription.Descriptor protoDescriptor)

toProto() 執行反向作業,即可取回物件。

參數
protoDescriptor ConfigurationDescription.Descriptor

傳回
ConfigurationDescriptor

getAbi

public IAbi getAbi ()

如果已知設定執行的 ABI,則傳回該 ABI;否則傳回空值。

傳回
IAbi

getAllMetaData

public MultiMap<String, String> getAllMetaData ()

擷取所有已設定的中繼資料,並傳回地圖副本。

傳回
MultiMap<String, String>

getMetaData

public  getMetaData (String name)

取得具名中繼資料項目

參數
name String

傳回

getModuleName

public String getModuleName ()

傳回模組設定的模組名稱。

傳回
String

getRerunOptions

public  getRerunOptions ()

取得可用於重新執行的 OptionDef 清單。

傳回

getShardIndex

public Integer getShardIndex ()

在本地分片期間取得調用的分片索引。如果沒有分片,則傳回空值。

傳回
Integer

getSuiteTags

public  getSuiteTags ()

傳回測試所屬的套件標記清單。

傳回

isNotIRemoteTestShardable

public boolean isNotIRemoteTestShardable ()

傳回設定是否應將 IRemoteTest 分割成不同模組。

傳回
boolean

isNotShardable

public boolean isNotShardable ()

傳回設定是否可做為套件的一部分進行分片

傳回
boolean

isNotStrictShardable

public boolean isNotStrictShardable ()

傳回設定是否為套件的一部分,且是否為嚴格可分片

傳回
boolean

removeMetadata

public  removeMetadata (String key)

移除指定中繼資料鍵的追蹤記錄。

參數
key String

傳回

setAbi

public void setAbi (IAbi abi)

設定要執行的設定所用的 ABI。

參數
abi IAbi

setMetaData

public void setMetaData (MultiMap<String, String> metadata)

參數
metadata MultiMap

setModuleName

public void setModuleName (String name)

如果這項設定代表模組,我們可以設定與其相關聯的模組名稱。

參數
name String

setNotIRemoteTestShardable

public void setNotIRemoteTestShardable (boolean notIRemoteTestShardable)

參數
notIRemoteTestShardable boolean

setSandboxed

public void setSandboxed (boolean useSandboxed)

設定是否要在沙箱模式下執行設定。

參數
useSandboxed boolean

setShardIndex

public void setShardIndex (int index)

在本機分片中,設定調用的分片索引。

參數
index int

setSuiteTags

public void setSuiteTags ( suiteTags)

設定測試所屬的套件標記清單。

參數
suiteTags

shouldUseSandbox

public boolean shouldUseSandbox ()

如果應以沙箱模式執行叫用作業,則傳回 true。否則傳回「false」。

傳回
boolean

toProto

public ConfigurationDescription.Descriptor toProto ()

將目前的描述元例項轉換為 proto 格式。

傳回
ConfigurationDescription.Descriptor