TestFilePushSetup

public class TestFilePushSetup
extends Object implements ITargetPreparer

java.lang.Object
   ↳ com.android.tradefed.targetprep.TestFilePushSetup
Known Direct Subclasses
CrashCollector A ITargetPreparer that runs crash collector on device which suppresses and logs crashes during test execution. 
PushFileInvoker A ITargetPreparer that pushes files from tests zip onto device, mark them as executable and invokes the binary or script on device. 


A ITargetPreparer that pushes one or more files/dirs from a getTestsDir() folder onto device.

This preparer will look in alternate directories if the tests zip does not exist or does not contain the required apk. The search will go in order from the last alternative dir specified to the first.

Summary

Public constructors

TestFilePushSetup()

Public methods

void setUp(ITestDevice device, IBuildInfo buildInfo)

Perform the target setup for testing.

Protected methods

void addTestFileName(String fileName)

Adds a file to the list of items to push

void clearTestFileName()
File getLocalPathForFilename(IBuildInfo buildInfo, String fileName, ITestDevice device)

Resolve the host side path based on testing artifact information inside build info.

Collection<String> getTestFileNames()

Retrieves the list of files to be pushed from test zip onto device

void setAltDir(File altDir)

Set an alternate directory.

void setAltDirBehavior(AltDirBehavior behavior)

Set the alternative directory search behavior.

void setThrowIfNoFile(boolean throwIfNoFile)

Public constructors

TestFilePushSetup

TestFilePushSetup ()

Public methods

setUp

void setUp (ITestDevice device, 
                IBuildInfo buildInfo)

Perform the target setup for testing.

Parameters
device ITestDevice: the ITestDevice to prepare.
buildInfo IBuildInfo: data about the build under test.
Throws
TargetSetupError
BuildError
DeviceNotAvailableException

Protected methods

addTestFileName

void addTestFileName (String fileName)

Adds a file to the list of items to push

clearTestFileName

void clearTestFileName ()

getLocalPathForFilename

File getLocalPathForFilename (IBuildInfo buildInfo, 
                String fileName, 
                ITestDevice device)

Resolve the host side path based on testing artifact information inside build info.

Parameters
buildInfo IBuildInfo: build artifact information
fileName String: filename of artifacts to push
device ITestDevice
Returns
File a File representing the physical file/path on host
Throws
TargetSetupError

getTestFileNames

Collection<String> getTestFileNames ()

Retrieves the list of files to be pushed from test zip onto device

Returns
Collection<String>

setAltDir

void setAltDir (File altDir)

Set an alternate directory. Exposed for testing.

Parameters
altDir File

setAltDirBehavior

void setAltDirBehavior (AltDirBehavior behavior)

Set the alternative directory search behavior. Exposed for testing.

Parameters
behavior AltDirBehavior

setThrowIfNoFile

void setThrowIfNoFile (boolean throwIfNoFile)

Parameters
throwIfNoFile boolean