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)

向元数据条目添加指定键的更多值。

void addRerunOption(OptionDef optionDef)

将该选项添加到可用于重新运行测试的选项列表中。

ConfigurationDescriptor clone()

返回 ConfigurationDescriptor 对象的深层副本。

static ConfigurationDescriptor fromProto(ConfigurationDescription.Descriptor protoDescriptor)

toProto() 进行反向操作以恢复对象。

IAbi getAbi()

如果已知配置所针对的 ABI,则返回该 ABI;否则返回 null。

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;否则返回 null。

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

在本地分片期间获取调用的分片索引。如果没有分片,则返回 null。

返回
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