TestSuiteBuilder
public
class
TestSuiteBuilder
extends Object
Known direct subclasses
UnitTestSuiteBuilder |
This class was deprecated
in API level Baklava.
android.test.runner is obsolete
|
|
This class was deprecated
in API level 26.
New tests should be written using the
Android Testing Support Library.
Build suites based on a combination of included packages, excluded packages,
and predicates that must be satisfied.
Summary
Protected methods |
String
|
getSuiteName()
Subclasses use this method to determine the name of the suite.
|
Inherited methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait(long timeoutMillis, int nanos)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait(long timeoutMillis)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait()
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted.
|
|
Public constructors
TestSuiteBuilder
public TestSuiteBuilder (Class<T> clazz)
The given name is automatically prefixed with the package containing the tests to be run.
If more than one package is specified, the first is used.
Parameters |
clazz |
Class : Use the class from your .apk. Use the class name for the test suite name.
Use the class' classloader in order to load classes for testing.
This is needed when running in the emulator. |
TestSuiteBuilder
public TestSuiteBuilder (String name,
ClassLoader classLoader)
Parameters |
name |
String |
classLoader |
ClassLoader |
Public methods
build
public final TestSuite build ()
Call this method once you've configured your builder as desired.
Returns |
TestSuite |
The suite containing the requested tests. |
excludePackages
public TestSuiteBuilder excludePackages (String... packageNames)
Exclude all tests in the given packages and all sub-packages, unless otherwise specified.
Parameters |
packageNames |
String : Names of packages to remove. |
includeAllPackagesUnderHere
public final TestSuiteBuilder includeAllPackagesUnderHere ()
Include all junit tests that satisfy the requirements in the calling class' package and all
sub-packages.
includePackages
public TestSuiteBuilder includePackages (String... packageNames)
Include all tests that satisfy the requirements in the given packages and all sub-packages,
unless otherwise specified.
Parameters |
packageNames |
String : Names of packages to add. |
named
public TestSuiteBuilder named (String newSuiteName)
Override the default name for the suite being built. This should generally be called if you
call addRequirements(com.android.internal.util.Predicate[])
to make it clear which
tests will be included. The name you specify is automatically prefixed with the package
containing the tests to be run. If more than one package is specified, the first is used.
Parameters |
newSuiteName |
String : Prefix of name to give the suite being built. |
Protected methods
getSuiteName
protected String getSuiteName ()
Subclasses use this method to determine the name of the suite.
Returns |
String |
The package and suite name combined. |