自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
TestDescriptionsFile
public
class
TestDescriptionsFile
extends Object
java.lang.Object
|
↳ |
com.android.tradefed.result.TestDescriptionsFile
|
用于将 TestDescription 列表编组和解组到测试文件的实用程序类。
旨在通过延迟加载来缓存和最大限度地减少文件 I/O。
不具有线程安全性。
摘要
公共构造函数
TestDescriptionsFile
public TestDescriptionsFile ()
创建一个空的测试说明列表。
TestDescriptionsFile
public TestDescriptionsFile (File file)
根据文件内容创建测试说明列表。
公共方法
addAll
public void addAll ( test)
getFile
public File getFile ()
返回测试的测试文件表示法 - 如有必要,请进行构建。
测试将是唯一的,并且会进行排序。
getTests
public getTests ()
返回存储的测试的副本,必要时从测试文件构建。
populateTestFile
public void populateTestFile (File testfile)
使用当前测试填充给定文件。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[[["易于理解","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"]],["最后更新时间 (UTC):2025-07-27。"],[],[],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 |"]]