Build 1.0_r1(from source)

android.test.suitebuilder
Class TestGrouping

java.lang.Object
  extended by android.test.suitebuilder.TestGrouping

public class TestGrouping
extends Object

Represents a collection of test classes present on the classpath. You can add individual classes or entire packages. By default sub-packages are included recursively, but methods are provided to allow for arbitrary inclusion or exclusion of sub-packages. Typically a TestGrouping will have only one root package, but this is not a requirement. Not needed for 1.0 SDK.


Field Summary
protected  String firstIncludedPackage
           
static Comparator<Class<? extends TestCase>> SORT_BY_FULLY_QUALIFIED_NAME
           
static Comparator<Class<? extends TestCase>> SORT_BY_SIMPLE_NAME
           
(package private)  SortedSet<Class<? extends TestCase>> testCaseClasses
           
 
Constructor Summary
TestGrouping(Comparator<Class<? extends TestCase>> comparator)
           
 
Method Summary
 TestGrouping addPackagesRecursive(String... packageNames)
          Include all tests in the given packages and all their sub-packages, unless otherwise specified.
 boolean equals(Object o)
          Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison.
 String getFirstIncludedPackage()
           
(package private)  SortedSet<Class<? extends TestCase>> getTestCaseClasses()
           
protected  List<Method> getTestMethods(Class<? extends TestCase> testCaseClass)
           
 List<TestMethod> getTests()
           
 int hashCode()
          Returns an integer hash code for the receiver.
 TestGrouping removePackagesRecursive(String... packageNames)
          Exclude all tests in the given packages and all their sub-packages, unless otherwise specified.
 void setClassLoader(ClassLoader classLoader)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

testCaseClasses

SortedSet<Class<? extends TestCase>> testCaseClasses

SORT_BY_SIMPLE_NAME

public static final Comparator<Class<? extends TestCase>> SORT_BY_SIMPLE_NAME

SORT_BY_FULLY_QUALIFIED_NAME

public static final Comparator<Class<? extends TestCase>> SORT_BY_FULLY_QUALIFIED_NAME

firstIncludedPackage

protected String firstIncludedPackage
Constructor Detail

TestGrouping

public TestGrouping(Comparator<Class<? extends TestCase>> comparator)
Method Detail

getTests

public List<TestMethod> getTests()
Returns:
A list of all tests in the package, including small, medium, large, flaky, and suppressed tests. Includes sub-packages recursively.

getTestMethods

protected List<Method> getTestMethods(Class<? extends TestCase> testCaseClass)

getTestCaseClasses

SortedSet<Class<? extends TestCase>> getTestCaseClasses()

equals

public boolean equals(Object o)
Description copied from class: Object
Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison. The implementation in Object returns true only if the argument is the exact same object as the receiver (==).

Overrides:
equals in class Object
Parameters:
o - Object the object to compare with this object.
Returns:
boolean true if the object is the same as this object false if it is different from this object.
See Also:
Object.hashCode()

hashCode

public int hashCode()
Description copied from class: Object
Returns an integer hash code for the receiver. Any two objects which answer true when passed to .equals must answer the same value for this method.

Overrides:
hashCode in class Object
Returns:
int the receiver's hash.
See Also:
Object.equals(java.lang.Object)

addPackagesRecursive

public TestGrouping addPackagesRecursive(String... packageNames)
Include all tests in the given packages and all their sub-packages, unless otherwise specified. Each of the given packages must contain at least one test class, either directly or in a sub-package.

Parameters:
packageNames - Names of packages to add.
Returns:
The TestGrouping for method chaining.

removePackagesRecursive

public TestGrouping removePackagesRecursive(String... packageNames)
Exclude all tests in the given packages and all their sub-packages, unless otherwise specified.

Parameters:
packageNames - Names of packages to remove.
Returns:
The TestGrouping for method chaining.

getFirstIncludedPackage

public String getFirstIncludedPackage()
Returns:
The first package name passed to addPackagesRecursive(String[]), or null if that method was never called.

setClassLoader

public void setClassLoader(ClassLoader classLoader)

Build 1.0_r1(from source)

Please submit a feedback, bug or feature