InvocationContext
public
class
InvocationContext
extends Object
implements
IInvocationContext
| java.lang.Object | |
| ↳ | com.android.tradefed.invoker.InvocationContext |
การใช้งาน IInvocationContext ทั่วไป
สรุป
ตัวสร้างแบบสาธารณะ | |
|---|---|
InvocationContext()
สร้าง |
|
เมธอดสาธารณะ | |
|---|---|
void
|
addAllocatedDevice(
ติดตามแผนที่ของชื่ออุปกรณ์การกําหนดค่าที่เชื่อมโยงกับ |
void
|
addAllocatedDevice(String devicename, ITestDevice testDevice)
เพิ่ม ITestDevice เพื่อให้ข้อมูลเมตาติดตามเมื่อมีการกําหนดอุปกรณ์ |
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)
ดำเนินการแบบย้อนกลับเป็น |
MultiMap<String, String>
|
getAttributes()
แสดงสำเนาแผนที่ซึ่งมีแอตทริบิวต์การเรียกใช้ทั้งหมด |
IBuildInfo
|
getBuildInfo(String deviceName)
แสดงผล |
IBuildInfo
|
getBuildInfo(ITestDevice testDevice)
แสดง |
String
|
getBuildInfoName(IBuildInfo info)
แสดงชื่อชุดอุปกรณ์ในการกําหนดค่า XML จาก |
|
getBuildInfos()
แสดง |
ConfigurationDescriptor
|
getConfigurationDescriptor()
แสดงผลตัวบ่งชี้ที่เชื่อมโยงกับการกำหนดค่าการทดสอบที่เปิดการเรียกใช้ |
ITestDevice
|
getDevice(String deviceName)
แสดงผล |
|
getDeviceBuildMap()
แสดงแผนที่ของการเชื่อมโยงข้อมูลอุปกรณ์/บิลด์ |
ITestDevice
|
getDeviceBySerial(String serial)
แสดงผล |
|
getDeviceConfigNames()
แสดงรายการชื่อการกําหนดค่าอุปกรณ์ของอุปกรณ์ที่ติดตามในการเรียกใช้นี้ |
String
|
getDeviceName(ITestDevice device)
แสดงชื่อชุดอุปกรณ์ในการกําหนดค่า XML จาก |
|
getDevices()
แสดงอุปกรณ์ทั้งหมดที่จัดสรรไว้ซึ่งติดตามสำหรับการเรียกใช้นี้ |
String
|
getInvocationId()
|
IInvocationContext
|
getModuleInvocationContext()
แสดงผลบริบทการเรียกใช้ของโมดูลขณะที่ดำเนินการเป็นส่วนหนึ่งของชุด |
int
|
getNumDevicesAllocated()
แสดงผลจํานวนอุปกรณ์ที่จัดสรรสําหรับการเรียกใช้ |
|
getSerials()
แสดงรายการซีเรียลของอุปกรณ์ที่ติดตามในการเรียกใช้นี้ |
|
getShardsSerials()
แสดงแผนที่ของซีเรียลทั้งหมดที่ติดตามและข้อมูลย่อยที่เกี่ยวข้องในการแยกข้อมูล |
String
|
getTestTag()
แสดงผลแท็ก test-tag ของการเรียกใช้ |
static
boolean
|
isOnDemand(IInvocationContext context)
แสดงผลว่าเราตรวจพบการเรียกใช้การทดสอบแบบออนดีมานด์ตามประเภททริกเกอร์หรือไม่ |
static
boolean
|
isPresubmit(IInvocationContext context)
แสดงผลว่าเราตรวจพบการส่งล่วงหน้าตามประเภททริกเกอร์หรือไม่ |
void
|
lockAttributes()
ล็อกบริบทเพื่อป้องกันไม่ให้เพิ่มแอตทริบิวต์การเรียกใช้อีก |
void
|
logInvocationMetrics()
บันทึกแอตทริบิวต์ |
void
|
markReleasedEarly()
ทำเครื่องหมายว่าอุปกรณ์จะเปิดตัวก่อนกำหนด |
void
|
setConfigurationDescriptor(ConfigurationDescriptor configurationDescriptor)
ตั้งค่าตัวบ่งชี้ที่เชื่อมโยงกับการกำหนดค่าการทดสอบที่เปิดการเรียกใช้ |
void
|
setModuleInvocationContext(IInvocationContext invocationContext)
ตั้งค่าบริบทการเรียกใช้ของโมดูลขณะที่ดำเนินการเป็นส่วนหนึ่งของชุด |
void
|
setRecoveryModeForAllDevices(ITestDevice.RecoveryMode mode)
ตั้งค่า |
void
|
setTestTag(String testTag)
ตั้งค่าแท็กทดสอบการเรียกใช้ |
InvocationContext.Context
|
toProto()
แปลงอินสแตนซ์บริบทเป็น protobuf |
boolean
|
wasReleasedEarly()
แสดงผลว่าอุปกรณ์เปิดตัวก่อนกำหนดหรือไม่และจะไม่ได้ใช้อีกต่อไป |
ตัวสร้างแบบสาธารณะ
เมธอดสาธารณะ
addAllocatedDevice
public void addAllocatedDevice (deviceWithName)
ติดตามแผนที่ชื่ออุปกรณ์การกําหนดค่าที่เชื่อมโยงกับ ITestDevice ไม่ล้างการติดตามก่อนหน้าก่อนเพิ่ม
| พารามิเตอร์ | |
|---|---|
deviceWithName |
: ERROR(/Map) ของอุปกรณ์เพิ่มเติมที่จะติดตาม |
addAllocatedDevice
public void addAllocatedDevice (String devicename,
ITestDevice testDevice)เพิ่ม ITestDevice เพื่อให้ข้อมูลเมตาติดตามเมื่อมีการกําหนดอุปกรณ์ จะตั้งค่าข้อมูลบิลด์เป็น Null ในแผนที่
| พารามิเตอร์ | |
|---|---|
devicename |
String: ชื่อการกำหนดค่าอุปกรณ์ที่จะเชื่อมโยงกับ ITestDevice |
testDevice |
ITestDevice: เพิ่มลงในอุปกรณ์ที่จัดสรร |
addDeviceBuildInfo
public void addDeviceBuildInfo (String deviceName,
IBuildInfo buildinfo)เพิ่ม IBuildInfo ที่จะติดตามด้วยชื่อการกำหนดค่าอุปกรณ์
| พารามิเตอร์ | |
|---|---|
deviceName |
String: ชื่อการกำหนดค่าอุปกรณ์ |
buildinfo |
IBuildInfo: IBuildInfo ที่เชื่อมโยงกับชื่อการกำหนดค่าอุปกรณ์ |
addInvocationAttribute
public void addInvocationAttribute (String attributeName,
String attributeValue)เพิ่มแอตทริบิวต์การเรียกใช้
| พารามิเตอร์ | |
|---|---|
attributeName |
String |
attributeValue |
String |
addInvocationAttributes
public void addInvocationAttributes (MultiMap<String, String> attributesMap)
เพิ่มแอตทริบิวต์การเรียกใช้หลายรายการพร้อมกันผ่าน UniqueMultiMap
| พารามิเตอร์ | |
|---|---|
attributesMap |
MultiMap |
addSerialsFromShard
public void addSerialsFromShard (Integer index,
serials) เพิ่มหมายเลขซีเรียลที่จะติดตามตามที่กําหนดให้กับหนึ่งในกลุ่มที่ทําการทดสอบ
| พารามิเตอร์ | |
|---|---|
index |
Integer: ดัชนีของกลุ่มที่ใช้ซีเรียล |
serials |
: รายการซีเรียลที่จะติดตาม |
fromProto
public static InvocationContext fromProto (InvocationContext.Context protoContext)
ดำเนินการแบบย้อนกลับเป็น InvocationContext.toProto() เพื่อรับอินสแตนซ์คืน
| พารามิเตอร์ | |
|---|---|
protoContext |
InvocationContext.Context |
| คิกรีเทิร์น | |
|---|---|
InvocationContext |
|
getAttributes
public MultiMap<String, String> getAttributes ()
แสดงสำเนาแผนที่ซึ่งมีแอตทริบิวต์การเรียกใช้ทั้งหมด
| คิกรีเทิร์น | |
|---|---|
MultiMap<String, String> |
|
getBuildInfo
public IBuildInfo getBuildInfo (String deviceName)
แสดงผล IBuildInfo ที่เชื่อมโยงกับชื่อการกําหนดค่าอุปกรณ์ที่ระบุ แสดงผล Null หากจับคู่ deviceName ไม่ได้
| พารามิเตอร์ | |
|---|---|
deviceName |
String |
| คิกรีเทิร์น | |
|---|---|
IBuildInfo |
|
getBuildInfo
public IBuildInfo getBuildInfo (ITestDevice testDevice)
แสดง IBuildInfo ที่เชื่อมโยงกับ ITestDevice
| พารามิเตอร์ | |
|---|---|
testDevice |
ITestDevice |
| คิกรีเทิร์น | |
|---|---|
IBuildInfo |
|
getBuildInfoName
public String getBuildInfoName (IBuildInfo info)
แสดงชื่อชุดอุปกรณ์ในการกําหนดค่า XML จาก IBuildInfo แสดงผลค่า Null หากจับคู่ IBuildInfo ไม่ได้
| พารามิเตอร์ | |
|---|---|
info |
IBuildInfo |
| คิกรีเทิร์น | |
|---|---|
String |
|
getBuildInfos
publicgetBuildInfos ()
แสดง IBuildInfo ทั้งหมดที่ติดตามสําหรับการเรียกใช้นี้
| คิกรีเทิร์น | |
|---|---|
|
|
getConfigurationDescriptor
public ConfigurationDescriptor getConfigurationDescriptor ()
แสดงผลตัวบ่งชี้ที่เชื่อมโยงกับการกำหนดค่าการทดสอบที่เปิดการเรียกใช้
| คิกรีเทิร์น | |
|---|---|
ConfigurationDescriptor |
|
getDevice
public ITestDevice getDevice (String deviceName)
แสดงผล ITestDevice ที่เชื่อมโยงกับชื่อการกําหนดค่าอุปกรณ์ที่ระบุ
| พารามิเตอร์ | |
|---|---|
deviceName |
String |
| คิกรีเทิร์น | |
|---|---|
ITestDevice |
|
getDeviceBuildMap
publicgetDeviceBuildMap ()
แสดงแผนที่ของการเชื่อมโยงข้อมูลอุปกรณ์/บิลด์
| คิกรีเทิร์น | |
|---|---|
|
|
getDeviceBySerial
public ITestDevice getDeviceBySerial (String serial)
แสดงผล ITestDevice ที่เชื่อมโยงกับหมายเลขซีเรียลที่ระบุ
โปรดอย่าใช้มากเกินไปเนื่องจากไม่ใช่การค้นหาที่เร็วที่สุด
| พารามิเตอร์ | |
|---|---|
serial |
String |
| คิกรีเทิร์น | |
|---|---|
ITestDevice |
|
getDeviceConfigNames
publicgetDeviceConfigNames ()
แสดงรายการชื่อการกําหนดค่าอุปกรณ์ของอุปกรณ์ที่ติดตามในการเรียกใช้นี้
| คิกรีเทิร์น | |
|---|---|
|
|
getDeviceName
public String getDeviceName (ITestDevice device)
แสดงชื่อชุดอุปกรณ์ในการกําหนดค่า XML จาก ITestDevice
แสดงผล Null หากจับคู่ ITestDevice ไม่ได้
| พารามิเตอร์ | |
|---|---|
device |
ITestDevice |
| คิกรีเทิร์น | |
|---|---|
String |
|
getDevices
publicgetDevices ()
แสดงอุปกรณ์ทั้งหมดที่จัดสรรไว้ซึ่งติดตามสําหรับการเรียกใช้นี้
| คิกรีเทิร์น | |
|---|---|
|
|
getInvocationId
public String getInvocationId ()
| คิกรีเทิร์น | |
|---|---|
String |
|
getModuleInvocationContext
public IInvocationContext getModuleInvocationContext ()
แสดงผลบริบทการเรียกใช้ของโมดูลขณะที่ดำเนินการเป็นส่วนหนึ่งของชุด
| คิกรีเทิร์น | |
|---|---|
IInvocationContext |
|
getNumDevicesAllocated
public int getNumDevicesAllocated ()
แสดงผลจํานวนอุปกรณ์ที่จัดสรรสําหรับการเรียกใช้
| คิกรีเทิร์น | |
|---|---|
int |
|
getSerials
publicgetSerials ()
แสดงรายการซีเรียลของอุปกรณ์ที่ติดตามในการเรียกใช้นี้
| คิกรีเทิร์น | |
|---|---|
|
|
getShardsSerials
publicgetShardsSerials ()
แสดงแผนที่ของซีเรียลทั้งหมดที่ติดตามและข้อมูลย่อยที่เกี่ยวข้องในการแยกข้อมูล ว่างเปล่าหากไม่ใช่การเรียกใช้ที่มีการแยกกลุ่ม
| คิกรีเทิร์น | |
|---|---|
|
|
getTestTag
public String getTestTag ()
แสดงผลแท็ก test-tag ของการเรียกใช้
| คิกรีเทิร์น | |
|---|---|
String |
|
isOnDemand
public static boolean isOnDemand (IInvocationContext context)
แสดงผลว่าเราตรวจพบการเรียกใช้การทดสอบแบบออนดีมานด์ตามประเภททริกเกอร์หรือไม่
| พารามิเตอร์ | |
|---|---|
context |
IInvocationContext |
| คิกรีเทิร์น | |
|---|---|
boolean |
|
isPresubmit
public static boolean isPresubmit (IInvocationContext context)
แสดงผลว่าเราตรวจพบการส่งล่วงหน้าตามประเภททริกเกอร์หรือไม่
| พารามิเตอร์ | |
|---|---|
context |
IInvocationContext |
| คิกรีเทิร์น | |
|---|---|
boolean |
|
lockAttributes
public void lockAttributes ()
ล็อกบริบทเพื่อป้องกันไม่ให้เพิ่มแอตทริบิวต์การเรียกใช้อีก
logInvocationMetrics
public void logInvocationMetrics ()
บันทึกแอตทริบิวต์ InvocationMetricLogger ลงในคําเรียก
markReleasedEarly
public void markReleasedEarly ()
ทำเครื่องหมายว่าอุปกรณ์จะเปิดตัวก่อนกำหนด
setConfigurationDescriptor
public void setConfigurationDescriptor (ConfigurationDescriptor configurationDescriptor)
ตั้งค่าตัวบ่งชี้ที่เชื่อมโยงกับการกำหนดค่าการทดสอบที่เปิดการเรียกใช้
| พารามิเตอร์ | |
|---|---|
configurationDescriptor |
ConfigurationDescriptor |
setModuleInvocationContext
public void setModuleInvocationContext (IInvocationContext invocationContext)
ตั้งค่าบริบทการเรียกใช้ของโมดูลขณะที่ดำเนินการเป็นส่วนหนึ่งของชุด
| พารามิเตอร์ | |
|---|---|
invocationContext |
IInvocationContext |
setRecoveryModeForAllDevices
public void setRecoveryModeForAllDevices (ITestDevice.RecoveryMode mode)
ตั้งค่า RecoveryMode ของอุปกรณ์ทั้งหมดที่เป็นส่วนหนึ่งของบริบท
| พารามิเตอร์ | |
|---|---|
mode |
ITestDevice.RecoveryMode |
setTestTag
public void setTestTag (String testTag)
ตั้งค่าแท็กทดสอบการเรียกใช้
| พารามิเตอร์ | |
|---|---|
testTag |
String |
toProto
public InvocationContext.Context toProto ()
แปลงอินสแตนซ์บริบทเป็น protobuf
| คิกรีเทิร์น | |
|---|---|
InvocationContext.Context |
|
wasReleasedEarly
public boolean wasReleasedEarly ()
แสดงผลว่าอุปกรณ์เปิดตัวก่อนกำหนดหรือไม่และจะไม่ได้ใช้อีกต่อไป
| คิกรีเทิร์น | |
|---|---|
boolean |
|