ResultDBUtil
public
final
class
ResultDBUtil
extends Object
| java.lang.Object | |
| ↳ | com.android.tradefed.result.resultdb.ResultDBUtil |
คลาสยูทิลิตีสำหรับเครื่องมือรายงาน ResultDB
สรุป
เครื่องมือสร้างสาธารณะ | |
|---|---|
ResultDBUtil()
|
|
เมธอดสาธารณะ | |
|---|---|
static
String
|
bytesToHex(byte[] bytes)
แปลงอาร์เรย์ไบต์เป็นสตริงฐานสิบหก |
static
String
|
makeValidKey(String key)
ตรวจสอบว่าคีย์ใช้ได้กับ ResultDB |
static
String
|
testSkipReasonToSummaryHtml(SkipReason reason, String skipReasonType)
แปลงเหตุผลในการข้ามการทดสอบเป็นสตริง HTML สรุป |
static
TestIdentifier
|
toTestIdentifier(String moduleName, Variant moduleVariant, TestDescription testDescription)
แปลง TestDescription เป็น TestIdentifier |
static
String
|
truncateString(String input, int maxBytes)
ตัดสตริงให้เหลือจำนวนไบต์สูงสุดที่ระบุ โดยไม่ตัดอักขระแบบหลายไบต์ |
เครื่องมือสร้างสาธารณะ
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 |
|
testSkipReasonToSummaryHtml
public static String testSkipReasonToSummaryHtml (SkipReason reason, String skipReasonType)
แปลงเหตุผลในการข้ามการทดสอบเป็นสตริง HTML สรุป ResultDB ยังไม่มีฟิลด์เหตุผลในการข้าม เราจึงใส่เหตุผลดังกล่าวในฟิลด์ HTML สรุปและอาร์ติแฟกต์การทดสอบในตอนนี้ สตริงการคืนค่า อาจยาวเกินขีดจำกัดของฟิลด์ HTML สรุป ผู้โทรควรตัดสตริงหากจำเป็น
| พารามิเตอร์ | |
|---|---|
reason |
SkipReason |
skipReasonType |
String |
| คิกรีเทิร์น | |
|---|---|
String |
|
toTestIdentifier
public static TestIdentifier toTestIdentifier (String moduleName,
Variant moduleVariant,
TestDescription testDescription)แปลง TestDescription เป็น TestIdentifier
| พารามิเตอร์ | |
|---|---|
moduleName |
String: ชื่อโมดูล |
moduleVariant |
Variant: รูปแบบโมดูล |
testDescription |
TestDescription: คำอธิบายการทดสอบ |
| คิกรีเทิร์น | |
|---|---|
TestIdentifier |
ตัวระบุการทดสอบ ResultDB เรารับประกันไม่ได้ว่าตัวระบุการทดสอบนี้จะถูกต้อง (เช่น ResultDB อาจปฏิเสธตัวระบุนี้และแสดงข้อผิดพลาด invalid_argument) เนื่องจาก ResultDB มีข้อกำหนดที่เข้มงวดกว่าเกี่ยวกับตัวระบุการทดสอบ เช่น ความยาวของฟิลด์ และชุดอักขระ |
truncateString
public static String truncateString (String input,
int maxBytes)ตัดสตริงให้เหลือจำนวนไบต์สูงสุดที่ระบุ โดยไม่ตัดอักขระแบบหลายไบต์
| พารามิเตอร์ | |
|---|---|
input |
String: สตริงที่จะตัดทอน |
maxBytes |
int: จำนวนไบต์สูงสุด (ในการเข้ารหัส utf-8) ที่จะตัด |
| คิกรีเทิร์น | |
|---|---|
String |
สตริงที่ถูกตัด |