TestTimeoutEnforcer
public
final
class
TestTimeoutEnforcer
extends ResultForwarder
| java.lang.Object | ||
| ↳ | com.android.tradefed.result.ResultForwarder | |
| ↳ | com.android.tradefed.testtype.TestTimeoutEnforcer | |
ऐसे लिसनर जो किसी टेस्ट केस के एक्ज़ीक्यूशन में लगने वाले समय की जांच करते हैं. अगर यह समय तय की गई समयसीमा से ज़्यादा हो जाता है, तो वे टेस्ट केस को फ़ेल कर देते हैं.
ध्यान दें कि यह एनफ़ोर्सर, टेस्ट में रुकावट नहीं डालता है. हालांकि, इससे टेस्ट फ़ेल हो जाएंगे.
खास जानकारी
कॉन्स्टेंट | |
|---|---|
String |
TEST_CASE_TIMEOUT_DESCRIPTION
|
String |
TEST_CASE_TIMEOUT_OPTION
|
पब्लिक कंस्ट्रक्टर | |
|---|---|
TestTimeoutEnforcer(long perTestCaseTimeout, TimeUnit unit, ITestInvocationListener... listeners)
टाइम आउट की दी गई अवधि के साथ |
|
TestTimeoutEnforcer(long perTestCaseTimeout, TimeUnit unit,
टाइम आउट की दी गई अवधि के साथ |
|
सार्वजनिक तरीके | |
|---|---|
void
|
testAssumptionFailure(TestDescription test, FailureDescription failure)
इस फ़ंक्शन को तब कॉल किया जाता है, जब कोई ऐटॉमिक टेस्ट यह फ़्लैग करता है कि वह ऐसी शर्त मान रहा है जो गलत है |
void
|
testAssumptionFailure(TestDescription test, String trace)
इस फ़ंक्शन को तब कॉल किया जाता है, जब कोई ऐटॉमिक टेस्ट यह फ़्लैग करता है कि वह ऐसी शर्त मान रहा है जो गलत है |
void
|
testEnded(TestDescription test, long endTime,
|
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
कॉन्स्टेंट वैल्यू: "The timeout that will be applied to each test case of the run."
TEST_CASE_TIMEOUT_OPTION
public static final String TEST_CASE_TIMEOUT_OPTION
स्थिर वैल्यू: "test-case-timeout"
पब्लिक कंस्ट्रक्टर
TestTimeoutEnforcer
public TestTimeoutEnforcer (long perTestCaseTimeout,
TimeUnit unit,
ITestInvocationListener... listeners)टाइम आउट की दी गई अवधि के साथ TestTimeoutEnforcer बनाएं.
| पैरामीटर | |
|---|---|
perTestCaseTimeout |
long: टाइम आउट की वैल्यू. |
unit |
TimeUnit: perTestCaseTimeout का ERROR(/TimeUnit). |
listeners |
ITestInvocationListener: वह ITestInvocationListener जिस पर ईमेल फ़ॉरवर्ड करना है. |
TestTimeoutEnforcer
public TestTimeoutEnforcer (long perTestCaseTimeout,
TimeUnit unit,
listeners) टाइम आउट की दी गई अवधि के साथ TestTimeoutEnforcer बनाएं.
| पैरामीटर | |
|---|---|
perTestCaseTimeout |
long: टाइमआउट की वैल्यू. |
unit |
TimeUnit: perTestCaseTimeout का ERROR(/TimeUnit). |
listeners |
: वह ITestInvocationListener जिस पर ईमेल फ़ॉरवर्ड करना है. |
सार्वजनिक तरीके
testAssumptionFailure
public void testAssumptionFailure (TestDescription test, FailureDescription failure)
इस फ़ंक्शन को तब कॉल किया जाता है, जब कोई ऐटॉमिक टेस्ट यह फ़्लैग करता है कि वह ऐसी शर्त मान रहा है जो गलत है
| पैरामीटर | |
|---|---|
test |
TestDescription: इससे टेस्ट की पहचान होती है |
failure |
FailureDescription: FailureDescription में गड़बड़ी और उसके कॉन्टेक्स्ट के बारे में बताया गया हो. |
testAssumptionFailure
public void testAssumptionFailure (TestDescription test, String trace)
इस फ़ंक्शन को तब कॉल किया जाता है, जब कोई ऐटॉमिक टेस्ट यह फ़्लैग करता है कि वह ऐसी शर्त मान रहा है जो गलत है
| पैरामीटर | |
|---|---|
test |
TestDescription: इससे टेस्ट की पहचान होती है |
trace |
String: गड़बड़ी का स्टैक ट्रेस |
testEnded
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: टेस्ट के खत्म होने का समय, जिसे System.currentTimeMillis() के ज़रिए मेज़र किया जाता है |
testMetrics |
: भेजी गई मेट्रिक का ERROR(/Map) |
testFailed
public void testFailed (TestDescription test, FailureDescription failure)
यह किसी टेस्ट केस के फ़ेल होने की जानकारी देता है.
इसे testStarted और testEnded के बीच कॉल किया जाएगा.
| पैरामीटर | |
|---|---|
test |
TestDescription: इससे टेस्ट की पहचान होती है |
failure |
FailureDescription: FailureDescription में गड़बड़ी और उसके कॉन्टेक्स्ट के बारे में बताया गया हो. |
testFailed
public void testFailed (TestDescription test, String trace)
यह किसी टेस्ट केस के फ़ेल होने की जानकारी देता है.
इसे testStarted और testEnded के बीच कॉल किया जाएगा.
| पैरामीटर | |
|---|---|
test |
TestDescription: इससे टेस्ट की पहचान होती है |
trace |
String: गड़बड़ी का स्टैक ट्रेस |
testIgnored
public void testIgnored (TestDescription test)
इस फ़ंक्शन को तब कॉल किया जाता है, जब टेस्ट नहीं चलाया जाता. आम तौर पर, ऐसा इसलिए होता है, क्योंकि टेस्ट के तरीके को org.junit.Ignore के साथ एनोटेट किया जाता है.
| पैरामीटर | |
|---|---|
test |
TestDescription: इससे टेस्ट की पहचान होती है |
testStarted
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: यह टेस्ट शुरू होने का समय है. इसे System.currentTimeMillis() के ज़रिए मेज़र किया जाता है |