自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
FakeTestsZipFolder
public
class
FakeTestsZipFolder
extends Object
java.lang.Object
|
↳ |
com.android.tradefed.util.FakeTestsZipFolder
|
一种测试实例,用于根据内容列表创建虚假的未解压缩测试文件夹。
文件夹结构是根据提供给构造函数的文件名或文件夹名称列表进行配置的。在不再需要该文件夹后,应调用 FakeTestsZipFolder.cleanUp()
。
摘要
公共构造函数
FakeTestsZipFolder
public FakeTestsZipFolder ( items)
创建一个由空文件支持的虚假解压缩测试文件夹
参数 |
items |
:要包含在虚假解压缩文件夹中的项的列表。映射的键应为项的相对路径,条目的值应指明条目应由空文件还是文件夹提供支持 |
公共方法
cleanUp
public void cleanUp ()
删除整个虚构的解压缩测试文件夹
createItems
public boolean createItems ()
创建虚构的未解压缩测试文件夹,如项清单所示
返回 |
boolean |
如果未能创建任何内容,则为 false |
getBasePath
public File getBasePath ()
返回虚构解压缩文件夹的根目录。这将替换实际测试 ZIP 文件展开到的根文件夹
受保护的方法
getDataFolder
protected File getDataFolder ()
本页面上的内容和代码示例受内容许可部分所述许可的限制。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,["# FakeTestsZipFolder\n==================\n\n\n`\npublic\n\n\nclass\nFakeTestsZipFolder\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.util.FakeTestsZipFolder |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nA testing fixture that creates a fake unzipped tests folder based on a list of content.\n\nThe folder structure is configured based on a list of file names or folder names, as provided\nto the constructor. [FakeTestsZipFolder.cleanUp()](../../../../../../reference/tradefed/com/android/tradefed/util/FakeTestsZipFolder.html#cleanUp()) should be called after the folder is\nno longer needed.\n\nSummary\n-------\n\n| ### Public constructors ||\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ` `[FakeTestsZipFolder](../../../../../../reference/tradefed/com/android/tradefed/util/FakeTestsZipFolder.html#FakeTestsZipFolder(\u003cany\u003e))`(` items) Create a fake unzipped tests folder backed by empty files |\n\n| ### Public methods ||\n|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` void` | ` `[cleanUp](../../../../../../reference/tradefed/com/android/tradefed/util/FakeTestsZipFolder.html#cleanUp())`() ` Delete the entire fake unzipped test folder |\n| ` boolean` | ` `[createItems](../../../../../../reference/tradefed/com/android/tradefed/util/FakeTestsZipFolder.html#createItems())`() ` Create fake unzipped tests folder as indicated by the manifest of items |\n| ` File` | ` `[getBasePath](../../../../../../reference/tradefed/com/android/tradefed/util/FakeTestsZipFolder.html#getBasePath())`() ` Returns the base of the fake unzipped folder This would be a replacement of root folder where a real tests zip is expanded |\n\n| ### Protected methods ||\n|---------|---------------------------------------------------------------------------------------------------------------------------------|\n| ` File` | ` `[getDataFolder](../../../../../../reference/tradefed/com/android/tradefed/util/FakeTestsZipFolder.html#getDataFolder())`() ` |\n\nPublic constructors\n-------------------\n\n### FakeTestsZipFolder\n\n```\npublic FakeTestsZipFolder ( items)\n```\n\nCreate a fake unzipped tests folder backed by empty files\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `items` | : list of items to include in the fake unzipped folder. key of the map shall be the relative path of the item, value of the entry shall indicate if the entry should be backed by an empty file or a folder \u003cbr /\u003e |\n\nPublic methods\n--------------\n\n### cleanUp\n\n```\npublic void cleanUp ()\n```\n\nDelete the entire fake unzipped test folder\n\n\u003cbr /\u003e\n\n### createItems\n\n```\npublic boolean createItems ()\n```\n\nCreate fake unzipped tests folder as indicated by the manifest of items\n\n\u003cbr /\u003e\n\n| Returns ||\n|-----------|-------------------------------------------|\n| `boolean` | false if failed to create any item \u003cbr /\u003e |\n\n| Throws ||\n|---|-------------|\n| | IOException |\n\n### getBasePath\n\n```\npublic File getBasePath ()\n```\n\nReturns the base of the fake unzipped folder This would be a replacement\nof root folder where a real tests zip is expanded\n\n\u003cbr /\u003e\n\n| Returns ||\n|--------|--------|\n| `File` | \u003cbr /\u003e |\n\nProtected methods\n-----------------\n\n### getDataFolder\n\n```\nprotected File getDataFolder ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|--------|--------|\n| `File` | \u003cbr /\u003e |"]]