InvocationContext
public
class
InvocationContext
extends Object
implements
IInvocationContext
| java.lang.Object | |
| ↳ | com.android.tradefed.invoker.InvocationContext |
การใช้งานทั่วไปของ IInvocationContext
สรุป
เครื่องมือสร้างสาธารณะ | |
|---|---|
InvocationContext()
สร้าง |
|
เมธอดสาธารณะ | |
|---|---|
void
|
addAllocatedDevice(Map<String, ITestDevice> deviceWithName)
ติดตามแผนที่ชื่ออุปกรณ์การกำหนดค่าที่เชื่อมโยงกับ |
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, List<String> serials)
เพิ่มหมายเลขซีเรียลที่จะติดตามเมื่อมีการกำหนดให้กับหนึ่งใน Shard ที่เรียกใช้การทดสอบบางอย่าง |
static
InvocationContext
|
fromProto(InvocationContext.Context protoContext)
การดำเนินการผกผันกับ |
MultiMap<String, String>
|
getAttributes()
ส่งกลับสำเนาของแผนที่ที่มีแอตทริบิวต์การเรียกใช้ทั้งหมด |
IBuildInfo
|
getBuildInfo(String deviceName)
ส่งคืน |
IBuildInfo
|
getBuildInfo(ITestDevice testDevice)
ส่งคืน |
String
|
getBuildInfoName(IBuildInfo info)
แสดงผลชื่อชุดอุปกรณ์ในการกำหนดค่า XML จาก |
List<IBuildInfo>
|
getBuildInfos()
ส่งคืน |
ConfigurationDescriptor
|
getConfigurationDescriptor()
แสดงผลตัวอธิบายที่เชื่อมโยงกับการกำหนดค่าการทดสอบที่เปิดใช้การเรียก |
ITestDevice
|
getDevice(String deviceName)
ส่งคืน |
Map<ITestDevice, IBuildInfo>
|
getDeviceBuildMap()
แสดงแผนที่การเชื่อมโยงข้อมูลอุปกรณ์/บิลด์ |
ITestDevice
|
getDeviceBySerial(String serial)
แสดง |
List<String>
|
getDeviceConfigNames()
แสดงรายการชื่อการกำหนดค่าอุปกรณ์ของอุปกรณ์ที่ติดตามในการเรียกใช้นี้ |
String
|
getDeviceName(ITestDevice device)
แสดงผลชื่อชุดอุปกรณ์ในการกำหนดค่า XML จาก |
List<ITestDevice>
|
getDevices()
ส่งคืนอุปกรณ์ที่ติดตามทั้งหมดที่จัดสรรไว้สำหรับการเรียกใช้นี้ |
String
|
getInvocationId()
|
IInvocationContext
|
getModuleInvocationContext()
แสดงผลบริบทการเรียกใช้ของโมดูลขณะดำเนินการเป็นส่วนหนึ่งของชุด |
int
|
getNumDevicesAllocated()
แสดงผลจำนวนอุปกรณ์ที่จัดสรรสำหรับการเรียกใช้ |
List<String>
|
getSerials()
แสดงรายการซีเรียลของอุปกรณ์ที่ติดตามในการเรียกใช้นี้ |
Map<Integer, List<String>>
|
getShardsSerials()
แสดงผลแผนที่ของซีเรียลที่ติดตามทั้งหมดและ Shard ที่เกี่ยวข้องในการ Sharding |
String
|
getTestTag()
แสดงผลแท็กทดสอบการเรียกใช้ |
static
boolean
|
isApiTrigger(IInvocationContext context)
แสดงผลว่าเราตรวจพบการเรียกใช้การทดสอบที่อิงตาม API หรือไม่ โดยอิงตามประเภททริกเกอร์ |
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 (Map<String, ITestDevice> deviceWithName)
ติดตามแผนที่ชื่ออุปกรณ์การกำหนดค่าที่เชื่อมโยงกับ ITestDevice ไม่ล้าง
การติดตามก่อนหน้าก่อนเพิ่ม
| พารามิเตอร์ | |
|---|---|
deviceWithName |
Map: 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,
List<String> serials)เพิ่มหมายเลขซีเรียลที่จะติดตามเมื่อมีการกำหนดให้กับหนึ่งใน Shard ที่เรียกใช้การทดสอบบางอย่าง
| พารามิเตอร์ | |
|---|---|
index |
Integer: ดัชนีของ Shard โดยใช้หมายเลขซีเรียล |
serials |
List: รายการซีเรียลที่จะติดตาม |
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
public List<IBuildInfo> getBuildInfos ()
ส่งคืน IBuildInfo ทั้งหมดที่ติดตามสำหรับการเรียกใช้นี้
| การคืนสินค้า | |
|---|---|
List<IBuildInfo> |
|
getConfigurationDescriptor
public ConfigurationDescriptor getConfigurationDescriptor ()
แสดงผลตัวอธิบายที่เชื่อมโยงกับการกำหนดค่าการทดสอบที่เปิดใช้การเรียก
| การคืนสินค้า | |
|---|---|
ConfigurationDescriptor |
|
getDevice
public ITestDevice getDevice (String deviceName)
ส่งคืน ITestDevice ที่เชื่อมโยงกับชื่อการกำหนดค่าอุปกรณ์ที่ระบุ
| พารามิเตอร์ | |
|---|---|
deviceName |
String |
| การคืนสินค้า | |
|---|---|
ITestDevice |
|
getDeviceBuildMap
public Map<ITestDevice, IBuildInfo> getDeviceBuildMap ()
แสดงแผนที่การเชื่อมโยงข้อมูลอุปกรณ์/บิลด์
| การคืนสินค้า | |
|---|---|
Map<ITestDevice, IBuildInfo> |
|
getDeviceBySerial
public ITestDevice getDeviceBySerial (String serial)
แสดง ITestDevice ที่เชื่อมโยงกับหมายเลขซีเรียลที่ระบุ
โปรดอย่าใช้มากเกินไปเนื่องจากไม่ใช่การค้นหาที่เร็วที่สุด
| พารามิเตอร์ | |
|---|---|
serial |
String |
| การคืนสินค้า | |
|---|---|
ITestDevice |
|
getDeviceConfigNames
public List<String> getDeviceConfigNames ()
แสดงรายการชื่อการกำหนดค่าอุปกรณ์ของอุปกรณ์ที่ติดตามในการเรียกใช้นี้
| การคืนสินค้า | |
|---|---|
List<String> |
|
getDeviceName
public String getDeviceName (ITestDevice device)
แสดงผลชื่อชุดอุปกรณ์ในการกำหนดค่า XML จาก ITestDevice
แสดงผล Null หากจับคู่ ITestDevice ไม่ได้
| พารามิเตอร์ | |
|---|---|
device |
ITestDevice |
| การคืนสินค้า | |
|---|---|
String |
|
getDevices
public List<ITestDevice> getDevices ()
ส่งคืนอุปกรณ์ที่ติดตามทั้งหมดที่จัดสรรไว้สำหรับการเรียกใช้นี้
| การคืนสินค้า | |
|---|---|
List<ITestDevice> |
|
getInvocationId
public String getInvocationId ()
| การคืนสินค้า | |
|---|---|
String |
|
getModuleInvocationContext
public IInvocationContext getModuleInvocationContext ()
แสดงผลบริบทการเรียกใช้ของโมดูลขณะดำเนินการเป็นส่วนหนึ่งของชุด
| การคืนสินค้า | |
|---|---|
IInvocationContext |
|
getNumDevicesAllocated
public int getNumDevicesAllocated ()
แสดงผลจำนวนอุปกรณ์ที่จัดสรรสำหรับการเรียกใช้
| การคืนสินค้า | |
|---|---|
int |
|
getSerials
public List<String> getSerials ()
แสดงรายการซีเรียลของอุปกรณ์ที่ติดตามในการเรียกใช้นี้
| การคืนสินค้า | |
|---|---|
List<String> |
|
getShardsSerials
public Map<Integer, List<String>> getShardsSerials ()
แสดงผลแผนที่ของซีเรียลที่ติดตามทั้งหมดและ Shard ที่เกี่ยวข้องในการ Sharding ว่างเปล่าหากไม่ใช่การเรียกใช้ที่ แยกส่วน
| การคืนสินค้า | |
|---|---|
Map<Integer, List<String>> |
|
getTestTag
public String getTestTag ()
แสดงผลแท็กทดสอบการเรียกใช้
| การคืนสินค้า | |
|---|---|
String |
|
isApiTrigger
public static boolean isApiTrigger (IInvocationContext context)
แสดงผลว่าเราตรวจพบการเรียกใช้การทดสอบที่อิงตาม API หรือไม่ โดยอิงตามประเภททริกเกอร์
| พารามิเตอร์ | |
|---|---|
context |
IInvocationContext |
| การคืนสินค้า | |
|---|---|
boolean |
|
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 |
|