TestFilePushSetup

public class TestFilePushSetup
extends BaseTargetPreparer implements IDiscoverDependencies

java.lang.Object
   ↳ com.android.tradefed.targetprep.BaseTargetPreparer
     ↳ com.android.tradefed.targetprep.TestFilePushSetup


A ITargetPreparer that pushes one or more files/dirs from a IDeviceBuildInfo.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

reportDependencies()
void setUp(TestInformation testInfo)

Protected methods

void addTestFileName(String fileName)

Adds a file to the list of items to push

void clearTestFileName()
getFailedToPushFiles()

Returns the set of files that failed to be pushed.

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

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

getTestFileNames()

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

void setThrowIfNoFile(boolean throwIfNoFile)

Public constructors

TestFilePushSetup

public TestFilePushSetup ()

Public methods

reportDependencies

public  reportDependencies ()

Returns

setUp

public void setUp (TestInformation testInfo)

Parameters
testInfo TestInformation

Throws
BuildError
DeviceNotAvailableException
TargetSetupError

Protected methods

addTestFileName

protected void addTestFileName (String fileName)

Adds a file to the list of items to push

clearTestFileName

protected void clearTestFileName ()

getFailedToPushFiles

protected  getFailedToPushFiles ()

Returns the set of files that failed to be pushed. Can only be used if 'throw-if-not-found' is false otherwise the first failed push will throw an exception.

Returns

getLocalPathForFilename

protected 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 ERROR(/File) representing the physical file/path on host

Throws
TargetSetupError

getTestFileNames

protected  getTestFileNames ()

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

Returns

setThrowIfNoFile

protected void setThrowIfNoFile (boolean throwIfNoFile)

Parameters
throwIfNoFile boolean