TestResultListener

public abstract class TestResultListener
extends Object implements ITestLifeCycleReceiver

java.lang.Object
   ↳ com.android.tradefed.result.TestResultListener


यह ITestLifecycleListener का आसान वर्शन है. इसका इस्तेमाल करने वाले सिर्फ़ अलग-अलग टेस्ट के नतीजों पर ध्यान देते हैं.

यह लाइफ़साइकल के अलग-अलग इवेंट को फ़िल्टर करके, testResult तरीके तक ले जाता है.

यह थ्रेड सेफ़ नहीं है. साथ ही, यह मानता है कि ITestLifecycleListener इवेंट, क्रम से मिले हैं.

खास जानकारी

सार्वजनिक कंस्ट्रक्टर

TestResultListener()

पब्लिक मेथड

final void testAssumptionFailure(TestDescription test, String trace)

इस फ़ंक्शन को तब कॉल किया जाता है, जब कोई ऐटॉमिक टेस्ट यह फ़्लैग करता है कि वह ऐसी शर्त मान रहा है जो गलत है

final void testEnded(TestDescription test, long endTime, Map<String, String> testMetrics)

testEnded(TestDescription,Map) के बजाय, सीधे तौर पर इवेंट खत्म होने का समय बताने का विकल्प.

final void testEnded(TestDescription test, long endTime, HashMap<String, MetricMeasurement.Metric> testMetrics)

testEnded(TestDescription,Map) के बजाय, सीधे तौर पर इवेंट खत्म होने का समय बताने का विकल्प.

final void testEnded(TestDescription test, Map<String, String> testMetrics)

यह कुकी, किसी टेस्ट केस के खत्म होने की जानकारी देती है.

final void testEnded(TestDescription test, HashMap<String, MetricMeasurement.Metric> testMetrics)

यह कुकी, किसी टेस्ट केस के खत्म होने की जानकारी देती है.

final void testFailed(TestDescription test, String trace)

यह किसी टेस्ट केस के फ़ेल होने की जानकारी देता है.

final void testIgnored(TestDescription test)

इस फ़ंक्शन को तब कॉल किया जाता है, जब कोई टेस्ट नहीं चलाया जाता. आम तौर पर, ऐसा इसलिए होता है, क्योंकि टेस्ट के तरीके को org.junit.Ignore के साथ एनोटेट किया जाता है.

abstract void testResult(TestDescription test, TestResult result)
void testRunEnded(long elapsedTimeMillis, HashMap<String, MetricMeasurement.Metric> runMetrics)

यह कुकी, टेस्ट रन के खत्म होने की जानकारी देती है.

void testSkipped(TestDescription test, SkipReason reason)

इस फ़ंक्शन को तब कॉल किया जाता है, जब किसी टेस्ट को स्किप किया जाता है और उसे किसी ऐसी वजह से लागू नहीं किया जाता जिसकी आम तौर पर उम्मीद नहीं होती.

final void testStarted(TestDescription test, long startTime)

testStarted(TestDescription) के बजाय, यहां हम यह भी बताते हैं कि टेस्ट कब शुरू हुआ था. साथ ही, सटीक मेज़रमेंट के लिए testEnded(TestDescription,long,Map) का इस्तेमाल किया जाता है.

final void testStarted(TestDescription test)

यह फ़ंक्शन, किसी टेस्ट केस के शुरू होने की जानकारी देता है.

सार्वजनिक कंस्ट्रक्टर

TestResultListener

public TestResultListener ()

पब्लिक मेथड

testAssumptionFailure

public final void testAssumptionFailure (TestDescription test, 
                String trace)

इस फ़ंक्शन को तब कॉल किया जाता है, जब कोई ऐटॉमिक टेस्ट यह फ़्लैग करता है कि वह ऐसी शर्त मान रहा है जो गलत है

पैरामीटर
test TestDescription: इससे टेस्ट की पहचान होती है

trace String: गड़बड़ी का स्टैक ट्रेस

