ResultDBUtil
public
final
class
ResultDBUtil
extends Object
| java.lang.Object | |
| ↳ | com.android.tradefed.result.resultdb.ResultDBUtil |
คลาสยูทิลิตีสำหรับเครื่องมือรายงาน ResultDB
สรุป
คลาสที่ซ้อนกัน | |
|---|---|
class |
ResultDBUtil.TruncationResult
คลาสอย่างง่ายสำหรับเก็บผลลัพธ์ของการดำเนินการตัดทอน |
ค่าคงที่ | |
|---|---|
String |
NO_MODULE_NAME
|
เครื่องมือสร้างสาธารณะ | |
|---|---|
ResultDBUtil()
|
|
เมธอดสาธารณะ | |
|---|---|
static
String
|
bytesToHex(byte[] bytes)
แปลงอาร์เรย์ไบต์เป็นสตริงฐานสิบหก |
static
String
|
makeValidKey(String key)
ตรวจสอบว่าคีย์ใช้ได้กับ ResultDB |
static
String
|
makeWorkUnitName(String rootInvocationId, String workUnitId)
สร้างชื่อทรัพยากรหน่วยงานจากรหัสการเรียกใช้รูทและรหัสหน่วยงาน |
static
StringPair
|
primaryErrorTypeTag(TestRecordProto.FailureStatus failureStatus)
แสดงผล StringPair ที่ใช้บันทึกประเภทข้อผิดพลาดในคอลเล็กชัน `tags` ได้ |
static
TestIdentifier
|
toTestIdentifier(ModuleIdentifier moduleIdentifier, TestDescription testDescription)
แปลง TestDescription เป็น TestIdentifier |
static
ResultDBUtil.TruncationResult
|
truncateString(String input, int maxBytes)
ตัดสตริงให้มีความยาวไม่เกินจำนวนไบต์สูงสุดที่ระบุ โดยไม่ตัดอักขระแบบหลายไบต์ |
ค่าคงที่
NO_MODULE_NAME
public static final String NO_MODULE_NAME
ค่าคงที่: "no-module-name"
เครื่องมือสร้างสาธารณะ
ResultDBUtil
public ResultDBUtil ()
เมธอดสาธารณะ
bytesToHex
public static String bytesToHex (byte[] bytes)
แปลงอาร์เรย์ไบต์เป็นสตริงฐานสิบหก
| พารามิเตอร์ | |
|---|---|
bytes |
byte |
| การคืนสินค้า | |
|---|---|
String |
|
makeValidKey
public static String makeValidKey (String key)
ตรวจสอบว่าคีย์ใช้ได้กับ ResultDB
คีย์ต้องตรงกับนิพจน์ทั่วไป: ^[a-z][a-z0-9_]*(/[a-z][a-z0-9_]*)*$
| พารามิเตอร์ | |
|---|---|
key |
String |
| การคืนสินค้า | |
|---|---|
String |
|
makeWorkUnitName
public static String makeWorkUnitName (String rootInvocationId,
String workUnitId)สร้างชื่อทรัพยากรหน่วยงานจากรหัสการเรียกใช้รูทและรหัสหน่วยงาน
| พารามิเตอร์ | |
|---|---|
rootInvocationId |
String: รหัสการเรียกใช้รูท |
workUnitId |
String: รหัสหน่วยงาน |
| การคืนสินค้า | |
|---|---|
String |
ชื่อทรัพยากรของหน่วยงาน |
primaryErrorTypeTag
public static StringPair primaryErrorTypeTag (TestRecordProto.FailureStatus failureStatus)
แสดงผล StringPair ที่ใช้บันทึกประเภทข้อผิดพลาดในคอลเล็กชัน `tags` ได้ ค่า ตรงกับค่าประเภทข้อผิดพลาดของ AnTS
| พารามิเตอร์ | |
|---|---|
failureStatus |
TestRecordProto.FailureStatus |
| การคืนสินค้า | |
|---|---|
StringPair |
|
toTestIdentifier
public static TestIdentifier toTestIdentifier (ModuleIdentifier moduleIdentifier,
TestDescription testDescription)แปลง TestDescription เป็น TestIdentifier
| พารามิเตอร์ | |
|---|---|
moduleIdentifier |
ModuleIdentifier |
testDescription |
TestDescription: คำอธิบายการทดสอบ |
| การคืนสินค้า | |
|---|---|
TestIdentifier |
ตัวระบุการทดสอบ ResultDB เรารับประกันไม่ได้ว่าตัวระบุการทดสอบนี้จะถูกต้อง (เช่น ResultDB อาจปฏิเสธตัวระบุนี้และแสดงข้อผิดพลาด invalid_argument) เนื่องจาก ResultDB มีข้อกำหนดที่เข้มงวดกว่าเกี่ยวกับตัวระบุการทดสอบ เช่น ความยาวของฟิลด์ และชุดอักขระ |
truncateString
public static ResultDBUtil.TruncationResult truncateString (String input, int maxBytes)
ตัดสตริงให้มีความยาวไม่เกินจำนวนไบต์สูงสุดที่ระบุ โดยไม่ตัดอักขระแบบหลายไบต์
| พารามิเตอร์ | |
|---|---|
input |
String: สตริงที่จะตัดทอน |
maxBytes |
int: จำนวนไบต์สูงสุด (ในการเข้ารหัส utf-8) ที่จะตัด |
| การคืนสินค้า | |
|---|---|
ResultDBUtil.TruncationResult |
TruncationResult ที่มีสตริงที่ถูกตัดทอนและบูลีนที่ระบุ
ว่ามีการตัดทอนหรือไม่ |