TestDescription

public final class TestDescription
extends Object

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


Klasa reprezentująca informacje o przypadku testowym.

Podsumowanie

Fieldsem

public static final Pattern PARAMETERIZED_TEST_REGEX

Wyrażenie regularne dla metody z parametrami.

Publiczne konstruktory

TestDescription(String className, String testName)

Zespół

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

Zespół

TestDescription(String className, String testName, annotations)

Zespół

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 element TestDescription na podstawie jego reprezentacji toString()}.

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

Zwraca pełną nazwę klasy testu.

String getTestName()

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

String getTestNameWithoutParams()

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

int hashCode()
String toString()

Fieldsem

PARAMETERIZED_TEST_REGEX

public static final Pattern PARAMETERIZED_TEST_REGEX

Wyrażenie regularne dla metody z parametrami. Przykład: testName[0]

Publiczne konstruktory

TestDescription

public TestDescription (String className, 
                String testName)

Zespół

Parametry
className String: nazwa klasy zawierającej test.

testName String: Nazwa testu (metody).

TestDescription

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

Zespół

Parametry
className String: nazwa klasy zawierającej test.

testName String: Nazwa testu (metody).

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

TestDescription

public TestDescription (String className, 
                String testName, 
                 annotations)

Zespół

Parametry
className String: nazwa klasy zawierającej test.

testName String: nazwa testu (metody).

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

Metody publiczne

compareTo

public int compareTo (TestDescription o)

Parametry
o TestDescription

Zwroty
int

convertToIdentifier

public static TestIdentifier convertToIdentifier (TestDescription desc)

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

Parametry
desc TestDescription: TestDescription do przekonwertowania.

Zwroty
TestIdentifier Utworzony TestIdentifier z wartościami TestDescription.

createFromTestIdentifier

public static TestDescription createFromTestIdentifier (TestIdentifier testId)

Utwórz TestDescription na podstawie TestIdentifier. Ułatwia to przeliczanie z jednej na drugą.

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

fromString

public static TestDescription fromString (String data)

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

Parametry
data String: reprezentacja w postaci ciągu znaków. Oczekiwany format: nazwa_klasy#nazwa_metody

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

getAnnotation

public T getAnnotation (Class<T> annotationType)

Parametry
annotationType Class

Zwroty
T adnotacja typu annotationType dołączona do tego węzła opisu lub wartość null, jeśli nie istnieje.

getAnnotations

public  getAnnotations ()

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

getClassName

public String getClassName ()

Zwraca pełną nazwę klasy testu.

Zwroty
String

getTestName

public String getTestName ()

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

Zwroty
String

getTestNameWithoutParams

public String getTestNameWithoutParams ()

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

Zwroty
String

hashCode

public int hashCode ()

Zwroty
int

toString

public String toString ()

Zwroty
String