ShardMainResultForwarder
public class ShardMainResultForwarder
extends ResultForwarder
implements ILogSaverListener
java.lang.Object | ||
↳ | com.android.tradefed.result.resultforwarder | |
↳ | com.android.tradefed.invoker.ShardMainResultForwarder |
A ResultForwarder
that combines the results of a sharded test invocations. It only reports completion of the invocation to the listeners once all sharded invocations are complete.
כיתה זו אינה בטוחה בשרשור. It is expected that clients will lock on this class when sending test results, to prevent invocation callbacks from being called out of order.
סיכום
בנאים ציבוריים | |
---|---|
ShardMainResultForwarder ( listeners, int expectedShards) ShardMainResultForwarder ( listeners, int expectedShards) צור |
שיטות ציבוריות | |
---|---|
getListeners () Get the list of listeners. | |
void | invocationEnded (long elapsedTime) Reports that the invocation has terminated, whether successfully or due to some error condition. |
void | invocationEnded (long elapsedTime, IInvocationContext context) More detailed callback to differentiate which shard finished. |
void | invocationFailed ( FailureDescription failure) Reports an incomplete invocation due to some error condition. |
void | invocationFailed (Throwable cause) Reports an incomplete invocation due to some error condition. |
void | invocationSkipped ( SkipReason reason) Reports an invocation as skipped |
void | invocationStarted ( IInvocationContext context) Reports the start of the test invocation. |
void | logAssociation (String dataName, LogFile logFile) במקרים מסוימים, יומן חייב להיות משויך מאוד למקרי בדיקה, אך ההזדמנות לעשות זאת ב- |
void | testLogForward (String dataName, LogDataType dataType, InputStreamSource dataStream) Only forward the testLog instead of saving the log first. |
void | testLogSaved (String dataName, LogDataType dataType, InputStreamSource dataStream, LogFile logFile) Called when the test log is saved. |
בנאים ציבוריים
ShardMainResultForwarder
public ShardMainResultForwarder (listeners, int expectedShards)
Create a ShardMainResultForwarder
.
פרמטרים | |
---|---|
listeners | ITestInvocationListener to forward results to when all shards are completed |
expectedShards | int : the number of shards |
שיטות ציבוריות
getListeners
publicgetListeners ()
Get the list of listeners. Intended only for use by subclasses.
החזרות | |
---|---|
The list of ITestInvocationListener s. |
invocationEnded
public void invocationEnded (long elapsedTime)
Reports that the invocation has terminated, whether successfully or due to some error condition.
Will be automatically called by the TradeFederation framework.
פרמטרים | |
---|---|
elapsedTime | long : the elapsed time of the invocation in ms |
invocationEnded
public void invocationEnded (long elapsedTime, IInvocationContext context)
More detailed callback to differentiate which shard finished.
פרמטרים | |
---|---|
elapsedTime | long |
context | IInvocationContext |
invocationFailed
public void invocationFailed (FailureDescription failure)
Reports an incomplete invocation due to some error condition.
Will be automatically called by the TradeFederation framework.
פרמטרים | |
---|---|
failure | FailureDescription : the FailureDescription describing the cause of the failure |
invocationFailed
public void invocationFailed (Throwable cause)
Reports an incomplete invocation due to some error condition.
Will be automatically called by the TradeFederation framework.
פרמטרים | |
---|---|
cause | Throwable : the Throwable cause of the failure |
invocationSkipped
public void invocationSkipped (SkipReason reason)
Reports an invocation as skipped
פרמטרים | |
---|---|
reason | SkipReason |
invocationStarted
public void invocationStarted (IInvocationContext context)
מדווח על תחילת הפתיחה של הבדיקה.
ייקרא אוטומטית על ידי מסגרת המסחר. כתבים צריכים לעקוף שיטה זו כדי לתמוך בדיווח על מכשירים מרובים.
פרמטרים | |
---|---|
context | IInvocationContext : מידע על הפתיחה |
logAssociation
public void logAssociation (String dataName, LogFile logFile)
במקרים מסוימים, יומן חייב להיות משויך מאוד למקרי בדיקה, אך ההזדמנות לעשות זאת ב- testLogSaved(String, com.android.tradefed.result.LogDataType, com.android.tradefed.result.InputStreamSource, com.android.tradefed.result.LogFile)
התקשרות חוזרת אינה אפשרית. לפיכך, התקשרות חוזרת זו מאפשרת לספק קשר חזק במפורש.
פרמטרים | |
---|---|
dataName | String : שם הנתונים |
logFile | LogFile : LogFile שנרשם קודם לכן ואמור להיות משויך למקרה הבדיקה. |
testlogforward
public void testLogForward (String dataName, LogDataType dataType, InputStreamSource dataStream)
רק העבר את TestLog במקום לשמור את היומן קודם.
פרמטרים | |
---|---|
dataName | String |
dataType | LogDataType |
dataStream | InputStreamSource |
testLogSaved
public void testLogSaved (String dataName, LogDataType dataType, InputStreamSource dataStream, LogFile logFile)
נקרא כאשר נשמר יומן הבדיקה.
יש להשתמש במקום של ITestInvocationListener#testLog(String, LogDataType, InputStreamSource)
.
פרמטרים | |
---|---|
dataName | String : String שם תיאורי של הנתונים. למשל "device_logcat". הערה DataName עשוי להיות לא ייחודי לכל הפתיחה. IE מיישמים חייבים להיות מסוגלים להתמודד עם מספר שיחות עם אותו שם |
dataType | LogDataType : LogDataType של הנתונים |
dataStream | InputStreamSource : InputStreamSource של הנתונים. על מיישמים להתקשר CreateInputStream כדי להתחיל לקרוא את הנתונים, ולהבטיח לסגור את הזרם המתקבל בעת השלמתו. |
logFile | LogFile : קובץ LogFile המכיל את נתוני המטא של הקובץ השמור. |