บริบทการร้องขอ
public class InvocationContext
extends Object
implements IInvocationContext
java.lang.Object | |
↳ | com.android.tradefed.inviver.InvocationContext |
การใช้งานทั่วไปของ IInvocationContext
สรุป
ผู้รับเหมาก่อสร้างสาธารณะ | |
---|---|
InvocationContext () สร้าง |
วิธีการสาธารณะ | |
---|---|
void | addAllocatedDevice ( deviceWithName) addAllocatedDevice ( 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, serials) addSerialsFromShard (Integer index, serials) เพิ่มซีเรียลที่จะติดตามตามที่กำหนดให้กับหนึ่งในชาร์ดที่กำลังรันการทดสอบบางอย่าง |
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 () ส่งกลับแท็กทดสอบการร้องขอ |
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 () ส่งคืนว่าอุปกรณ์ออกก่อนเวลาหรือไม่และจะไม่ใช้งานอีกต่อไป |
ผู้รับเหมาก่อสร้างสาธารณะ
วิธีการสาธารณะ
เพิ่มอุปกรณ์จัดสรร
public void addAllocatedDevice (deviceWithName)
ติดตามแผนผังชื่ออุปกรณ์กำหนดค่าที่เกี่ยวข้องกับ ITestDevice
ไม่ล้างการติดตามก่อนหน้าก่อนที่จะเพิ่ม
พารามิเตอร์ | |
---|---|
deviceWithName | ERROR(/Map) ของอุปกรณ์เพิ่มเติมที่จะติดตาม |
เพิ่มอุปกรณ์จัดสรร
public void addAllocatedDevice (String devicename, ITestDevice testDevice)
เพิ่ม ITestDevice ที่จะติดตามโดยข้อมูลเมตาเมื่อมีการจัดสรรอุปกรณ์ จะตั้งค่าข้อมูลบิลด์เป็นโมฆะในแผนที่
พารามิเตอร์ | |
---|---|
devicename | String : ชื่อการกำหนดค่าอุปกรณ์ที่จะเชื่อมโยงกับ ITestDevice |
testDevice | ITestDevice : ที่จะเพิ่มไปยังอุปกรณ์ที่จัดสรร |
เพิ่มDeviceBuildInfo
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 |
จากโปรโต
public static InvocationContext fromProto (InvocationContext.Context protoContext)
การดำเนินการผกผันกับ InvocationContext#toProto()
เพื่อรับอินสแตนซ์กลับมา
พารามิเตอร์ | |
---|---|
protoContext | InvocationContext.Context |
การส่งคืน | |
---|---|
InvocationContext |
getAttributes
public MultiMap<String, String> getAttributes ()
ส่งกลับสำเนาของแผนที่ที่มีคุณลักษณะการร้องขอทั้งหมด
การส่งคืน | |
---|---|
MultiMap <String, String> |
รับ BuildInfo
public IBuildInfo getBuildInfo (String deviceName)
ส่งคืน IBuildInfo
ที่เชื่อมโยงกับชื่อการกำหนดค่าอุปกรณ์ที่ระบุ ส่งกลับค่า null หากไม่สามารถจับคู่ชื่ออุปกรณ์ได้
พารามิเตอร์ | |
---|---|
deviceName | String |
การส่งคืน | |
---|---|
IBuildInfo |
รับ BuildInfo
public IBuildInfo getBuildInfo (ITestDevice testDevice)
ส่งคืน IBuildInfo
ที่เกี่ยวข้องกับ ITestDevice
พารามิเตอร์ | |
---|---|
testDevice | ITestDevice |
การส่งคืน | |
---|---|
IBuildInfo |
รับ BuildInfoName
public String getBuildInfoName (IBuildInfo info)
ส่งคืนชื่ออุปกรณ์ที่ตั้งค่าในการกำหนดค่า xml จาก IBuildInfo
ส่งกลับค่า null ถ้า IBuildInfo ไม่สามารถจับคู่ได้
พารามิเตอร์ | |
---|---|
info | IBuildInfo |
การส่งคืน | |
---|---|
String |
รับ BuildInfos
publicgetBuildInfos ()
ส่งคืน IBuildInfo
ทั้งหมดที่ติดตามสำหรับการเรียกใช้นี้
การส่งคืน | |
---|---|
getConfigurationDescriptor
public ConfigurationDescriptor getConfigurationDescriptor ()
ส่งคืนคำอธิบายที่เกี่ยวข้องกับการกำหนดค่าการทดสอบที่เรียกใช้งาน
การส่งคืน | |
---|---|
ConfigurationDescriptor |
รับอุปกรณ์
public ITestDevice getDevice (String deviceName)
ส่งคืน ITestDevice
ที่เชื่อมโยงกับชื่อการกำหนดค่าอุปกรณ์ที่ระบุ
พารามิเตอร์ | |
---|---|
deviceName | String |
การส่งคืน | |
---|---|
ITestDevice |
รับDeviceBuildMap
publicgetDeviceBuildMap ()
ส่งคืนแมปของการเชื่อมโยงข้อมูลอุปกรณ์/บิลด์
การส่งคืน | |
---|---|
รับ DeviceBySerial
public ITestDevice getDeviceBySerial (String serial)
ส่งกลับค่า ITestDevice
ที่เกี่ยวข้องกับอนุกรมที่ให้มา อย่าใช้มากเกินไปเนื่องจากไม่ใช่การค้นหาที่รวดเร็วที่สุด
พารามิเตอร์ | |
---|---|
serial | String |
การส่งคืน | |
---|---|
ITestDevice |
getDeviceConfigNames
publicgetDeviceConfigNames ()
ส่งคืนรายการชื่อการกำหนดค่าอุปกรณ์ของอุปกรณ์ที่ติดตามในการเรียกใช้นี้
การส่งคืน | |
---|---|
รับชื่ออุปกรณ์
public String getDeviceName (ITestDevice device)
ส่งกลับชื่อของอุปกรณ์ที่ตั้งค่าในการกำหนดค่า xml จาก ITestDevice
ส่งกลับค่า null ถ้า ITestDevice ไม่สามารถจับคู่ได้
พารามิเตอร์ | |
---|---|
device | ITestDevice |
การส่งคืน | |
---|---|
String |
รับอุปกรณ์
publicgetDevices ()
ส่งคืนอุปกรณ์ที่จัดสรรทั้งหมดที่ติดตามสำหรับการเรียกใช้นี้
การส่งคืน | |
---|---|
getInvocationId
public String getInvocationId ()
การส่งคืน | |
---|---|
String |
getModuleInvocationContext
public IInvocationContext getModuleInvocationContext ()
ส่งกลับบริบทการร้องขอของโมดูลในขณะที่ดำเนินการเป็นส่วนหนึ่งของชุด
การส่งคืน | |
---|---|
IInvocationContext |
getNumDevicesAllocated
public int getNumDevicesAllocated ()
ส่งคืนจำนวนอุปกรณ์ที่จัดสรรสำหรับการเรียกใช้
การส่งคืน | |
---|---|
int |
รับซีเรียล
publicgetSerials ()
ส่งคืนรายการซีเรียลของอุปกรณ์ที่ติดตามในการเรียกใช้นี้
การส่งคืน | |
---|---|
getShardsSerials
publicgetShardsSerials ()
ส่งคืนแผนที่ของซีรีส์ที่ติดตามทั้งหมดและชาร์ดดิ้งที่เกี่ยวข้องในการชาร์ดดิ้ง ว่างเปล่าหากไม่ใช่การร้องขอแบบแบ่งส่วน
การส่งคืน | |
---|---|
รับTestTag
public String getTestTag ()
ส่งกลับแท็กทดสอบการร้องขอ
การส่งคืน | |
---|---|
String |
คุณสมบัติล็อค
public void lockAttributes ()
ล็อกบริบทเพื่อป้องกันไม่ให้มีการเพิ่มแอตทริบิวต์การเรียกใช้เพิ่มเติม
logInvocationMetrics
public void logInvocationMetrics ()
บันทึกแอตทริบิวต์ InvocationMetricLogger
ลงในคำขอ
ทำเครื่องหมายเผยแพร่ก่อน
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 |
ตั้งค่าTestTag
public void setTestTag (String testTag)
ตั้งค่าแท็กทดสอบการเรียกใช้
พารามิเตอร์ | |
---|---|
testTag | String |
ถึงโปรโต
public InvocationContext.Context toProto ()
ทำให้อินสแตนซ์บริบทเป็นอนุกรมลงใน protobuf
การส่งคืน | |
---|---|
InvocationContext.Context |
ถูกปล่อยออกมาในช่วงต้น
public boolean wasReleasedEarly ()
ส่งคืนว่าอุปกรณ์ออกก่อนเวลาหรือไม่และจะไม่ใช้งานอีกต่อไป
การส่งคืน | |
---|---|
boolean |