ตั้งแต่วันที่ 27 มีนาคม 2025 เป็นต้นไป เราขอแนะนำให้ใช้ android-latest-release
แทน aosp-main
เพื่อสร้างและมีส่วนร่วมใน AOSP โปรดดูข้อมูลเพิ่มเติมที่หัวข้อการเปลี่ยนแปลงใน AOSP
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
SemaphoreTokenTargetPreparer
public
class
SemaphoreTokenTargetPreparer
extends BaseTargetPreparer
นี่เป็นเครื่องมือเตรียมที่ใช้โทเค็นเพื่อจัดเรียงลําดับการเรียกใช้การทดสอบในโฮสต์ TradeFed เฉพาะอุปกรณ์ที่รับโทเค็นเท่านั้นที่จะเริ่มการทดสอบได้ ส่วนคนอื่นๆ จะต้องรอจนกว่าจะมีการเผยแพร่ ตัวเลือกนี้ใช้ได้เฉพาะในกรณีที่คุณทำการทดสอบ 1 รายการใน TradeFed และใช้ทรัพยากรที่แชร์ โปรดตรวจสอบว่ามีเพียงการทดสอบเดียวที่ทำงานบนโฮสต์ที่มี DUT ที่แตกต่างกัน ผู้ใช้ต้องเพิ่ม --semaphore-token:no-disable ในไฟล์คำสั่ง
สรุป
ตัวสร้างแบบสาธารณะ
SemaphoreTokenTargetPreparer
public SemaphoreTokenTargetPreparer ()
เมธอดสาธารณะ
public void setUp (TestInformation testInfo)
พารามิเตอร์ |
testInfo |
TestInformation |
public void tearDown (TestInformation testInfo,
Throwable e)
พารามิเตอร์ |
testInfo |
TestInformation |
e |
Throwable |
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา 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,["# SemaphoreTokenTargetPreparer\n============================\n\n\n`\npublic\n\n\nclass\nSemaphoreTokenTargetPreparer\n`\n\n\n`\n\n\n`\n\n`\n\nextends `[BaseTargetPreparer](../../../../../../reference/tradefed/com/android/tradefed/targetprep/BaseTargetPreparer.html)`\n\n\n`\n\n`\n\n\n`\n\n|---|---|--------------------------------------------------------------|\n| java.lang.Object |||\n| ↳ | [com.android.tradefed.targetprep.BaseTargetPreparer](../../../../../../reference/tradefed/com/android/tradefed/targetprep/BaseTargetPreparer.html) ||\n| | ↳ | com.android.tradefed.targetprep.SemaphoreTokenTargetPreparer |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nThis is a preparer used to use token to serialize test excution in tradefed host. only the device\nacquire token will be allow to start the test. Others will wait until it released This can't be\nonly used when you have one test in tradefed and use shared resources. Please make sure only a\nsingle test running on the host with different DUTs User need to add --semaphore-token:no-disable\nin the command file.\n\nSummary\n-------\n\n| ### Public constructors ||\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ` `[SemaphoreTokenTargetPreparer](../../../../../../reference/tradefed/com/android/tradefed/targetprep/SemaphoreTokenTargetPreparer.html#SemaphoreTokenTargetPreparer())`() ` |\n\n| ### Public methods ||\n|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` void` | ` `[setUp](../../../../../../reference/tradefed/com/android/tradefed/targetprep/SemaphoreTokenTargetPreparer.html#setUp(com.android.tradefed.invoker.TestInformation))`(`[TestInformation](../../../../../../reference/tradefed/com/android/tradefed/invoker/TestInformation.html)` testInfo) ` |\n| ` void` | ` `[tearDown](../../../../../../reference/tradefed/com/android/tradefed/targetprep/SemaphoreTokenTargetPreparer.html#tearDown(com.android.tradefed.invoker.TestInformation,%20java.lang.Throwable))`(`[TestInformation](../../../../../../reference/tradefed/com/android/tradefed/invoker/TestInformation.html)` testInfo, Throwable e) ` |\n\nPublic constructors\n-------------------\n\n### SemaphoreTokenTargetPreparer\n\n```\npublic SemaphoreTokenTargetPreparer ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nPublic methods\n--------------\n\n### setUp\n\n```\npublic void setUp (TestInformation testInfo)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------|--------------------------|\n| `testInfo` | `TestInformation` \u003cbr /\u003e |\n\n| Throws ||\n|----------------------------------------------------------------------------------------------------------------------------------|---|\n| [BuildError](../../../../../../reference/tradefed/com/android/tradefed/targetprep/BuildError.html) | |\n| [DeviceNotAvailableException](../../../../../../reference/tradefed/com/android/tradefed/device/DeviceNotAvailableException.html) | |\n| [TargetSetupError](../../../../../../reference/tradefed/com/android/tradefed/targetprep/TargetSetupError.html) | |\n\n### tearDown\n\n```\npublic void tearDown (TestInformation testInfo, \n Throwable e)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------|--------------------------|\n| `testInfo` | `TestInformation` \u003cbr /\u003e |\n| `e` | `Throwable` \u003cbr /\u003e |\n\n| Throws ||\n|----------------------------------------------------------------------------------------------------------------------------------|---|\n| [DeviceNotAvailableException](../../../../../../reference/tradefed/com/android/tradefed/device/DeviceNotAvailableException.html) | |"]]