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)
Invocation 属性を追加します。 |
void
|
addInvocationAttributes(MultiMap<String, String> attributesMap)
|
void
|
addSerialsFromShard(Integer index, List<String> serials)
テストを実行しているシャードのいずれかに割り当てられたものとして追跡されるシリアルを追加します。 |
static
InvocationContext
|
fromProto(InvocationContext.Context protoContext)
インスタンスを元に戻すための |
MultiMap<String, String>
|
getAttributes()
呼び出し属性をすべて含むマップのコピーを返します。 |
IBuildInfo
|
getBuildInfo(String deviceName)
指定されたデバイス構成名に関連付けられた |
IBuildInfo
|
getBuildInfo(ITestDevice testDevice)
|
String
|
getBuildInfoName(IBuildInfo info)
|
List<IBuildInfo>
|
getBuildInfos()
この呼び出しで追跡されたすべての |
ConfigurationDescriptor
|
getConfigurationDescriptor()
呼び出しを開始したテスト構成に関連付けられた記述子を返します。 |
ITestDevice
|
getDevice(String deviceName)
指定されたデバイス構成名に関連付けられた |
Map<ITestDevice, IBuildInfo>
|
getDeviceBuildMap()
デバイスとビルド情報の関連付けのマップを返します。 |
ITestDevice
|
getDeviceBySerial(String serial)
指定されたシリアルに関連付けられた |
List<String>
|
getDeviceConfigNames()
この呼び出しで追跡されたデバイスのデバイス構成名のリストを返します。 |
String
|
getDeviceName(ITestDevice device)
|
List<ITestDevice>
|
getDevices()
この呼び出しで割り当てられたすべてのデバイス トラッキングを返します。 |
String
|
getInvocationId()
|
IInvocationContext
|
getModuleInvocationContext()
スイートの一部として実行されているモジュールの呼び出しコンテキストを返します。 |
int
|
getNumDevicesAllocated()
呼び出しに割り当てられたデバイスの数を返します。 |
List<String>
|
getSerials()
この呼び出しで追跡されたデバイスのシリアル番号のリストを返します。 |
Map<Integer, List<String>>
|
getShardsSerials()
追跡されたすべてのシリアルと、シャーディングに関与するシャードのマップを返します。 |
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)Invocation 属性を追加します。
| パラメータ | |
|---|---|
attributeName |
String |
attributeValue |
String |
addInvocationAttributes
public void addInvocationAttributes (MultiMap<String, String> attributesMap)
UniqueMultiMap を使用して複数の呼び出し属性を一度に追加します。
| パラメータ | |
|---|---|
attributesMap |
MultiMap |
addSerialsFromShard
public void addSerialsFromShard (Integer index,
List<String> serials)テストを実行しているシャードのいずれかに割り当てられたものとして追跡されるシリアルを追加します。
| パラメータ | |
|---|---|
index |
Integer: シリアルを使用するシャードのインデックス |
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 を返します。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 |
|
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)
ITestDevice から xml 構成でデバイスセットの名前を返します。ITestDevice を照合できない場合は null を返します。
| パラメータ | |
|---|---|
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 ()
シャーディングに関与するすべての追跡対象シリアルとそのシャードのマップを返します。シャード化された呼び出しでない場合は空になります。
| 戻り値 | |
|---|---|
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 ()
コンテキストをロックして、呼び出し属性が追加されないようにします。
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 |
|