Description du test

public final class TestDescription
extends Object

java.lang.Object
com.android.tradefed.result.TestDescription


Classe représentant des informations sur un scénario de test.

Résumé

Des champs

public static final Pattern PARAMETERIZED_TEST_REGEX

Regex pour la méthode paramétrée.

Constructeurs publics

TestDescription (String className, String testName)

Constructeur

TestDescription (String className, String testName, Annotation... annotations)

Constructeur

TestDescription (String className, String testName, annotations) TestDescription (String className, String testName, annotations)

Constructeur

Méthodes publiques

int compareTo ( TestDescription o)
static TestIdentifier convertToIdentifier ( TestDescription desc)

Créez un TestIdentifier à partir d'un TestDescription .

static TestDescription createFromTestIdentifier (TestIdentifier testId)

Créez un TestDescription à partir d'un TestIdentifier .

boolean equals (Object obj)
static TestDescription fromString (String data)

Créez une TestDescription à partir de sa représentation toString() }.

<T extends Annotation> T getAnnotation (Class<T> annotationType)
getAnnotations ()
String getClassName ()

Renvoie le nom de classe complet du test.

String getTestName ()

Renvoie le nom du test avec les paramètres, s'il s'agit d'un test paramétré.

String getTestNameWithoutParams ()

Renvoie le nom du test sans aucun paramètre (s'il s'agit d'une méthode paramétrée).

int hashCode ()
String toString ()

Des champs

PARAMETERIZED_TEST_REGEX

public static final Pattern PARAMETERIZED_TEST_REGEX

Regex pour la méthode paramétrée. Par exemple : nom_test[0]

Constructeurs publics

Description du test

public TestDescription (String className, 
                String testName)

Constructeur

Paramètres
className String : Le nom de la classe détenant le test.

testName String : Le nom du test (méthode).

Description du test

public TestDescription (String className, 
                String testName, 
                Annotation... annotations)

Constructeur

Paramètres
className String : Le nom de la classe détenant le test.

testName String : Le nom du test (méthode).

annotations Annotation : Liste des ERROR(/Annotation) associées au scénario de test.

Description du test

public TestDescription (String className, 
                String testName, 
                 annotations)

Constructeur

Paramètres
className String : Le nom de la classe détenant le test.

testName String : Le nom du test (méthode).

annotations : Collection d' ERROR(/Annotation) associée au scénario de test.

Méthodes publiques

comparer aux

public int compareTo (TestDescription o)

Paramètres
o TestDescription

Retour
int

convertirEnIdentifiant

public static TestIdentifier convertToIdentifier (TestDescription desc)

Créez un TestIdentifier à partir d'un TestDescription . Utile pour convertir une description pendant les tests.

Paramètres
desc TestDescription : La TestDescription à convertir.

Retour
TestIdentifier TestIdentifier créé avec les valeurs TestDescription.

createFromTestIdentifier

public static TestDescription createFromTestIdentifier (TestIdentifier testId)

Créez un TestDescription à partir d'un TestIdentifier . Utilisé pour faciliter la conversion de l’un à l’autre.

Paramètres
testId TestIdentifier : Le TestIdentifier à convertir.

Retour
TestDescription le TestDescription créé avec les valeurs TestIdentifier.

équivaut à

public boolean equals (Object obj)

Paramètres
obj Object

Retour
boolean

deChaîne

public static TestDescription fromString (String data)

Créez une TestDescription à partir de sa représentation toString() }.

Paramètres
data String : la représentation String. Format attendu : nom de classe#nom de méthode

Retour
TestDescription le TestDescription ou null s'il n'a pas pu être analysé

obtenirAnnotation

public T getAnnotation (Class<T> annotationType)

Paramètres
annotationType Class

Retour
T l'annotation de type annotationType qui est attachée à ce nœud de description, ou null s'il n'en existe pas

obtenirAnnotations

public  getAnnotations ()

Retour
toutes les annotations attachées à ce nœud de description

obtenirNomClasse

public String getClassName ()

Renvoie le nom de classe complet du test.

Retour
String

getTestName

public String getTestName ()

Renvoie le nom du test avec les paramètres, s'il s'agit d'un test paramétré. Renvoie le nom du test normal s'il ne s'agit pas d'un test paramétré.

Retour
String

getTestNameWithoutParams

public String getTestNameWithoutParams ()

Renvoie le nom du test sans aucun paramètre (s'il s'agit d'une méthode paramétrée).

Retour
String

Code de hachage

public int hashCode ()

Retour
int

versChaîne

public String toString ()

Retour
String