TestDescription

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

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


Klasa reprezentująca informacje o przypadku testowym.

Podsumowanie

Pola

public static final Pattern PARAMETERIZED_TEST_REGEX

Wyrażenie regularne dla metody z parametrami.

Konstruktory publiczne

TestDescription(String className, String testName)

Konstruktor

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

Konstruktor

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

Konstruktor

Metody publiczne

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

Utwórz TestIdentifier z TestDescription.

static TestDescription createFromTestIdentifier(TestIdentifier testId)

Utwórz TestDescription z TestIdentifier.

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

Utwórz TestDescription z jego reprezentacji toString()}.

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

Zwraca pełną i jednoznaczną 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()

Pola

PARAMETERIZED_TEST_REGEX

public static final Pattern PARAMETERIZED_TEST_REGEX

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

Konstruktory publiczne

TestDescription

public TestDescription (String className, 
                String testName)

Konstruktor

Parametry
className String: nazwa klasy zawierającej test.

testName String: Nazwa testu (metody).

TestDescription

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

Konstruktor

Parametry
className String: nazwa klasy zawierającej test.

testName String: Nazwa testu (metody).

annotations Annotation: lista Annotation powiązanych z elementem testowania.

TestDescription

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

Konstruktor

Parametry
className String: nazwa klasy zawierającej test.

testName String: Nazwa testu (metody).

annotations Collection: zbiór Annotation powiązanych z elementem testowania.

Metody publiczne

compareTo

public int compareTo (TestDescription o)

Parametry
o TestDescription

Zwraca
int

convertToIdentifier

public static TestIdentifier convertToIdentifier (TestDescription desc)

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

Parametry
desc TestDescription: TestDescription do przekonwertowania.

Zwraca
TestIdentifier Utworzony TestIdentifier z wartościami TestDescription.

createFromTestIdentifier

public static TestDescription createFromTestIdentifier (TestIdentifier testId)

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

Parametry
testId TestIdentifier: TestIdentifier do przekonwertowania.

Zwraca
TestDescription utworzony TestDescription z wartościami TestIdentifier.

równa się

public boolean equals (Object obj)

Parametry
obj Object

Zwraca
boolean

fromString

public static TestDescription fromString (String data)

Utwórz TestDescription z jego reprezentacji toString()}.

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

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

getAnnotation

public T getAnnotation (Class<T> annotationType)

Parametry
annotationType Class

Zwraca
T adnotacja typu annotationType, która jest dołączona do tego węzła opisu, lub wartość null, jeśli nie istnieje żadna adnotacja.

getAnnotations

public Collection<Annotation> getAnnotations ()

Zwraca
Collection<Annotation> wszystkie adnotacje dołączone do tego węzła opisu,

getClassName

public String getClassName ()

Zwraca pełną i jednoznaczną nazwę klasy testu.

Zwraca
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 sparametryzowany.

Zwraca
String

getTestNameWithoutParams

public String getTestNameWithoutParams ()

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

Zwraca
String

hashCode

public int hashCode ()

Zwraca
int

toString

public String toString ()

Zwraca
String