LogAssociation

public class LogAssociation
extends Object

java.lang.Object
   ↳ com.google.android.tradefed.result.teststorage.LogAssociation


代表記錄檔與測試之間連結的類別。關聯性代表特定記錄檔是由特定測試所建立。

摘要

公用建構函式

LogAssociation(Invocation invocation, String workUnitId, TestResult testResult, long legacyResultId, LogFile log)

為記錄檔建立關聯。

公用方法

boolean equals(Object o)
String getAttemptId()

傳回嘗試 ID,這是上傳 v2 記錄檔時的必要項目。

String getBuildId()

傳回建構 ID。

String getBuildTarget()

傳回建構目標的名稱。

String getBuildType()

傳回建構類型。

String getInvocationId()
long getLegacyResultId()

傳回用於上傳記錄的舊版結果 ID。

LogFile getLog()
String getResourceId()

傳回記錄的資源 ID,這個 ID 會在這個特定呼叫中,單獨識別遠端伺服器上的記錄。

String getTestResultId()
String getWorkUnitId()
int hashCode()
boolean isSupported()

如果這個項目支援記錄關聯,則傳回 true。

String toString()

公用建構函式

LogAssociation

public LogAssociation (Invocation invocation, 
                String workUnitId, 
                TestResult testResult, 
                long legacyResultId, 
                LogFile log)

為記錄檔建立關聯。記錄檔可與個別測試、測試執行作業或模組建立關聯。如果記錄與測試相關聯,則必須提供該測試的 TestReseult 物件。否則請只提供呼叫和工作單元。

參數
invocation Invocation:記錄檔所屬的叫用。

workUnitId String:工作單元 ID,代表產生記錄的測試階段。

testResult TestResult:如果記錄是由測試產生,則為代表該測試的 testResult 物件。

legacyResultId long

log LogFile:需要建立關聯的記錄檔。

公用方法

等於

public boolean equals (Object o)

參數
o Object

傳回
boolean

getAttemptId

public String getAttemptId ()

傳回嘗試 ID,這是上傳 v2 記錄檔時的必要項目。

傳回
String

getBuildId

public String getBuildId ()

傳回建構 ID。上傳第 2 版記錄時需要建構資訊,因此必須提供這項資訊。

傳回
String

getBuildTarget

public String getBuildTarget ()

傳回建構目標的名稱。上傳第 2 版記錄檔時必須提供這項資訊。

傳回
String

getBuildType

public String getBuildType ()

傳回建構類型。上傳 v2 記錄時必須提供建構資訊,因此請務必提供。V3 不需要這項資訊,因為呼叫中已提供相關資訊。

傳回
String

getInvocationId

public String getInvocationId ()

傳回
String

getLegacyResultId

public long getLegacyResultId ()

傳回用於上傳記錄的舊版結果 ID。為確保回溯相容性,系統會使用 API 的 V2 版本上傳記錄,這需要舊版結果 ID。上傳記錄後,我們會使用 v3 API,透過叫用 ID 和工作單元 ID 建立關聯,但我們仍希望使用舊版工具存取記錄,而這些工具依賴舊版結果 ID。

傳回
long

getLog

public LogFile getLog ()

傳回
LogFile

getResourceId

public String getResourceId ()

傳回記錄的資源 ID,這個 ID 會在這個特定呼叫中,單獨識別遠端伺服器上的記錄。

傳回
String

getTestResultId

public String getTestResultId ()

傳回
String

getWorkUnitId

public String getWorkUnitId ()

傳回
String

hashCode

public int hashCode ()

傳回
int

isSupported

public boolean isSupported ()

如果這個項目支援記錄關聯,則傳回 true。沒有資源 ID 的記錄沒有有效的關聯。

傳回
boolean

toString

public String toString ()

傳回
String