Descrizione del testo

public final class TestDescription
extends Object

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


Classe che rappresenta le informazioni su un caso di test.

Riepilogo

Campi

public static final Pattern PARAMETERIZED_TEST_REGEX

Regex per metodo parametrizzato.

Costruttori pubblici

TestDescription (String className, String testName)

Costruttore

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

Costruttore

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

Costruttore

Metodi pubblici

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

Crea un TestIdentifier da un TestDescription .

static TestDescription createFromTestIdentifier (TestIdentifier testId)

Crea un TestDescription da un TestIdentifier .

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

Crea una TestDescription dalla sua rappresentazione toString() }.

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

Restituisce il nome completo della classe del test.

String getTestName ()

Restituisce il nome del test con i parametri, se è test parametrico.

String getTestNameWithoutParams ()

Restituisce il nome del test senza alcun parametro (se si tratta di un metodo con parametri).

int hashCode ()
String toString ()

Campi

PARAMETERIZED_TEST_REGEX

public static final Pattern PARAMETERIZED_TEST_REGEX

Regex per metodo parametrizzato. Ad esempio: NomeProva[0]

Costruttori pubblici

Descrizione del testo

public TestDescription (String className, 
                String testName)

Costruttore

Parametri
className String : il nome della classe che tiene il test.

testName String : il nome del test (metodo).

Descrizione del testo

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

Costruttore

Parametri
className String : il nome della classe che tiene il test.

testName String : il nome del test (metodo).

annotations Annotation : Elenco di ERROR(/Annotation) associato al test case.

Descrizione del testo

public TestDescription (String className, 
                String testName, 
                 annotations)

Costruttore

Parametri
className String : il nome della classe che tiene il test.

testName String : il nome del test (metodo).

annotations : Raccolta di ERROR(/Annotation) associata al test case.

Metodi pubblici

Paragonare a

public int compareTo (TestDescription o)

Parametri
o TestDescription

ritorna
int

convertToIdentifier

public static TestIdentifier convertToIdentifier (TestDescription desc)

Crea un TestIdentifier da un TestDescription . Utile per convertire una descrizione durante il test.

Parametri
desc TestDescription : oggetto TestDescription da convertire.

ritorna
TestIdentifier Oggetto TestIdentifier creato con i valori TestDescription.

createFromTestIdentifier

public static TestDescription createFromTestIdentifier (TestIdentifier testId)

Crea un TestDescription da un TestIdentifier . Utilizzato per facilitare la conversione da uno all'altro.

Parametri
testId TestIdentifier : il TestIdentifier da convertire.

ritorna
TestDescription la TestDescription creata con i valori TestIdentifier.

equivale

public boolean equals (Object obj)

Parametri
obj Object

ritorna
boolean

fromString

public static TestDescription fromString (String data)

Crea una TestDescription dalla sua rappresentazione toString() }.

Parametri
data String : la rappresentazione String. Formato previsto: nomeclasse#nomemetodo

ritorna
TestDescription TestDescription o null se non è stato possibile analizzarlo

getAnnotation

public T getAnnotation (Class<T> annotationType)

Parametri
annotationType Class

ritorna
T l'annotazione di tipo annotationType collegata a questo nodo di descrizione oppure null se non esiste

getAnnotations

public  getAnnotations ()

ritorna
tutte le annotazioni allegate a questo nodo di descrizione

getClassName

public String getClassName ()

Restituisce il nome completo della classe del test.

ritorna
String

getTestName

public String getTestName ()

Restituisce il nome del test con i parametri, se è test parametrico. Restituisce il nome del test normale se non è un test con parametri.

ritorna
String

getTestNameWithoutParams

public String getTestNameWithoutParams ()

Restituisce il nome del test senza alcun parametro (se si tratta di un metodo con parametri).

ritorna
String

codice hash

public int hashCode ()

ritorna
int

accordare

public String toString ()

ritorna
String