TestDescription

public final class TestDescription
extends Object

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


テストケースに関する情報を表すクラス。

概要

フィールド

public static final Pattern PARAMETERIZED_TEST_REGEX

メソッドのパラメータ化の正規表現。

パブリック コンストラクタ

TestDescription(String className, String testName)

コンストラクタ

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

コンストラクタ

TestDescription(String className, String testName, annotations)

コンストラクタ

パブリック メソッド

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

TestDescription から TestIdentifier を作成します。

static TestDescription createFromTestIdentifier(TestIdentifier testId)

TestIdentifier から TestDescription を作成します。

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

toString()} 表現から TestDescription を作成します。

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

テストの完全修飾クラス名を返します。

String getTestName()

パラメータ化されたテストの場合は、パラメータを含むテストの名前を返します。

String getTestNameWithoutParams()

パラメータなしのテストの名前を返します(パラメータ化されたメソッドの場合)。

int hashCode()
String toString()

フィールド

PARAMETERIZED_TEST_REGEX

public static final Pattern PARAMETERIZED_TEST_REGEX

メソッドのパラメータ化の正規表現。例: testName[0]

パブリック コンストラクタ

TestDescription

public TestDescription (String className, 
                String testName)

コンストラクタ

パラメータ
className String: テストを保持するクラスの名前。

testName String: テスト(メソッド)の名前。

TestDescription

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

コンストラクタ

パラメータ
className String: テストを保持するクラスの名前。

testName String: テスト(メソッド)の名前。

annotations Annotation: テストケースに関連付けられた ERROR(/Annotation) のリスト。

TestDescription

public TestDescription (String className, 
                String testName, 
                 annotations)

コンストラクタ

パラメータ
className String: テストを保持するクラスの名前。

testName String: テスト(メソッド)の名前。

annotations : テストケースに関連付けられた ERROR(/Annotation) のコレクション。

パブリック メソッド

compareTo

public int compareTo (TestDescription o)

パラメータ
o TestDescription

戻り値
int

convertToIdentifier

public static TestIdentifier convertToIdentifier (TestDescription desc)

TestDescription から TestIdentifier を作成します。テスト中に説明を変換する場合に便利です。

パラメータ
desc TestDescription: 変換する TestDescription

戻り値
TestIdentifier TestDescription 値を含む作成された TestIdentifier

createFromTestIdentifier

public static TestDescription createFromTestIdentifier (TestIdentifier testId)

TestIdentifier から TestDescription を作成します。変換を容易にするために使用されます。

パラメータ
testId TestIdentifier: 変換する TestIdentifier

戻り値
TestDescription TestIdentifier 値を含む作成された TestDescription

equals

public boolean equals (Object obj)

パラメータ
obj Object

戻り値
boolean

fromString

public static TestDescription fromString (String data)

toString()} 表現から TestDescription を作成します。

パラメータ
data String: 文字列表現。適切な形式: classname#methodname

戻り値
TestDescription 解析できなかった場合は TestDescription または null

getAnnotation

public T getAnnotation (Class<T> annotationType)

パラメータ
annotationType Class

戻り値
T この説明ノードに付加された annotationType 型のアノテーション。存在しない場合は null

getAnnotations

public  getAnnotations ()

戻り値
この説明ノードに付加されているすべてのアノテーション

getClassName

public String getClassName ()

テストの完全修飾クラス名を返します。

戻り値
String

getTestName

public String getTestName ()

パラメータ化されたテストの場合は、パラメータを含むテストの名前を返します。パラメータ化テストでない場合は、通常のテスト名を返します。

戻り値
String

getTestNameWithoutParams

public String getTestNameWithoutParams ()

パラメータなしでテストの名前を返します(パラメータ化されたメソッドの場合)。

戻り値
String

hashCode

public int hashCode ()

戻り値
int

toString

public String toString ()

戻り値
String