A partire dal 27 marzo 2025, ti consigliamo di utilizzare android-latest-release
anziché aosp-main
per compilare e contribuire ad AOSP. Per ulteriori informazioni, vedi Modifiche ad AOSP.
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
TestContext
public
class
TestContext
extends Object
java.lang.Object
|
↳ |
com.android.tradefed.cluster.TestContext
|
Una classe per modellare un messaggio TestContext dell'API TFC.
Un messaggio TestContext viene utilizzato per archiviare e recuperare le informazioni contestuali trasmesse tra più tentativi dello stesso comando di test.
Riepilogo
Costruttori pubblici
TestContext
public TestContext ()
Metodi pubblici
addEnvVars
public void addEnvVars ( envVars)
addTestResource
public void addTestResource (TestResource testResource)
Parametri |
testResource |
TestResource |
uguale
public boolean equals (Object o)
fromJson
public static TestContext fromJson (JSONObject json)
Parametri |
json |
JSONObject |
getCommandLine
public String getCommandLine ()
getEnvVars
public getEnvVars ()
getTestResources
public getTestResources ()
setCommandLine
public void setCommandLine (String commandLine)
Parametri |
commandLine |
String |
toJson
public JSONObject toJson ()
toString
public String toString ()
I campioni di contenuti e codice in questa pagina sono soggetti alle licenze descritte nella Licenza per i contenuti. Java e OpenJDK sono marchi o marchi registrati di Oracle e/o delle sue società consociate.
Ultimo aggiornamento 2025-07-27 UTC.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 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 |"]]