FakeTestsZipFolder

public class FakeTestsZipFolder
extends Object

java.lang.Object
   ↳ com.android.tradefed.util.FakeTestsZipFolder


A testing fixture that creates a fake unzipped tests folder based on a list of content. The folder structure is configured based on a list of file names or folder names, as provided to the constructor. cleanUp() should be called after the folder is no longer needed.

Summary

Nested classes

enum FakeTestsZipFolder.ItemType

 

Public constructors

FakeTestsZipFolder(Map<String, FakeTestsZipFolder.ItemType> items)

Create a fake unzipped tests folder backed by empty files

Public methods

void cleanUp()

Delete the entire fake unzipped test folder

boolean createItems()

Create fake unzipped tests folder as indicated by the manifest of items

File getBasePath()

Returns the base of the fake unzipped folder This would be a replacement of root folder where a real tests zip is expanded

Protected methods

File getDataFolder()

Public constructors

FakeTestsZipFolder

FakeTestsZipFolder (Map<String, FakeTestsZipFolder.ItemType> items)

Create a fake unzipped tests folder backed by empty files

Parameters
items Map: 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

Public methods

cleanUp

void cleanUp ()

Delete the entire fake unzipped test folder

createItems

boolean createItems ()

Create fake unzipped tests folder as indicated by the manifest of items

Returns
boolean false if failed to create any item
Throws
IOException

getBasePath

File getBasePath ()

Returns the base of the fake unzipped folder This would be a replacement of root folder where a real tests zip is expanded

Returns
File

Protected methods

getDataFolder

File getDataFolder ()

Returns
File