TestTimeoutEnforcer
public final class TestTimeoutEnforcer
extends ResultForwarder
java.lang.Object | ||
↳ | com.android.tradefed.result.ResultForwarder | |
↳ | com.android.tradefed.testtype.TestTimeoutEnforcer |
מאזינים המאפשרים לבדוק את זמן הביצוע של מקרה בדיקה נתון ולהכשל בו אם הוא עובר פסק זמן נתון.
שימו לב שהאוכף הזה לא מפריע לבדיקות, אלא יגרום להם להיכשל.
סיכום
שדות | |
---|---|
public static final String | TEST_CASE_TIMEOUT_DESCRIPTION |
public static final String | TEST_CASE_TIMEOUT_OPTION
|
בנאים ציבוריים | |
---|---|
TestTimeoutEnforcer (long perTestCaseTimeout, TimeUnit unit, ITestInvocationListener... listeners) צור את | |
TestTimeoutEnforcer (long perTestCaseTimeout, TimeUnit unit, listeners) TestTimeoutEnforcer (long perTestCaseTimeout, TimeUnit unit, listeners) צור את |
שיטות ציבוריות | |
---|---|
void | testAssumptionFailure ( TestDescription test, FailureDescription failure) נקרא כאשר בדיקה אטומית מסמנת שהיא מניחה מצב שהוא שקרי |
void | testAssumptionFailure ( TestDescription test, String trace) נקרא כאשר בדיקה אטומית מסמנת שהיא מניחה מצב שהוא שקרי |
void | testEnded ( TestDescription test, long endTime, testMetrics) testEnded ( TestDescription test, long endTime, testMetrics) חלופה ל- |
void | testFailed ( TestDescription test, FailureDescription failure) מדווח על כישלון של מקרה בדיקה בודד. |
void | testFailed ( TestDescription test, String trace) מדווח על כישלון של מקרה בדיקה בודד. |
void | testIgnored ( TestDescription test) נקרא כאשר בדיקה לא תופעל, בדרך כלל מכיוון ששיטת בדיקה מסומנת ב-org.junit.Ignore. |
void | testStarted ( TestDescription test, long startTime) חלופה ל- |
שדות
TEST_CASE_TIMEOUT_DESCRIPTION
public static final String TEST_CASE_TIMEOUT_DESCRIPTION
TEST_CASE_TIMEOUT_OPTION
public static final String TEST_CASE_TIMEOUT_OPTION
בנאים ציבוריים
TestTimeoutEnforcer
public TestTimeoutEnforcer (long perTestCaseTimeout, TimeUnit unit, ITestInvocationListener... listeners)
צור את TestTimeoutEnforcer
עם הזמן הקצוב שניתן לאכוף.
פרמטרים | |
---|---|
perTestCaseTimeout | long : הערך של פסק הזמן. |
unit | TimeUnit : ה- ERROR(/TimeUnit) של perTestCaseTimeout. |
listeners | ITestInvocationListener : ה- ITestInvocationListener להעביר אליו. |
TestTimeoutEnforcer
public TestTimeoutEnforcer (long perTestCaseTimeout, TimeUnit unit,listeners)
צור את TestTimeoutEnforcer
עם הזמן הקצוב שניתן לאכוף.
פרמטרים | |
---|---|
perTestCaseTimeout | long : הערך של פסק הזמן. |
unit | TimeUnit : ה- ERROR(/TimeUnit) של perTestCaseTimeout. |
listeners | ITestInvocationListener להעביר אליו. |
שיטות ציבוריות
testAssumption Failure
public void testAssumptionFailure (TestDescription test, FailureDescription failure)
נקרא כאשר בדיקה אטומית מסמנת שהיא מניחה מצב שהוא שקרי
פרמטרים | |
---|---|
test | TestDescription : מזהה את הבדיקה |
failure | FailureDescription : FailureDescription המתאר את הכישלון ואת ההקשר שלו. |
testAssumption Failure
public void testAssumptionFailure (TestDescription test, String trace)
נקרא כאשר בדיקה אטומית מסמנת שהיא מניחה מצב שהוא שקרי
פרמטרים | |
---|---|
test | TestDescription : מזהה את הבדיקה |
trace | String : עקבות מחסנית של כישלון |
הבדיקה הסתיים
public void testEnded (TestDescription test, long endTime,testMetrics)
חלופה ל- ERROR(/#testEnded(com.android.tradefed.result.TestDescription,Map))
שבו נוכל לציין את שעת הסיום ישירות. שלב עם testStarted(com.android.tradefed.result.TestDescription, long)
למדידה מדויקת.
פרמטרים | |
---|---|
test | TestDescription : מזהה את הבדיקה |
endTime | long : הזמן שבו הסתיימה הבדיקה, נמדד באמצעות ERROR(/System#currentTimeMillis()) |
testMetrics | ERROR(/Map) של המדדים הנפלטים |
מבחן נכשל
public void testFailed (TestDescription test, FailureDescription failure)
מדווח על כישלון של מקרה בדיקה בודד.
ייקרא בין testStarted לבין testEnded.
פרמטרים | |
---|---|
test | TestDescription : מזהה את הבדיקה |
failure | FailureDescription : FailureDescription המתאר את הכישלון ואת ההקשר שלו. |
מבחן נכשל
public void testFailed (TestDescription test, String trace)
מדווח על כישלון של מקרה בדיקה בודד.
ייקרא בין testStarted לבין testEnded.
פרמטרים | |
---|---|
test | TestDescription : מזהה את הבדיקה |
trace | String : עקבות מחסנית של כישלון |
התעלמו מהבדיקה
public void testIgnored (TestDescription test)
נקרא כאשר בדיקה לא תופעל, בדרך כלל מכיוון ששיטת בדיקה מסומנת ב-org.junit.Ignore.
פרמטרים | |
---|---|
test | TestDescription : מזהה את הבדיקה |
הבדיקה התחילה
public void testStarted (TestDescription test, long startTime)
חלופה ל- testStarted(com.android.tradefed.result.TestDescription)
שם אנו מציינים גם מתי הבדיקה התחילה, בשילוב עם ERROR(/#testEnded(com.android.tradefed.result.TestDescription,long,Map))
למדידה מדויקת .
פרמטרים | |
---|---|
test | TestDescription : מזהה את הבדיקה |
startTime | long : הזמן שבו הבדיקה התחילה, נמדד באמצעות ERROR(/System#currentTimeMillis()) |