ITestLifeCycleReceiver
public
interface
ITestLifeCycleReceiver
| com.android.tradefed.result.ITestLifeCycleReceiver |
यह कुकी, इंस्ट्रुमेंटेशन टेस्ट के दौरान इवेंट की सूचनाएं पाने के लिए इस्तेमाल की जाती है.
org.junit.runner.notification.RunListener के बाद पैटर्न बनाया गया
कॉल का क्रम इस तरह होगा:
- testRunStarted
- testStarted
- [testFailed]
- [testAssumptionFailure]
- [testIgnored]
- testEnded
- ....
- [testRunFailed]
- testRunEnded
खास जानकारी
पब्लिक मेथड | |
|---|---|
default
void
|
testAssumptionFailure(TestDescription test, String trace)
इस फ़ंक्शन को तब कॉल किया जाता है, जब कोई ऐटॉमिक टेस्ट यह फ़्लैग करता है कि वह ऐसी शर्त मान रहा है जो गलत है |
default
void
|
testAssumptionFailure(TestDescription test, FailureDescription failure)
इस फ़ंक्शन को तब कॉल किया जाता है, जब कोई ऐटॉमिक टेस्ट यह फ़्लैग करता है कि वह ऐसी शर्त मान रहा है जो गलत है |
default
void
|
testEnded(TestDescription test, HashMap<String, MetricMeasurement.Metric> testMetrics)
यह कुकी, किसी टेस्ट केस के खत्म होने की जानकारी देती है. |
default
void
|
testEnded(TestDescription test, long endTime, Map<String, String> testMetrics)
|
default
void
|
testEnded(TestDescription test, long endTime, HashMap<String, MetricMeasurement.Metric> testMetrics)
|
default
void
|
testEnded(TestDescription test, Map<String, String> testMetrics)
यह कुकी, किसी टेस्ट केस के खत्म होने की जानकारी देती है. |
default
void
|
testFailed(TestDescription test, FailureDescription failure)
यह किसी टेस्ट केस के फ़ेल होने की जानकारी देता है. |
default
void
|
testFailed(TestDescription test, String trace)
यह किसी टेस्ट केस के फ़ेल होने की जानकारी देता है. |
default
void
|
testIgnored(TestDescription test)
इस फ़ंक्शन को तब कॉल किया जाता है, जब कोई टेस्ट नहीं चलाया जाता. आम तौर पर, ऐसा इसलिए होता है, क्योंकि टेस्ट के तरीके को org.junit.Ignore के साथ एनोटेट किया जाता है. |
default
void
|
testRunEnded(long elapsedTimeMillis, HashMap<String, MetricMeasurement.Metric> runMetrics)
यह कुकी, टेस्ट रन के खत्म होने की जानकारी देती है. |
default
void
|
testRunEnded(long elapsedTimeMillis, Map<String, String> runMetrics)
यह कुकी, टेस्ट रन के खत्म होने की जानकारी देती है. |
default
void
|
testRunFailed(FailureDescription failure)
|
default
void
|
testRunFailed(String errorMessage)
गंभीर गड़बड़ी की वजह से, रिपोर्ट के टेस्ट रन को पूरा नहीं किया जा सका. |
default
void
|
testRunStarted(String runName, int testCount, int attemptNumber)
यह कुकी, टेस्ट रन शुरू होने की जानकारी देती है. |
default
void
|
testRunStarted(String runName, int testCount)
यह कुकी, टेस्ट रन शुरू होने की जानकारी देती है. |
default
void
|
testRunStarted(String runName, int testCount, int attemptNumber, long startTime)
यह कुकी, टेस्ट रन शुरू होने की जानकारी देती है. |
default
void
|
testRunStopped(long elapsedTime)
उपयोगकर्ता के अनुरोध की वजह से, रिपोर्ट के टेस्ट रन को पूरा होने से पहले ही रोक दिया गया. |
default
void
|
testSkipped(TestDescription test, SkipReason reason)
इस फ़ंक्शन को तब कॉल किया जाता है, जब किसी टेस्ट को स्किप किया जाता है और उसे किसी ऐसी वजह से लागू नहीं किया जाता जिसकी आम तौर पर उम्मीद नहीं होती. |
default
void
|
testStarted(TestDescription test, long startTime)
|
default
void
|
testStarted(TestDescription test)
यह फ़ंक्शन, किसी टेस्ट केस के शुरू होने की जानकारी देता है. |
पब्लिक मेथड
testAssumptionFailure
public void testAssumptionFailure (TestDescription test, String trace)
इस फ़ंक्शन को तब कॉल किया जाता है, जब कोई ऐटॉमिक टेस्ट यह फ़्लैग करता है कि वह ऐसी शर्त मान रहा है जो गलत है
| पैरामीटर | |
|---|---|
test |
TestDescription: इससे टेस्ट की पहचान होती है |
trace |
String: गड़बड़ी का स्टैक ट्रेस |
testAssumptionFailure
public void testAssumptionFailure (TestDescription test, FailureDescription failure)
इस फ़ंक्शन को तब कॉल किया जाता है, जब कोई ऐटॉमिक टेस्ट यह फ़्लैग करता है कि वह ऐसी शर्त मान रहा है जो गलत है
| पैरामीटर | |
|---|---|
test |
TestDescription: इससे टेस्ट की पहचान होती है |
failure |
FailureDescription: FailureDescription में गड़बड़ी और उसके संदर्भ के बारे में बताया गया हो. |
testEnded
public void testEnded (TestDescription test, HashMap<String, MetricMeasurement.Metric> testMetrics)
यह कुकी, किसी टेस्ट केस के खत्म होने की जानकारी देती है.
अगर testFailed(TestDescription, FailureDescription) को लागू नहीं किया गया है, तो यह टेस्ट पास हो गया है. यह टेस्ट केस के एक्ज़ीक्यूशन के दौरान, जनरेट हुई किसी भी कुंजी/वैल्यू मेट्रिक को भी दिखाता है.
| पैरामीटर | |
|---|---|
test |
TestDescription: इससे टेस्ट की पहचान होती है |
testMetrics |
HashMap: भेजी गई मेट्रिक का Map |
testEnded
public void testEnded (TestDescription test, long endTime, Map<String, String> testMetrics)
testEnded(TestDescription,Map) के बजाय, सीधे तौर पर इवेंट खत्म होने का समय बताने का विकल्प. सटीक मेज़रमेंट के लिए, इसे testStarted(TestDescription,long) के साथ जोड़ें.
| पैरामीटर | |
|---|---|
test |
TestDescription: इससे टेस्ट की पहचान होती है |
endTime |
long: टेस्ट के खत्म होने का समय, जिसे System.currentTimeMillis() के ज़रिए मेज़र किया जाता है |
testMetrics |
Map: भेजी गई मेट्रिक का Map |
testEnded
public void testEnded (TestDescription test, long endTime, HashMap<String, MetricMeasurement.Metric> testMetrics)
testEnded(TestDescription,Map) के बजाय, सीधे तौर पर इवेंट खत्म होने का समय बताने का विकल्प. सटीक मेज़रमेंट के लिए, इसे testStarted(TestDescription,long) के साथ जोड़ें.
| पैरामीटर | |
|---|---|
test |
TestDescription: इससे टेस्ट की पहचान होती है |
endTime |
long: टेस्ट के खत्म होने का समय, जिसे System.currentTimeMillis() के ज़रिए मेज़र किया जाता है |
testMetrics |
HashMap: भेजी गई मेट्रिक का Map |
testEnded
public void testEnded (TestDescription test, Map<String, String> testMetrics)
यह कुकी, किसी टेस्ट केस के खत्म होने की जानकारी देती है.
अगर testFailed(TestDescription, FailureDescription) को लागू नहीं किया गया है, तो यह टेस्ट पास हो गया है. यह टेस्ट केस के एक्ज़ीक्यूशन के दौरान, जनरेट हुई किसी भी कुंजी/वैल्यू मेट्रिक को भी दिखाता है.
| पैरामीटर | |
|---|---|
test |
TestDescription: इससे टेस्ट की पहचान होती है |
testMetrics |
Map: भेजी गई मेट्रिक का 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: इससे टेस्ट की पहचान होती है |
testRunEnded
public void testRunEnded (long elapsedTimeMillis,
HashMap<String, MetricMeasurement.Metric> runMetrics)यह कुकी, टेस्ट रन के खत्म होने की जानकारी देती है. FIXME: We cannot have two Map<> interfaces with different type, so we have to use HashMap here.
| पैरामीटर | |
|---|---|
elapsedTimeMillis |
long: डिवाइस ने मिलीसेकंड में बीता हुआ समय रिपोर्ट किया |
runMetrics |
HashMap: Metric के साथ टेस्ट रन के आखिर में रिपोर्ट किए गए की-वैल्यू पेयर. |
testRunEnded
public void testRunEnded (long elapsedTimeMillis,
Map<String, String> runMetrics)यह कुकी, टेस्ट रन के खत्म होने की जानकारी देती है.
| पैरामीटर | |
|---|---|
elapsedTimeMillis |
long: डिवाइस ने मिलीसेकंड में बीता हुआ समय रिपोर्ट किया |
runMetrics |
Map: टेस्ट रन के आखिर में रिपोर्ट किए गए की-वैल्यू पेयर |
testRunFailed
public void testRunFailed (FailureDescription failure)
FailureDescription की वजह से, रिपोर्ट टेस्ट रन पूरा नहीं हो सका.
| पैरामीटर | |
|---|---|
failure |
FailureDescription: FailureDescription में गड़बड़ी और उसके संदर्भ के बारे में बताया गया हो. |
testRunFailed
public void testRunFailed (String errorMessage)
गंभीर गड़बड़ी की वजह से, रिपोर्ट के टेस्ट रन को पूरा नहीं किया जा सका.
| पैरामीटर | |
|---|---|
errorMessage |
String: String, रन फ़ेल होने की वजह के बारे में बताता है. |
testRunStarted
public void testRunStarted (String runName,
int testCount,
int attemptNumber)यह कुकी, टेस्ट रन शुरू होने की जानकारी देती है.
| पैरामीटर | |
|---|---|
runName |
String: टेस्ट रन का नाम |
testCount |
int: टेस्ट रन में कुल टेस्ट की संख्या |
attemptNumber |
int: ऑर्डर नंबर, जो एक ही runName
के अलग-अलग प्रयासों की पहचान करता है. यह कई बार चलता है. attemptNumber, 0 से शुरू होता है और हर बार नया रन होने पर इसे बढ़ाना चाहिए. उदाहरण के लिए, अगर किसी टेस्ट को तीन बार फिर से आज़माया जाता है, तो उसे एक ही runName के तहत कुल चार रन करने चाहिए. साथ ही, attemptNumber 0 से 3 तक होना चाहिए. |
testRunStarted
public void testRunStarted (String runName,
int testCount)यह कुकी, टेस्ट रन शुरू होने की जानकारी देती है.
| पैरामीटर | |
|---|---|
runName |
String: टेस्ट रन का नाम |
testCount |
int: टेस्ट रन में कुल टेस्ट की संख्या |
testRunStarted
public void testRunStarted (String runName,
int testCount,
int attemptNumber,
long startTime)यह कुकी, टेस्ट रन शुरू होने की जानकारी देती है.
| पैरामीटर | |
|---|---|
runName |
String: टेस्ट रन का नाम |
testCount |
int: टेस्ट रन में कुल टेस्ट की संख्या |
attemptNumber |
int: ऑर्डर नंबर, जो एक ही runName
के अलग-अलग प्रयासों की पहचान करता है. यह कई बार चलता है. attemptNumber, 0 से शुरू होता है और हर बार नया रन होने पर इसे बढ़ाना चाहिए. उदाहरण के लिए, अगर किसी टेस्ट को तीन बार फिर से चलाया जाता है, तो उसे एक ही runName के तहत कुल चार बार चलाया जाना चाहिए. साथ ही, attemptNumber 0 से 3 तक होना चाहिए. |
startTime |
long: दौड़ शुरू होने का समय, जिसे System.currentTimeMillis() के ज़रिए मेज़र किया जाता है |
testRunStopped
public void testRunStopped (long elapsedTime)
उपयोगकर्ता के अनुरोध की वजह से, रिपोर्ट के टेस्ट रन को पूरा होने से पहले ही रोक दिया गया.
TODO: currently unused, consider removing
| पैरामीटर | |
|---|---|
elapsedTime |
long: डिवाइस ने मिलीसेकंड में बीता हुआ समय रिपोर्ट किया |
testSkipped
public void testSkipped (TestDescription test, SkipReason reason)
इस फ़ंक्शन को तब कॉल किया जाता है, जब किसी टेस्ट को स्किप किया जाता है और उसे किसी ऐसी वजह से लागू नहीं किया जाता जिसकी आम तौर पर उम्मीद नहीं होती. इन टेस्ट को फिर से चलाने की कोशिश की जाएगी, ताकि इन्हें सही तरीके से लागू किया जा सके.
| पैरामीटर | |
|---|---|
test |
TestDescription: इससे टेस्ट की पहचान होती है |
reason |
SkipReason: SkipReason |
testStarted
public void testStarted (TestDescription test, long startTime)
testStarted(TestDescription) के बजाय, यहां हम यह भी बताते हैं कि टेस्ट कब शुरू हुआ था. साथ ही, सटीक मेज़रमेंट के लिए testEnded(TestDescription,long,Map) का इस्तेमाल किया जाता है.
| पैरामीटर | |
|---|---|
test |
TestDescription: इससे टेस्ट की पहचान होती है |
startTime |
long: यह टेस्ट शुरू होने का समय है. इसे System.currentTimeMillis() के ज़रिए मेज़र किया जाता है |
testStarted
public void testStarted (TestDescription test)
यह फ़ंक्शन, किसी टेस्ट केस के शुरू होने की जानकारी देता है. पुराना इंटरफ़ेस. जब भी हो सके, testStarted(TestDescription) का इस्तेमाल करना चाहिए.
| पैरामीटर | |
|---|---|
test |
TestDescription: इससे टेस्ट की पहचान होती है |