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.
SemaphoreTokenTargetPreparer
public
class
SemaphoreTokenTargetPreparer
extends BaseTargetPreparer
Si tratta di un preparatore utilizzato per utilizzare il token per serializzare l'esecuzione del test nell'host tradefed. Solo il token di acquisizione del dispositivo potrà avviare il test. Altri aspetteranno fino al rilascio. Questo non può essere utilizzato solo quando hai un test in tradefed e utilizzi risorse condivise. Assicurati che sia in esecuzione un solo test sull'host con DUT diversi. L'utente deve aggiungere --semaphore-token:no-disable nel file di comando.
Riepilogo
Costruttori pubblici
SemaphoreTokenTargetPreparer
public SemaphoreTokenTargetPreparer ()
Metodi pubblici
public void setUp (TestInformation testInfo)
Parametri |
testInfo |
TestInformation |
public void tearDown (TestInformation testInfo,
Throwable e)
Parametri |
testInfo |
TestInformation |
e |
Throwable |
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,["# 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) | |"]]