A partir de 27 de março de 2025, recomendamos usar android-latest-release
em vez de aosp-main
para criar e contribuir com o AOSP. Para mais informações, consulte Mudanças no AOSP.
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
TestDescriptionsFile
public
class
TestDescriptionsFile
extends Object
java.lang.Object
|
↳ |
com.android.tradefed.result.TestDescriptionsFile
|
Uma classe de utilitário para empacotar e desempacotar uma lista de TestDescriptions em um arquivo de teste.
Tem como objetivo armazenar em cache e minimizar a E/S de arquivos com o carregamento lento.
NÃO é thread-safe.
Resumo
Construtores públicos
TestDescriptionsFile
public TestDescriptionsFile ()
Crie uma lista de descrições de teste vazia.
TestDescriptionsFile
public TestDescriptionsFile (File file)
Crie uma lista de descrições de teste com base no conteúdo do arquivo.
Métodos públicos
adicionar
public void add (TestDescription test)
Parâmetros |
test |
TestDescription |
addAll
public void addAll ( test)
getFile
public File getFile ()
Retorna a representação do arquivo de teste dos testes, criando-o, se necessário.
Os testes serão únicos e classificados.
getTests
public getTests ()
Retorna uma cópia dos testes armazenados, criando a partir do arquivo de teste, se necessário.
populateTestFile
public void populateTestFile (File testfile)
Preenche o arquivo fornecido com os testes atuais.
remove
public void remove (TestDescription test)
Parâmetros |
test |
TestDescription |
O conteúdo e os exemplos de código nesta página estão sujeitos às licenças descritas na Licença de conteúdo. Java e OpenJDK são marcas registradas da Oracle e/ou suas afiliadas.
Última atualização 2025-07-27 UTC.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Não contém as informações de que eu preciso","missingTheInformationINeed","thumb-down"],["Muito complicado / etapas demais","tooComplicatedTooManySteps","thumb-down"],["Desatualizado","outOfDate","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Problema com as amostras / o código","samplesCodeIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-07-27 UTC."],[],[],null,["# TestDescriptionsFile\n====================\n\n\n`\npublic\n\n\nclass\nTestDescriptionsFile\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.result.TestDescriptionsFile |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nA utility class for marshalling and unmarshalling a list of TestDescriptions to a test file.\n\nIntended to cache and minimize file I/O by lazy loading.\n\nNOT thread safe.\n\nSummary\n-------\n\n| ### Public constructors ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ` `[TestDescriptionsFile](../../../../../../reference/tradefed/com/android/tradefed/result/TestDescriptionsFile.html#TestDescriptionsFile())`() ` Create an empty test description list. |\n| ` `[TestDescriptionsFile](../../../../../../reference/tradefed/com/android/tradefed/result/TestDescriptionsFile.html#TestDescriptionsFile(File))`(File file) ` Create a test description list from the file contents. |\n\n| ### Public methods ||\n|------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` void` | ` `[add](../../../../../../reference/tradefed/com/android/tradefed/result/TestDescriptionsFile.html#add(com.android.tradefed.result.TestDescription))`(`[TestDescription](../../../../../../reference/tradefed/com/android/tradefed/result/TestDescription.html)` test) ` |\n| ` void` | ` `[addAll](../../../../../../reference/tradefed/com/android/tradefed/result/TestDescriptionsFile.html#addAll(\u003cany\u003e))`(` test) |\n| ` static `[TestDescriptionsFile](../../../../../../reference/tradefed/com/android/tradefed/result/TestDescriptionsFile.html) | ` `[fromTests](../../../../../../reference/tradefed/com/android/tradefed/result/TestDescriptionsFile.html#fromTests(\u003cany\u003e))`(` shardTests) |\n| ` File` | ` `[getFile](../../../../../../reference/tradefed/com/android/tradefed/result/TestDescriptionsFile.html#getFile())`() ` Return the test file representation of the tests - building it if necessary. |\n| ` ` | ` `[getTests](../../../../../../reference/tradefed/com/android/tradefed/result/TestDescriptionsFile.html#getTests())`() ` Return a copy of the tests stored - building from test file if necessary. |\n| ` void` | ` `[populateTestFile](../../../../../../reference/tradefed/com/android/tradefed/result/TestDescriptionsFile.html#populateTestFile(File))`(File testfile) ` Populates the given file with the current tests. |\n| ` void` | ` `[remove](../../../../../../reference/tradefed/com/android/tradefed/result/TestDescriptionsFile.html#remove(com.android.tradefed.result.TestDescription))`(`[TestDescription](../../../../../../reference/tradefed/com/android/tradefed/result/TestDescription.html)` test) ` |\n| ` int` | ` `[size](../../../../../../reference/tradefed/com/android/tradefed/result/TestDescriptionsFile.html#size())`() ` |\n\nPublic constructors\n-------------------\n\n### TestDescriptionsFile\n\n```\npublic TestDescriptionsFile ()\n```\n\nCreate an empty test description list.\n\n\u003cbr /\u003e\n\n### TestDescriptionsFile\n\n```\npublic TestDescriptionsFile (File file)\n```\n\nCreate a test description list from the file contents.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|--------|---------------|\n| `file` | `File` \u003cbr /\u003e |\n\nPublic methods\n--------------\n\n### add\n\n```\npublic void add (TestDescription test)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|--------|--------------------------|\n| `test` | `TestDescription` \u003cbr /\u003e |\n\n### addAll\n\n```\npublic void addAll ( test)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|--------|--------|\n| `test` | \u003cbr /\u003e |\n\n### fromTests\n\n```\npublic static TestDescriptionsFile fromTests ( shardTests)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|--------------|--------|\n| `shardTests` | \u003cbr /\u003e |\n\n| Returns ||\n|--------------------------------------------------------------------------------------------------------------------|--------|\n| [TestDescriptionsFile](../../../../../../reference/tradefed/com/android/tradefed/result/TestDescriptionsFile.html) | \u003cbr /\u003e |\n\n### getFile\n\n```\npublic File getFile ()\n```\n\nReturn the test file representation of the tests - building it if necessary.\n\nTests will be unique and sorted.\n\n\u003cbr /\u003e\n\n| Returns ||\n|--------|--------|\n| `File` | \u003cbr /\u003e |\n\n### getTests\n\n```\npublic getTests ()\n```\n\nReturn a copy of the tests stored - building from test file if necessary.\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|--------|\n| | \u003cbr /\u003e |\n\n### populateTestFile\n\n```\npublic void populateTestFile (File testfile)\n```\n\nPopulates the given file with the current tests.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------|---------------|\n| `testfile` | `File` \u003cbr /\u003e |\n\n### remove\n\n```\npublic void remove (TestDescription test)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|--------|--------------------------|\n| `test` | `TestDescription` \u003cbr /\u003e |\n\n### size\n\n```\npublic int size ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|--------|\n| `int` | \u003cbr /\u003e |"]]