TestDescription

public final class TestDescription
extends Object implements Comparable<TestDescription>, Serializable

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


Classe che rappresenta le informazioni su uno scenario 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, Collection<Annotation> 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 un TestDescription dalla sua rappresentazione toString().

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

Restituisce il nome di classe completo del test.

String getTestName()

Restituisce il nome del test con i parametri, se si tratta di un test parametrizzato.

String getTestNameWithoutParams()

Restituisce il nome del test senza parametri (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 il metodo parametrizzato. Ad esempio: testName[0]

Costruttori pubblici

TestDescription

public TestDescription (String className, 
                String testName)

Costruttore

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

testName String: il nome del test (metodo).

TestDescription

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

Costruttore

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

testName String: il nome del test (metodo).

annotations Annotation: elenco di Annotation associati allo scenario di test.

TestDescription

public TestDescription (String className, 
                String testName, 
                Collection<Annotation> annotations)

Costruttore

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

testName String: il nome del test (metodo).

annotations Collection: raccolta di Annotation associati allo scenario di test.

Metodi pubblici

compareTo

public int compareTo (TestDescription o)

Parametri
o TestDescription

Resi
int

convertToIdentifier

public static TestIdentifier convertToIdentifier (TestDescription desc)

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

Parametri
desc TestDescription: il TestDescription da convertire.

Resi
TestIdentifier Il 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 un'unità all'altra.

Parametri
testId TestIdentifier: il TestIdentifier da convertire.

Resi
TestDescription il TestDescription creato con i valori TestIdentifier.

uguale a

public boolean equals (Object obj)

Parametri
obj Object

Resi
boolean

fromString

public static TestDescription fromString (String data)

Crea un TestDescription dalla sua rappresentazione toString().

Parametri
data String: la rappresentazione della stringa. Formato previsto: classname#methodname

Resi
TestDescription TestDescription o null se non è stato possibile analizzarlo

getAnnotation

public T getAnnotation (Class<T> annotationType)

Parametri
annotationType Class

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

getAnnotations

public Collection<Annotation> getAnnotations ()

Resi
Collection<Annotation> tutte le annotazioni associate a questo nodo di descrizione

getClassName

public String getClassName ()

Restituisce il nome di classe completo del test.

Resi
String

getTestName

public String getTestName ()

Restituisce il nome del test con i parametri, se si tratta di un test parametrizzato. Restituisce il nome del test normale se non si tratta di un test parametrico.

Resi
String

getTestNameWithoutParams

public String getTestNameWithoutParams ()

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

Resi
String

hashCode

public int hashCode ()

Resi
int

toString

public String toString ()

Resi
String