InvocationContext
public
class
InvocationContext
extends Object
implements
IInvocationContext
java.lang.Object | |
↳ | com.android.tradefed.invoker.InvocationContext |
Generic implementation of a IInvocationContext
.
Summary
Public constructors | |
---|---|
InvocationContext()
Creates a |
Public methods | |
---|---|
void
|
addAllocatedDevice(
|
void
|
addAllocatedDevice(String devicename, ITestDevice testDevice)
|
void
|
addDeviceBuildInfo(String deviceName, IBuildInfo buildinfo)
|
void
|
addInvocationAttribute(String attributeName, String attributeValue)
|
void
|
addInvocationAttributes(MultiMap<String, String> attributesMap)
|
void
|
addSerialsFromShard(Integer index,
|
static
InvocationContext
|
fromProto(InvocationContext.Context protoContext)
Inverse operation to |
MultiMap<String, String>
|
getAttributes()
|
IBuildInfo
|
getBuildInfo(String deviceName)
|
IBuildInfo
|
getBuildInfo(ITestDevice testDevice)
|
String
|
getBuildInfoName(IBuildInfo info)
|
|
getBuildInfos()
|
ConfigurationDescriptor
|
getConfigurationDescriptor()
|
ITestDevice
|
getDevice(String deviceName)
|
|
getDeviceBuildMap()
|
ITestDevice
|
getDeviceBySerial(String serial)
|
|
getDeviceConfigNames()
|
String
|
getDeviceName(ITestDevice device)
|
|
getDevices()
|
String
|
getInvocationId()
|
IInvocationContext
|
getModuleInvocationContext()
|
int
|
getNumDevicesAllocated()
|
|
getSerials()
|
|
getShardsSerials()
|
String
|
getTestTag()
|
void
|
lockAttributes()
Lock the context to prevent more invocation attributes to be added. |
void
|
logInvocationMetrics()
Log the |
void
|
markReleasedEarly()
|
void
|
setConfigurationDescriptor(ConfigurationDescriptor configurationDescriptor)
|
void
|
setModuleInvocationContext(IInvocationContext invocationContext)
|
void
|
setRecoveryModeForAllDevices(ITestDevice.RecoveryMode mode)
|
void
|
setTestTag(String testTag)
|
InvocationContext.Context
|
toProto()
|
boolean
|
wasReleasedEarly()
|
Public constructors
Public methods
addAllocatedDevice
public void addAllocatedDevice (deviceWithName)
Parameters | |
---|---|
deviceWithName |
|
addAllocatedDevice
public void addAllocatedDevice (String devicename, ITestDevice testDevice)
Parameters | |
---|---|
devicename |
String |
testDevice |
ITestDevice |
addDeviceBuildInfo
public void addDeviceBuildInfo (String deviceName, IBuildInfo buildinfo)
Parameters | |
---|---|
deviceName |
String |
buildinfo |
IBuildInfo |
addInvocationAttribute
public void addInvocationAttribute (String attributeName, String attributeValue)
Parameters | |
---|---|
attributeName |
String |
attributeValue |
String |
addInvocationAttributes
public void addInvocationAttributes (MultiMap<String, String> attributesMap)
Parameters | |
---|---|
attributesMap |
MultiMap |
addSerialsFromShard
public void addSerialsFromShard (Integer index,serials)
Parameters | |
---|---|
index |
Integer |
serials |
|
fromProto
public static InvocationContext fromProto (InvocationContext.Context protoContext)
Inverse operation to InvocationContext#toProto()
to get the instance back.
Parameters | |
---|---|
protoContext |
InvocationContext.Context |
Returns | |
---|---|
InvocationContext |
getAttributes
public MultiMap<String, String> getAttributes ()
Returns | |
---|---|
MultiMap<String, String> |
getBuildInfo
public IBuildInfo getBuildInfo (String deviceName)
Parameters | |
---|---|
deviceName |
String |
Returns | |
---|---|
IBuildInfo |
getBuildInfo
public IBuildInfo getBuildInfo (ITestDevice testDevice)
Parameters | |
---|---|
testDevice |
ITestDevice |
Returns | |
---|---|
IBuildInfo |
getBuildInfoName
public String getBuildInfoName (IBuildInfo info)
Parameters | |
---|---|
info |
IBuildInfo |
Returns | |
---|---|
String |
getBuildInfos
publicgetBuildInfos ()
Returns | |
---|---|
|
getConfigurationDescriptor
public ConfigurationDescriptor getConfigurationDescriptor ()
Returns | |
---|---|
ConfigurationDescriptor |
getDevice
public ITestDevice getDevice (String deviceName)
Parameters | |
---|---|
deviceName |
String |
Returns | |
---|---|
ITestDevice |
getDeviceBuildMap
publicgetDeviceBuildMap ()
Returns | |
---|---|
|
getDeviceBySerial
public ITestDevice getDeviceBySerial (String serial)
Parameters | |
---|---|
serial |
String |
Returns | |
---|---|
ITestDevice |
getDeviceConfigNames
publicgetDeviceConfigNames ()
Returns | |
---|---|
|
getDeviceName
public String getDeviceName (ITestDevice device)
Parameters | |
---|---|
device |
ITestDevice |
Returns | |
---|---|
String |
getDevices
publicgetDevices ()
Returns | |
---|---|
|
getInvocationId
public String getInvocationId ()
Returns | |
---|---|
String |
getModuleInvocationContext
public IInvocationContext getModuleInvocationContext ()
Returns | |
---|---|
IInvocationContext |
getNumDevicesAllocated
public int getNumDevicesAllocated ()
Returns | |
---|---|
int |
getSerials
publicgetSerials ()
Returns | |
---|---|
|
getShardsSerials
publicgetShardsSerials ()
Returns | |
---|---|
|
getTestTag
public String getTestTag ()
Returns | |
---|---|
String |
lockAttributes
public void lockAttributes ()
Lock the context to prevent more invocation attributes to be added.
logInvocationMetrics
public void logInvocationMetrics ()
Log the InvocationMetricLogger
attributes to the invocation.
markReleasedEarly
public void markReleasedEarly ()
setConfigurationDescriptor
public void setConfigurationDescriptor (ConfigurationDescriptor configurationDescriptor)
Parameters | |
---|---|
configurationDescriptor |
ConfigurationDescriptor |
setModuleInvocationContext
public void setModuleInvocationContext (IInvocationContext invocationContext)
Parameters | |
---|---|
invocationContext |
IInvocationContext |
setRecoveryModeForAllDevices
public void setRecoveryModeForAllDevices (ITestDevice.RecoveryMode mode)
Parameters | |
---|---|
mode |
ITestDevice.RecoveryMode |
setTestTag
public void setTestTag (String testTag)
Parameters | |
---|---|
testTag |
String |
toProto
public InvocationContext.Context toProto ()
Returns | |
---|---|
InvocationContext.Context |
wasReleasedEarly
public boolean wasReleasedEarly ()
Returns | |
---|---|
boolean |