MetricTestCase
public class MetricTestCase
extends TestCase
java.lang.Object | |||
. | junit.framework.ยืนยัน | ||
. | junit.framework.TestCase | ||
. | com.android.tradefed.testtype.MetricTestCase |
ส่วนขยายของ TestCase
ที่อนุญาตให้บันทึกเมตริกเมื่อทำงานเป็นส่วนหนึ่งของ TradeFed ไม่ว่าจะโดยตรงในฐานะ DeviceTestCase
หรือเป็นส่วนหนึ่งของ HostTest
สิ่งที่ต้องทำ: ประเมินว่าการรันเมทริก (ไม่ใช่แค่เมทริกซ์ทดสอบ) เหมาะสมสำหรับการทดสอบ JUnit3 หรือไม่
สรุป
คลาสที่ซ้อนกัน | |
---|---|
class | MetricTestCase.LogHolder โครงสร้างการถือล็อกไฟล์ที่จะรายงาน |
ทุ่งนา | |
---|---|
public | mLogs |
public | mMetrics
|
ผู้สร้างสาธารณะ | |
---|---|
MetricTestCase () | |
MetricTestCase (String name) สร้างกรณีทดสอบด้วยชื่อที่กำหนด |
วิธีการสาธารณะ | |
---|---|
final void | addTestLog (String dataName, LogDataType dataType, InputStreamSource dataStream) โทรกลับจากผู้ส่งต่อ JUnit3 เพื่อรับบันทึกจากการทดสอบ |
final void | addTestMetric (String key, MetricMeasurement.Metric metric) |
final void | addTestMetric (String key, String value) บันทึกเมตริกสำหรับกรณีทดสอบ |
ทุ่งนา
mLogs
publicmLogs
mMetrics
publicmMetrics
ผู้สร้างสาธารณะ
MetricTestCase
public MetricTestCase ()
MetricTestCase
public MetricTestCase (String name)
สร้างกรณีทดสอบที่มีชื่อที่กำหนด สืบทอดมาจากตัวสร้าง TestCase
พารามิเตอร์ | |
---|---|
name | String |
วิธีการสาธารณะ
addTestLog
public final void addTestLog (String dataName, LogDataType dataType, InputStreamSource dataStream)
โทรกลับจากผู้ส่งต่อ JUnit3 เพื่อรับบันทึกจากการทดสอบ
พารามิเตอร์ | |
---|---|
dataName | String : ชื่อคำอธิบายสตริงของข้อมูล เช่น "device_logcat" หมายเหตุ dataName อาจไม่ซ้ำกันต่อการเรียกใช้แต่ละครั้ง กล่าวคือ ผู้ดำเนินการต้องสามารถจัดการการโทรหลายครั้งด้วย dataName . เดียวกัน |
dataType | LogDataType : LogDataType ของข้อมูล |
dataStream | InputStreamSource : InputStreamSource ของข้อมูล ผู้ดำเนินการควรเรียก createInputStream เพื่อเริ่มอ่านข้อมูล และตรวจสอบให้แน่ใจว่าได้ปิด InputStream ที่เป็นผลลัพธ์เมื่อเสร็จสิ้น ผู้โทรควรตรวจสอบให้แน่ใจว่าแหล่งข้อมูลยังคงมีอยู่และสามารถเข้าถึงได้จนกว่าวิธี testLog จะเสร็จสิ้น |
addTestMetric
public final void addTestMetric (String key, MetricMeasurement.Metric metric)
พารามิเตอร์ | |
---|---|
key | String |
metric | MetricMeasurement.Metric |
addTestMetric
public final void addTestMetric (String key, String value)
บันทึกเมตริกสำหรับกรณีทดสอบ
พารามิเตอร์ | |
---|---|
key | String : คีย์ที่จะพบเมตริก |
value | String : เชื่อมโยงกับคีย์ |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2022-08-15 UTC.