Descrizione del testo

public final class TestDescription
extends Object

java.lang.Object
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 il 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 una 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 è un test parametrizzato.

String getTestNameWithoutParams ()

Restituisce il nome del test senza parametri (se è un metodo con parametri).

int hashCode ()
String toString ()

Campi

PARAMETERIZED_TEST_REGEX

public static final Pattern PARAMETERIZED_TEST_REGEX

Regex per il metodo parametrizzato. Ad esempio: testName[0]

Costruttori pubblici

Descrizione del testo

public TestDescription (String className, 
                String testName)

Costruttore

Parametri
className String : il nome della classe che sostiene 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 sostiene il test.

testName String : il nome del test (metodo).

annotations Annotation : elenco di ERROR(/Annotation) associati al caso di test.

Descrizione del testo

public TestDescription (String className, 
                String testName, 
                 annotations)

Costruttore

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

testName String : il nome del test (metodo).

annotations : Raccolta di ERROR(/Annotation) associati 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 : la TestDescription da convertire.

ritorna
TestIdentifier Il TestIdentifier creato con i valori TestDescription.

createFromTestIdentifier

public static TestDescription createFromTestIdentifier (TestIdentifier testId)

Crea una TestDescription da un TestIdentifier . Utilizzato per facilitare la conversione dall'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

daString

public static TestDescription fromString (String data)

Crea una TestDescription dalla sua rappresentazione toString() }.

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

ritorna
TestDescription il TestDescription o null se non è stato possibile analizzarlo

getAnnotazione

public T getAnnotation (Class<T> annotationType)

Parametri
annotationType Class

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

getAnnotations

public  getAnnotations ()

ritorna
tutte le annotazioni allegate a questo nodo descrittivo

getClassName

public String getClassName ()

Restituisce il nome completo della classe del test.

ritorna
String

getNomeTest

public String getTestName ()

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

ritorna
String

getNomeTestSenzaParams

public String getTestNameWithoutParams ()

Restituisce il nome del test senza parametri (se è un metodo con parametri).

ritorna
String

codice hash

public int hashCode ()

ritorna
int

accordare

public String toString ()

ritorna
String