AdbStopServerPreparer

public class AdbStopServerPreparer
extends BaseTargetPreparer implements ITargetCleaner

java.lang.Object
   ↳ com.android.tradefed.targetprep.BaseTargetPreparer
     ↳ com.android.tradefed.targetprep.adb.AdbStopServerPreparer


Target preparer to stop adb server on the host before and after running adb tests.

This preparer should be used with care as it stops and restart adb on the hosts. It should usually be tight with SemaphoreTokenTargetPreparer to avoid other tests from running at the same time.

Summary

Fields

public static final String ADB_BINARY_KEY

Public constructors

AdbStopServerPreparer()

Public methods

void setUp(ITestDevice device, IBuildInfo buildInfo)

Perform the target setup for testing.

void tearDown(ITestDevice device, IBuildInfo buildInfo, Throwable e)

Perform the target cleanup/teardown after testing.

Fields

ADB_BINARY_KEY

public static final String ADB_BINARY_KEY

Public constructors

AdbStopServerPreparer

public AdbStopServerPreparer ()

Public methods

setUp

public 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
BuildError
DeviceNotAvailableException
TargetSetupError

tearDown

public void tearDown (ITestDevice device, 
                IBuildInfo buildInfo, 
                Throwable e)

Perform the target cleanup/teardown after testing.

Parameters
device ITestDevice: the ITestDevice to prepare.

buildInfo IBuildInfo: data about the build under test.

e Throwable: if the invocation ended with an exception, this will be the exception that was caught at the Invocation level. Otherwise, will be null.

Throws
DeviceNotAvailableException