LogAssociation
public
class
LogAssociation
extends Object
| java.lang.Object | |
| ↳ | com.google.android.tradefed.result.teststorage.LogAssociation |
A class to represent a link between a log file and a test. An association represents that a particular log file was created by a particular test.
Summary
Public constructors | |
|---|---|
LogAssociation(Invocation invocation, String workUnitId, TestResult testResult, long legacyResultId, LogFile log)
Create an association for a log file. |
|
Public methods | |
|---|---|
boolean
|
equals(Object o)
|
String
|
getAttemptId()
Returns attempt id which is required for v2 log upload. |
String
|
getBuildId()
Returns build id. |
String
|
getBuildTarget()
Returns the name of the build target. |
String
|
getBuildType()
Returns the build type. |
String
|
getInvocationId()
|
long
|
getLegacyResultId()
Returns the legacy result id used to upload the log. |
LogFile
|
getLog()
|
String
|
getResourceId()
Returns resource id for the log which uniquely identifies the log on the remote server in this particular invocation. |
String
|
getTestResultId()
|
String
|
getWorkUnitId()
|
int
|
hashCode()
|
boolean
|
isSupported()
Returns true if log association is supported for this entry. |
String
|
toString()
|
Public constructors
LogAssociation
public LogAssociation (Invocation invocation,
String workUnitId,
TestResult testResult,
long legacyResultId,
LogFile log)Create an association for a log file. A log file can be associated to an individual test, or to a test run or a module. If a log is associated with a test then a TestReseult object for that test needs to be provided. Otherwise only provide invocation and work unit.
| Parameters | |
|---|---|
invocation |
Invocation: invocation to which the log file belongs to. |
workUnitId |
String: work unit id representing the stage of the test that produced the log. |
testResult |
TestResult: if a log was produced by a test, testResult object that represents that
test. |
legacyResultId |
long |
log |
LogFile: log file that needs to be associated. |
Public methods
equals
public boolean equals (Object o)
| Parameters | |
|---|---|
o |
Object |
| Returns | |
|---|---|
boolean |
|
getAttemptId
public String getAttemptId ()
Returns attempt id which is required for v2 log upload.
| Returns | |
|---|---|
String |
|
getBuildId
public String getBuildId ()
Returns build id. This is required for v2 log upload which needs build info.
| Returns | |
|---|---|
String |
|
getBuildTarget
public String getBuildTarget ()
Returns the name of the build target. This is required for v2 log upload.
| Returns | |
|---|---|
String |
|
getBuildType
public String getBuildType ()
Returns the build type. This is required for v2 log upload, where build info is required to upload the log. V3 does not need this because that information is already available in invocation.
| Returns | |
|---|---|
String |
|
getInvocationId
public String getInvocationId ()
| Returns | |
|---|---|
String |
|
getLegacyResultId
public long getLegacyResultId ()
Returns the legacy result id used to upload the log. For backward compatibility the logs are uploaded using V2 version of the api which requires legacy result id. After the log is uploaded we create an associating using the v3 api, using invocation id and work unit id, but we still want the logs to be accessible using the legacy tools which rely on the legacy result id.
| Returns | |
|---|---|
long |
|
getResourceId
public String getResourceId ()
Returns resource id for the log which uniquely identifies the log on the remote server in this particular invocation.
| Returns | |
|---|---|
String |
|
getTestResultId
public String getTestResultId ()
| Returns | |
|---|---|
String |
|
getWorkUnitId
public String getWorkUnitId ()
| Returns | |
|---|---|
String |
|
hashCode
public int hashCode ()
| Returns | |
|---|---|
int |
|
isSupported
public boolean isSupported ()
Returns true if log association is supported for this entry. Logs without resource id do not have a valid association.
| Returns | |
|---|---|
boolean |
|
toString
public String toString ()
| Returns | |
|---|---|
String |
|