testEnded

public final 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 final 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 final void testEnded (TestDescription test, 
                Map<String, String> testMetrics)

यह कुकी, किसी टेस्ट केस के खत्म होने की जानकारी देती है.

अगर testFailed(TestDescription, FailureDescription) को लागू नहीं किया गया है, तो यह टेस्ट पास हो गया है. यह टेस्ट केस के एक्ज़ीक्यूशन के दौरान, जनरेट हुई किसी भी कुंजी/वैल्यू मेट्रिक को भी दिखाता है.

पैरामीटर
test TestDescription: इससे टेस्ट की पहचान होती है

testMetrics Map: भेजी गई मेट्रिक का Map

testEnded

public final void testEnded (TestDescription test, 
                HashMap<String, MetricMeasurement.Metric> testMetrics)

यह कुकी, किसी टेस्ट केस के खत्म होने की जानकारी देती है.

अगर testFailed(TestDescription, FailureDescription) को लागू नहीं किया गया है, तो यह टेस्ट पास हो गया है. यह टेस्ट केस के एक्ज़ीक्यूशन के दौरान, जनरेट हुई किसी भी कुंजी/वैल्यू मेट्रिक को भी दिखाता है.

पैरामीटर
test TestDescription: इससे टेस्ट की पहचान होती है

testMetrics HashMap: भेजी गई मेट्रिक का Map

testFailed

public final void testFailed (TestDescription test, 
                String trace)

यह किसी टेस्ट केस के फ़ेल होने की जानकारी देता है.

इसे testStarted और testEnded के बीच कॉल किया जाएगा.

पैरामीटर
test TestDescription: इससे टेस्ट की पहचान होती है

trace String: गड़बड़ी का स्टैक ट्रेस

testIgnored

public final void testIgnored (TestDescription test)

इस फ़ंक्शन को तब कॉल किया जाता है, जब कोई टेस्ट नहीं चलाया जाता. आम तौर पर, ऐसा इसलिए होता है, क्योंकि टेस्ट के तरीके को org.junit.Ignore के साथ एनोटेट किया जाता है.

पैरामीटर
test TestDescription: इससे टेस्ट की पहचान होती है

testResult

public abstract void testResult (TestDescription test, 
                TestResult result)

पैरामीटर
test TestDescription

result TestResult

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 के साथ टेस्ट रन के आखिर में रिपोर्ट किए गए की-वैल्यू पेयर.

testSkipped

public void testSkipped (TestDescription test, 
                SkipReason reason)

इस फ़ंक्शन को तब कॉल किया जाता है, जब किसी टेस्ट को स्किप किया जाता है और उसे किसी ऐसी वजह से लागू नहीं किया जाता जिसकी आम तौर पर उम्मीद नहीं होती. इन टेस्ट को फिर से चलाने की कोशिश की जाएगी, ताकि इन्हें सही तरीके से लागू किया जा सके.

पैरामीटर
test TestDescription: इससे टेस्ट की पहचान होती है

reason SkipReason: SkipReason

testStarted

public final void testStarted (TestDescription test, 
                long startTime)

testStarted(TestDescription) के बजाय, यहां हम यह भी बताते हैं कि टेस्ट कब शुरू हुआ था. साथ ही, सटीक मेज़रमेंट के लिए testEnded(TestDescription,long,Map) का इस्तेमाल किया जाता है.

पैरामीटर
test TestDescription: इससे टेस्ट की पहचान होती है

startTime long: यह टेस्ट शुरू होने का समय है. इसे System.currentTimeMillis() के ज़रिए मेज़र किया जाता है

testStarted

public final void testStarted (TestDescription test)

यह फ़ंक्शन, किसी टेस्ट केस के शुरू होने की जानकारी देता है. पुराना इंटरफ़ेस. जब भी हो सके, testStarted(TestDescription) का इस्तेमाल करना चाहिए.

पैरामीटर
test TestDescription: इससे टेस्ट की पहचान होती है