Od 27 marca 2025 r. zalecamy używanie android-latest-release
zamiast aosp-main
do kompilowania i wspołtworzenia AOSP. Więcej informacji znajdziesz w artykule o zmianach w AOSP.
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
TestContext
public
class
TestContext
extends Object
java.lang.Object
|
↳ |
com.android.tradefed.cluster.TestContext
|
Klasa modelująca wiadomość TestContext interfejsu TFC API.
Wiadomość TestContext służy do przechowywania i odzyskiwania informacji kontekstowych przekazywanych w wielu próbach wykonania tego samego polecenia testowego.
Podsumowanie
Konstruktory publiczne
TestContext
public TestContext ()
Metody publiczne
addEnvVars
public void addEnvVars ( envVars)
addTestResource
public void addTestResource (TestResource testResource)
Parametry |
testResource |
TestResource |
równa się
public boolean equals (Object o)
fromJson
public static TestContext fromJson (JSONObject json)
Parametry |
json |
JSONObject |
getCommandLine
public String getCommandLine ()
getEnvVars
public getEnvVars ()
getTestResources
public getTestResources ()
setCommandLine
public void setCommandLine (String commandLine)
Parametry |
commandLine |
String |
toJson
public JSONObject toJson ()
toString
public String toString ()
Treść strony i umieszczone na niej fragmenty kodu podlegają licencjom opisanym w Licencji na treści. Java i OpenJDK są znakami towarowymi lub zastrzeżonymi znakami towarowymi należącymi do firmy Oracle lub jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-27 UTC.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-07-27 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 |"]]