คำอธิบายการทดสอบ

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

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, Collection<Annotation> annotations)

เครื่องมือสร้าง

เมธอดสาธารณะ

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

สร้าง TestIdentifier จาก TestDescription

static TestDescription createFromTestIdentifier(TestIdentifier testId)

สร้าง TestDescription จาก TestIdentifier

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

สร้าง TestDescription จากการแสดง toString()}

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

แสดงผลชื่อคลาสที่สมบูรณ์ของแบบทดสอบ

String getTestName()

แสดงชื่อของการทดสอบพร้อมพารามิเตอร์ หากเป็นการทดสอบที่กำหนดพารามิเตอร์

String getTestNameWithoutParams()

แสดงชื่อของการทดสอบโดยไม่มีพารามิเตอร์ (หากเป็นการทดสอบแบบพารามิเตอร์)

int hashCode()
String toString()

ทุ่ง

PARAMETERIZED_TEST_REGEX

public static final Pattern PARAMETERIZED_TEST_REGEX

นิพจน์ทั่วไปสำหรับเมธอดที่มีการกำหนดพารามิเตอร์ เช่น testName[0]

เครื่องมือสร้างสาธารณะ

คำอธิบายการทดสอบ

public TestDescription (String className, 
                String testName)

เครื่องมือสร้าง

พารามิเตอร์
className String: ชื่อชั้นเรียนที่จัดสอบ

testName String: ชื่อการทดสอบ (เมธอด)

คำอธิบายการทดสอบ

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

เครื่องมือสร้าง

พารามิเตอร์
className String: ชื่อชั้นเรียนที่จัดสอบ

testName String: ชื่อการทดสอบ (เมธอด)

annotations Annotation: รายการ Annotation ที่เชื่อมโยงกับกรณีทดสอบ

คำอธิบายการทดสอบ

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

เครื่องมือสร้าง

พารามิเตอร์
className String: ชื่อชั้นเรียนที่จัดสอบ

testName String: ชื่อการทดสอบ (เมธอด)

annotations Collection: คอลเล็กชันของ Annotation ที่เชื่อมโยงกับกรณีทดสอบ

เมธอดสาธารณะ

compareTo

public int compareTo (TestDescription o)

พารามิเตอร์
o TestDescription

การคืนสินค้า
int

convertToIdentifier

public static TestIdentifier convertToIdentifier (TestDescription desc)

สร้าง TestIdentifier จาก TestDescription มีประโยชน์ในการแปลงคำอธิบาย ระหว่างการทดสอบ

พารามิเตอร์
desc TestDescription: TestDescription ที่จะแปลง

การคืนสินค้า
TestIdentifier TestIdentifierที่สร้างขึ้นพร้อมค่า TestDescription

createFromTestIdentifier

public static TestDescription createFromTestIdentifier (TestIdentifier testId)

สร้าง TestDescription จาก TestIdentifier ใช้เพื่อความสะดวกในการแปลง จากรูปแบบหนึ่งไปยังอีกรูปแบบหนึ่ง

พารามิเตอร์
testId TestIdentifier: TestIdentifier ที่จะแปลง

การคืนสินค้า
TestDescription TestDescription ที่สร้างขึ้นพร้อมค่า TestIdentifier

เท่ากับ

public boolean equals (Object obj)

พารามิเตอร์
obj Object

การคืนสินค้า
boolean

fromString

public static TestDescription fromString (String data)

สร้าง TestDescription จากการแสดง toString()}

พารามิเตอร์
data String: การแสดงสตริง รูปแบบที่คาดไว้: classname#methodname

การคืนสินค้า
TestDescription TestDescription หรือ null หากแยกวิเคราะห์ไม่ได้

getAnnotation

public T getAnnotation (Class<T> annotationType)

พารามิเตอร์
annotationType Class

การคืนสินค้า
T คำอธิบายประกอบประเภท annotationType ที่แนบมากับโหนดคำอธิบายนี้ หรือ null หากไม่มี

getAnnotations

public Collection<Annotation> getAnnotations ()

การคืนสินค้า
Collection<Annotation> คำอธิบายประกอบทั้งหมดที่แนบกับโหนดคำอธิบายนี้

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