호출 컨텍스트
public class InvocationContext
extends Object
implements IInvocationContext
java.lang.객체 | |
↳ | com.android.tradefed.invoker.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) |
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 () 더 많은 호출 속성이 추가되지 않도록 컨텍스트를 잠급니다. |
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를 추가합니다. 지도에서 빌드 정보를 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
반환합니다. deviceName을 일치시킬 수 없는 경우 null을 반환합니다.
매개변수 | |
---|---|
deviceName | String |
보고 | |
---|---|
IBuildInfo |
getBuildInfo
public IBuildInfo getBuildInfo (ITestDevice testDevice)
ITestDevice
와 연결된 IBuildInfo
반환합니다.
매개변수 | |
---|---|
testDevice | ITestDevice |
보고 | |
---|---|
IBuildInfo |
getBuildInfoName
public String getBuildInfoName (IBuildInfo info)
IBuildInfo
에서 xml 구성에 설정된 장치 이름을 반환합니다. IBuildInfo를 일치시킬 수 없는 경우 null을 반환합니다.
매개변수 | |
---|---|
info | IBuildInfo |
보고 | |
---|---|
String |
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)
ITestDevice
에서 xml 구성에 설정된 장치 이름을 반환합니다. ITestDevice를 일치시킬 수 없는 경우 null을 반환합니다.
매개변수 | |
---|---|
device | ITestDevice |
보고 | |
---|---|
String |
getDevices
publicgetDevices ()
이 호출에 대해 추적된 모든 할당된 장치를 반환합니다.
보고 | |
---|---|
getInvocationId
public String getInvocationId ()
보고 | |
---|---|
String |
getModuleInvocationContext
public IInvocationContext getModuleInvocationContext ()
제품군의 일부로 실행되는 동안 모듈의 호출 컨텍스트를 반환합니다.
보고 | |
---|---|
IInvocationContext |
getNumDevices할당
public int getNumDevicesAllocated ()
호출에 할당된 장치 수를 반환합니다.
보고 | |
---|---|
int |
getSerials
publicgetSerials ()
이 호출에서 추적된 장치의 일련 번호 목록을 반환합니다.
보고 | |
---|---|
getShardsSerials
publicgetShardsSerials ()
샤딩과 관련된 모든 추적된 시리얼 및 해당 샤드의 맵을 반환합니다. 분할된 호출이 아닌 경우 비어 있습니다.
보고 | |
---|---|
getTestTag
public String getTestTag ()
호출 테스트 태그를 반환합니다.
보고 | |
---|---|
String |
잠금 속성
public void lockAttributes ()
더 많은 호출 속성이 추가되지 않도록 컨텍스트를 잠급니다.
마크출시일찍
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 |
일찍 출시되었습니다
public boolean wasReleasedEarly ()
장치가 조기에 출시되어 더 이상 사용되지 않을지 여부를 반환합니다.
보고 | |
---|---|
boolean |