Начиная с 27 марта 2025 г. мы рекомендуем использовать android-latest-release
вместо aosp-main
для создания и участия в AOSP. Дополнительные сведения см. в разделе Изменения в AOSP .
Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
ТестКонтекст
public class TestContext
extends Object
java.lang.Объект |
↳ | com.android.tradefed.cluster.TestContext |
Класс для моделирования сообщения TestContext TFC API.
Сообщение TestContext используется для хранения и извлечения контекстной информации, передаваемой при нескольких попытках выполнения одной и той же тестовой команды.
Краткое содержание
Общественные конструкторы
ТестКонтекст
public TestContext ()
Публичные методы
добавитьEnvVars
public void addEnvVars ( envVars)
добавитьтестресаурце
public void addTestResource (TestResource testResource)
Параметры |
---|
testResource | TestResource |
равно
public boolean equals (Object o)
отJson
public static TestContext fromJson (JSONObject json)
Параметры |
---|
json | JSONObject |
получитькомандную строку
public String getCommandLine ()
getEnvVars
public getEnvVars ()
getTestResources
public getTestResources ()
setCommandLine
public void setCommandLine (String commandLine)
Параметры |
---|
commandLine | String |
toJson
public JSONObject toJson ()
toString
public String toString ()
Контент и образцы кода на этой странице предоставлены по лицензиям. Java и OpenJDK – это зарегистрированные товарные знаки корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-07-29 UTC.
[[["Прост для понимания","easyToUnderstand","thumb-up"],["Помог мне решить мою проблему","solvedMyProblem","thumb-up"],["Другое","otherUp","thumb-up"]],[["Отсутствует нужная мне информация","missingTheInformationINeed","thumb-down"],["Слишком сложен/слишком много шагов","tooComplicatedTooManySteps","thumb-down"],["Устарел","outOfDate","thumb-down"],["Проблема с переводом текста","translationIssue","thumb-down"],["Проблемы образцов/кода","samplesCodeIssue","thumb-down"],["Другое","otherDown","thumb-down"]],["Последнее обновление: 2025-07-29 UTC."],[],[],null,["# TestContext\n===========\n\n\n`\npublic\n\n\nclass\nTestContext\n`\n\n\n`\n\nextends Object\n\n\n`\n\n`\n\n\n`\n\n|---|------------------------------------------|\n| java.lang.Object ||\n| ↳ | com.android.tradefed.cluster.TestContext |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nA class to model a TestContext message of TFC API.\n\nA TestContext message is used to store and retrieve contextual information being passed across\nmultiple attempts of same test command.\n\nSummary\n-------\n\n| ### Public constructors ||\n|-------------------------------------------------------------------------------------------------------------------------|---|\n| ` `[TestContext](../../../../../../reference/tradefed/com/android/tradefed/cluster/TestContext.html#TestContext())`() ` |\n\n| ### Public methods ||\n|-------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` void` | ` `[addEnvVars](../../../../../../reference/tradefed/com/android/tradefed/cluster/TestContext.html#addEnvVars(\u003cany\u003e))`(` envVars) |\n| ` void` | ` `[addTestResource](../../../../../../reference/tradefed/com/android/tradefed/cluster/TestContext.html#addTestResource(com.android.tradefed.cluster.TestResource))`(`[TestResource](../../../../../../reference/tradefed/com/android/tradefed/cluster/TestResource.html)` testResource) ` |\n| ` boolean` | ` `[equals](../../../../../../reference/tradefed/com/android/tradefed/cluster/TestContext.html#equals(java.lang.Object))`(Object o) ` |\n| ` static `[TestContext](../../../../../../reference/tradefed/com/android/tradefed/cluster/TestContext.html) | ` `[fromJson](../../../../../../reference/tradefed/com/android/tradefed/cluster/TestContext.html#fromJson(org.json.JSONObject))`(JSONObject json) ` |\n| ` String` | ` `[getCommandLine](../../../../../../reference/tradefed/com/android/tradefed/cluster/TestContext.html#getCommandLine())`() ` |\n| ` ` | ` `[getEnvVars](../../../../../../reference/tradefed/com/android/tradefed/cluster/TestContext.html#getEnvVars())`() ` |\n| ` ` | ` `[getTestResources](../../../../../../reference/tradefed/com/android/tradefed/cluster/TestContext.html#getTestResources())`() ` |\n| ` void` | ` `[setCommandLine](../../../../../../reference/tradefed/com/android/tradefed/cluster/TestContext.html#setCommandLine(java.lang.String))`(String commandLine) ` |\n| ` JSONObject` | ` `[toJson](../../../../../../reference/tradefed/com/android/tradefed/cluster/TestContext.html#toJson())`() ` |\n| ` String` | ` `[toString](../../../../../../reference/tradefed/com/android/tradefed/cluster/TestContext.html#toString())`() ` |\n\nPublic constructors\n-------------------\n\n### TestContext\n\n```\npublic TestContext ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nPublic methods\n--------------\n\n### addEnvVars\n\n```\npublic void addEnvVars ( envVars)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----------|--------|\n| `envVars` | \u003cbr /\u003e |\n\n### addTestResource\n\n```\npublic void addTestResource (TestResource testResource)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------------|-----------------------|\n| `testResource` | `TestResource` \u003cbr /\u003e |\n\n### equals\n\n```\npublic boolean equals (Object o)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----|-----------------|\n| `o` | `Object` \u003cbr /\u003e |\n\n| Returns ||\n|-----------|--------|\n| `boolean` | \u003cbr /\u003e |\n\n### fromJson\n\n```\npublic static TestContext fromJson (JSONObject json)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|--------|---------------------|\n| `json` | `JSONObject` \u003cbr /\u003e |\n\n| Returns ||\n|---------------------------------------------------------------------------------------------------|--------|\n| [TestContext](../../../../../../reference/tradefed/com/android/tradefed/cluster/TestContext.html) | \u003cbr /\u003e |\n\n| Throws ||\n|-----------------|---|\n| `JSONException` | |\n\n### getCommandLine\n\n```\npublic String getCommandLine ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|----------|--------|\n| `String` | \u003cbr /\u003e |\n\n### getEnvVars\n\n```\npublic getEnvVars ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|--------|\n| | \u003cbr /\u003e |\n\n### getTestResources\n\n```\npublic getTestResources ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|--------|\n| | \u003cbr /\u003e |\n\n### setCommandLine\n\n```\npublic void setCommandLine (String commandLine)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------------|-----------------|\n| `commandLine` | `String` \u003cbr /\u003e |\n\n### toJson\n\n```\npublic JSONObject toJson ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|--------------|--------|\n| `JSONObject` | \u003cbr /\u003e |\n\n| Throws ||\n|-----------------|---|\n| `JSONException` | |\n\n### toString\n\n```\npublic String toString ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|----------|--------|\n| `String` | \u003cbr /\u003e |"]]