Opis testu

public final class TestDescription
extends Object

Obiekt Java.lang.Object
com.android.tradefed.result.TestDescription


Klasa reprezentująca informacje o przypadku testowym.

Streszczenie

Pola

public static final Pattern PARAMETERIZED_TEST_REGEX

Regex dla metody sparametryzowanej.

Konstruktorzy publiczni

TestDescription (String className, String testName)

Konstruktor

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

Konstruktor

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

Konstruktor

Metody publiczne

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

Utwórz TestIdentifier na podstawie TestDescription .

static TestDescription createFromTestIdentifier (TestIdentifier testId)

Utwórz TestDescription na podstawie TestIdentifier .

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

Utwórz TestDescription na podstawie jego reprezentacji toString() }.

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

Zwraca w pełni kwalifikowaną nazwę klasy testu.

String getTestName ()

Zwraca nazwę testu z parametrami, jeśli jest to test sparametryzowany.

String getTestNameWithoutParams ()

Zwraca nazwę testu bez żadnych parametrów (jeśli jest to metoda sparametryzowana).

int hashCode ()
String toString ()

Pola

PARAMETERIZED_TEST_REGEX

public static final Pattern PARAMETERIZED_TEST_REGEX

Regex dla metody sparametryzowanej. Na przykład: nazwa_testu[0]

Konstruktorzy publiczni

Opis testu

public TestDescription (String className, 
                String testName)

Konstruktor

Parametry
className String : Nazwa klasy przechowującej test.

testName String : nazwa testu (metody).

Opis testu

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

Konstruktor

Parametry
className String : Nazwa klasy przechowującej test.

testName String : nazwa testu (metody).

annotations Annotation : Lista ERROR(/Annotation) powiązanych z przypadkiem testowym.

Opis testu

public TestDescription (String className, 
                String testName, 
                 annotations)

Konstruktor

Parametry
className String : Nazwa klasy przechowującej test.

testName String : nazwa testu (metody).

annotations : Zbiór ERROR(/Annotation) powiązanych z przypadkiem testowym.

Metody publiczne

porównać do

public int compareTo (TestDescription o)

Parametry
o TestDescription

Zwroty
int

konwertuj na identyfikator

public static TestIdentifier convertToIdentifier (TestDescription desc)

Utwórz TestIdentifier na podstawie TestDescription . Przydatne do konwersji opisu podczas testowania.

Parametry
desc TestDescription : TestDescription do konwersji.

Zwroty
TestIdentifier Utworzony TestIdentifier z wartościami TestDescription.

utwórzFromTestIdentifier

public static TestDescription createFromTestIdentifier (TestIdentifier testId)

Utwórz TestDescription na podstawie TestIdentifier . Służy do ułatwienia konwersji z jednego na drugi.

Parametry
testId TestIdentifier : TestIdentifier do przekonwertowania.

Zwroty
TestDescription utworzony TestDescription z wartościami TestIdentifier.

równa się

public boolean equals (Object obj)

Parametry
obj Object

Zwroty
boolean

z ciągu

public static TestDescription fromString (String data)

Utwórz TestDescription na podstawie jego reprezentacji toString() }.

Parametry
data String : reprezentacja ciągu. Oczekiwany format: nazwa klasy#nazwa metody

Zwroty
TestDescription TestDescription lub null, jeśli nie można go przeanalizować

pobierz adnotację

public T getAnnotation (Class<T> annotationType)

Parametry
annotationType Class

Zwroty
T adnotacja typu annotationType, która jest dołączona do tego węzła opisu, lub null, jeśli żaden nie istnieje

pobierzAdnotacje

public  getAnnotations ()

Zwroty
wszystkie adnotacje dołączone do tego węzła opisu

pobierzNazwęKlasy

public String getClassName ()

Zwraca w pełni kwalifikowaną nazwę klasy testu.

Zwroty
String

pobierzNazwęTestu

public String getTestName ()

Zwraca nazwę testu z parametrami, jeśli jest to test sparametryzowany. Zwraca zwykłą nazwę testu, jeśli nie jest to test sparametryzowany.

Zwroty
String

getNazwaTestuBez Paramów

public String getTestNameWithoutParams ()

Zwraca nazwę testu bez żadnych parametrów (jeśli jest to metoda sparametryzowana).

Zwroty
String

hashCode

public int hashCode ()

Zwroty
int

doString

public String toString ()

Zwroty
String