ตั้งแต่วันที่ 27 มีนาคม 2025 เป็นต้นไป เราขอแนะนำให้ใช้ android-latest-release
แทน aosp-main
เพื่อสร้างและมีส่วนร่วมใน AOSP โปรดดูข้อมูลเพิ่มเติมที่หัวข้อการเปลี่ยนแปลงใน AOSP
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
TestContext
public
class
TestContext
extends Object
java.lang.Object
|
↳ |
com.android.tradefed.cluster.TestContext
|
คลาสที่จะจําลองข้อความ TestContext ของ TFC API
ข้อความ TestContext ใช้เพื่อจัดเก็บและดึงข้อมูลตามบริบทที่ส่งผ่านระหว่างการพยายามใช้คําสั่งทดสอบเดียวกันหลายครั้ง
สรุป
ตัวสร้างแบบสาธารณะ
TestContext
public TestContext ()
เมธอดสาธารณะ
addEnvVars
public void addEnvVars ( envVars)
addTestResource
public void addTestResource (TestResource testResource)
พารามิเตอร์ |
testResource |
TestResource |
เท่ากับ
public boolean equals (Object o)
fromJson
public static TestContext fromJson (JSONObject json)
พารามิเตอร์ |
json |
JSONObject |
getCommandLine
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-27 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-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 |"]]