ตั้งแต่ปี 2026 เป็นต้นไป เราจะเผยแพร่ซอร์สโค้ดไปยัง AOSP ในไตรมาสที่ 2 และ 4 เพื่อให้สอดคล้องกับโมเดลการพัฒนาแบบ Trunk Stable และรับประกันความเสถียรของแพลตฟอร์มสำหรับระบบนิเวศ หากต้องการสร้างและมีส่วนร่วมใน AOSP ให้ใช้ android-latest-release android-latest-release สาขา Manifest จะอ้างอิงถึงรุ่นล่าสุดที่พุชไปยัง AOSP เสมอ ดูข้อมูลเพิ่มเติมได้ที่การเปลี่ยนแปลงใน AOSP
Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
DeviceJUnit4ClassRunner.TestMetrics
public
static
class
DeviceJUnit4ClassRunner.TestMetrics
extends ExternalResource
| java.lang.Object
|
| ↳ |
org.junit.rules.ExternalResource
|
| |
↳ |
com.android.tradefed.testtype.DeviceJUnit4ClassRunner.TestMetrics
|
Implementation of ExternalResource and TestRule. This rule allows to log
metrics during a test case (inside @Test). It guarantees that the metrics map is cleaned
between tests, so the same rule object can be re-used.
Example:
@Rule
public TestMetrics metrics = new TestMetrics();
@Test
public void testFoo() {
metrics.addTestMetric("key", "value");
metrics.addTestMetric("key2", "value2");
}
@Test
public void testFoo2() {
metrics.addTestMetric("key3", "value3");
}
สรุป
เมธอดสาธารณะ |
void
|
addTestMetric(String key, MetricMeasurement.Metric metric)
Log a metric entry in proto format for the test case.
|
void
|
addTestMetric(String key, String value)
Log a metric entry for the test case.
|
Statement
|
apply(Statement base, Description description)
|
เครื่องมือสร้างสาธารณะ
TestMetrics
public TestMetrics ()
เมธอดสาธารณะ
addTestMetric
public void addTestMetric (String key,
MetricMeasurement.Metric metric)
Log a metric entry in proto format for the test case. Each key within a test case must be
unique otherwise it will override the previous value.
| พารามิเตอร์ |
key |
String: The key of the metric. |
metric |
MetricMeasurement.Metric: The value associated to the key. |
addTestMetric
public void addTestMetric (String key,
String value)
Log a metric entry for the test case. Each key within a test case must be unique
otherwise it will override the previous value.
| พารามิเตอร์ |
key |
String: The key of the metric. |
value |
String: The value associated to the key. |
ใช้
public Statement apply (Statement base,
Description description)
| พารามิเตอร์ |
base |
Statement |
description |
Description |
เมธอดที่ได้รับการปกป้อง
หลังจาก
protected void after ()
ก่อน
protected void before ()
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2026-06-22 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2026-06-22 UTC"],[],[]]