ResultAggregator
public
class
ResultAggregator
extends CollectingTestListener
| java.lang.Object | ||
| ↳ | com.android.tradefed.result.CollectingTestListener | |
| ↳ | com.android.tradefed.retry.ResultAggregator | |
यह एक खास फ़ॉरवर्डर है. यह ज़रूरत पड़ने पर, नतीजों को इकट्ठा करता है. ऐसा, फिर से कोशिश करने की उस रणनीति के आधार पर किया जाता है जिसे अपनाया गया था.
खास जानकारी
सार्वजनिक कंस्ट्रक्टर | |
|---|---|
ResultAggregator(List<ITestInvocationListener> listeners, RetryStrategy strategy)
|
|
पब्लिक मेथड | |
|---|---|
void
|
cleanEventsFiles()
|
final
void
|
forwardAggregatedInvocationLogs()
इनवॉकेशन लेवल के सभी लॉग, नतीजों की जानकारी देने वाले उन लोगों को फ़ॉरवर्ड करें जो ज़्यादा जानकारी वाले नतीजों के साथ काम नहीं करते. |
void
|
invocationEnded(long elapsedTime)
यह रिपोर्ट करती है कि इनवॉकेशन खत्म हो गया है. भले ही, यह काम सही तरीके से हुआ हो या किसी गड़बड़ी की वजह से. |
void
|
invocationFailed(FailureDescription failure)
|
void
|
invocationFailed(Throwable cause)
किसी गड़बड़ी की वजह से, यह कुकी इनवोकेशन पूरा न होने की सूचना देती है. |
void
|
invocationSkipped(SkipReason reason)
इस फ़ंक्शन का इस्तेमाल, किसी इनवोकेशन को 'अभी नहीं' के तौर पर रिपोर्ट करने के लिए किया जाता है |
void
|
invocationStarted(IInvocationContext context)
यह कुकी, टेस्ट शुरू होने की जानकारी देती है. |
void
|
logAssociation(String dataName, LogFile logFile)
कुछ मामलों में, लॉग को टेस्ट केस से जोड़ा जाना ज़रूरी होता है. हालांकि, सीधे |
void
|
setLogSaver(ILogSaver logSaver)
|
void
|
setUpdatedReporting(boolean updatedReporting)
यह कुकी, नई रिपोर्टिंग की सुविधा सेट करती है. |
void
|
testAssumptionFailure(TestDescription test, String trace)
इस फ़ंक्शन को तब कॉल किया जाता है, जब कोई ऐटॉमिक टेस्ट यह फ़्लैग करता है कि वह ऐसी शर्त मान रहा है जो गलत है |
void
|
testAssumptionFailure(TestDescription test, FailureDescription failure)
इस फ़ंक्शन को तब कॉल किया जाता है, जब कोई ऐटॉमिक टेस्ट यह फ़्लैग करता है कि वह ऐसी शर्त मान रहा है जो गलत है |
void
|
testEnded(TestDescription test, long endTime, HashMap<String, MetricMeasurement.Metric> testMetrics)
|
void
|
testFailed(TestDescription test, FailureDescription failure)
यह किसी टेस्ट केस के फ़ेल होने की जानकारी देता है. |
void
|
testFailed(TestDescription test, String trace)
यह किसी टेस्ट केस के फ़ेल होने की जानकारी देता है. |
void
|
testIgnored(TestDescription test)
इस फ़ंक्शन को तब कॉल किया जाता है, जब कोई टेस्ट नहीं चलाया जाता. आम तौर पर, ऐसा इसलिए होता है, क्योंकि टेस्ट के तरीके को org.junit.Ignore के साथ एनोटेट किया जाता है. |
void
|
testLog(String dataName, LogDataType dataType, InputStreamSource dataStream)
|
void
|
testLogSaved(String dataName, LogDataType dataType, InputStreamSource dataStream, LogFile logFile)
|
void
|
testModuleEnded()
यह कुकी, मॉड्यूल के रन के खत्म होने की जानकारी देती है. |
void
|
testModuleStarted(IInvocationContext moduleContext)
यह कुकी, मॉड्यूल के चलने की शुरुआत की जानकारी देती है. |
void
|
testRunEnded(long elapsedTime, HashMap<String, MetricMeasurement.Metric> runMetrics)
यह कुकी, टेस्ट रन के खत्म होने की जानकारी देती है. |
void
|
testRunFailed(FailureDescription failure)
|
void
|
testRunFailed(String errorMessage)
गंभीर गड़बड़ी की वजह से, रिपोर्ट के टेस्ट रन को पूरा नहीं किया जा सका. |
void
|
testRunStarted(String name, int testCount, int attemptNumber, long startTime)
यह कुकी, टेस्ट रन शुरू होने की जानकारी देती है. |
void
|
testSkipped(TestDescription test, SkipReason reason)
इस फ़ंक्शन को तब कॉल किया जाता है, जब किसी टेस्ट को स्किप किया जाता है और उसे किसी ऐसी वजह से लागू नहीं किया जाता जिसकी आम तौर पर उम्मीद नहीं होती. |
void
|
testStarted(TestDescription test, long startTime)
|
प्रोटेक्टेड मेथड | |
|---|---|
File[]
|
getEventsLogs()
|
सार्वजनिक कंस्ट्रक्टर
ResultAggregator
public ResultAggregator (List<ITestInvocationListener> listeners, RetryStrategy strategy)
| पैरामीटर | |
|---|---|
listeners |
List |
strategy |
RetryStrategy |
पब्लिक मेथड
cleanEventsFiles
public void cleanEventsFiles ()
forwardAggregatedInvocationLogs
public final void forwardAggregatedInvocationLogs ()
इनवॉकेशन लेवल के सभी लॉग, नतीजों की जानकारी देने वाले उन लोगों को फ़ॉरवर्ड करें जो ज़्यादा जानकारी वाले नतीजों के साथ काम नहीं करते.
invocationEnded
public void invocationEnded (long elapsedTime)
यह रिपोर्ट करती है कि इनवॉकेशन खत्म हो गया है. भले ही, यह काम सही तरीके से हुआ हो या किसी गड़बड़ी की वजह से.
इसे TradeFederation फ़्रेमवर्क अपने-आप कॉल करेगा.
| पैरामीटर | |
|---|---|
elapsedTime |
long: फ़ंक्शन को कॉल करने में लगा समय, मिलीसेकंड में |
invocationFailed
public void invocationFailed (FailureDescription failure)
| पैरामीटर | |
|---|---|
failure |
FailureDescription |
invocationFailed
public void invocationFailed (Throwable cause)
किसी गड़बड़ी की वजह से, यह कुकी इनवोकेशन पूरा न होने की सूचना देती है.
इसे TradeFederation फ़्रेमवर्क अपने-आप कॉल करेगा.
| पैरामीटर | |
|---|---|
cause |
Throwable: Throwable की वजह से टेस्ट पूरा नहीं हो सका |
invocationSkipped
public void invocationSkipped (SkipReason reason)
इस फ़ंक्शन का इस्तेमाल, किसी इनवोकेशन को 'अभी नहीं' के तौर पर रिपोर्ट करने के लिए किया जाता है
| पैरामीटर | |
|---|---|
reason |
SkipReason |
invocationStarted
public void invocationStarted (IInvocationContext context)
यह कुकी, टेस्ट शुरू होने की जानकारी देती है.
इसे TradeFederation फ़्रेमवर्क अपने-आप कॉल करेगा. रिपोर्टर को इस तरीके को बदलना होगा, ताकि एक से ज़्यादा डिवाइसों से रिपोर्टिंग की जा सके.
| पैरामीटर | |
|---|---|
context |
IInvocationContext: शुरू करने के बारे में जानकारी |
logAssociation
public void logAssociation (String dataName,
LogFile logFile)कुछ मामलों में, लॉग को टेस्ट केस से जोड़ा जाना ज़रूरी होता है. हालांकि, सीधे testLogSaved(String,LogDataType,InputStreamSource,LogFile)
कॉलबैक पर ऐसा नहीं किया जा सकता. इसलिए, यह कॉलबैक साफ़ तौर पर एक मज़बूत असोसिएशन उपलब्ध कराने की अनुमति देता है.
| पैरामीटर | |
|---|---|
dataName |
String: डेटा का नाम |
logFile |
LogFile: वह LogFile जिसे पहले लॉग किया गया था और जिसे टेस्ट केस से जोड़ा जाना चाहिए. |
setUpdatedReporting
public void setUpdatedReporting (boolean updatedReporting)
यह कुकी, नई रिपोर्टिंग की सुविधा सेट करती है.
| पैरामीटर | |
|---|---|
updatedReporting |
boolean |
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, long endTime, HashMap<String, MetricMeasurement.Metric> testMetrics)
testEnded(TestDescription,Map) के बजाय, सीधे तौर पर इवेंट खत्म होने का समय बताने का विकल्प. सटीक मेज़रमेंट के लिए, इसे testStarted(TestDescription,long) के साथ जोड़ें.
| पैरामीटर | |
|---|---|
test |
TestDescription: इससे टेस्ट की पहचान होती है |
endTime |
long: टेस्ट के खत्म होने का समय, जिसे System.currentTimeMillis() के ज़रिए मेज़र किया जाता है |
testMetrics |
HashMap: भेजी गई मेट्रिक का 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: इससे टेस्ट की पहचान होती है |
testLog
public void testLog (String dataName,
LogDataType dataType,
InputStreamSource dataStream)| पैरामीटर | |
|---|---|
dataName |
String |
dataType |
LogDataType |
dataStream |
InputStreamSource |
testLogSaved
public void testLogSaved (String dataName,
LogDataType dataType,
InputStreamSource dataStream,
LogFile logFile)| पैरामीटर | |
|---|---|
dataName |
String |
dataType |
LogDataType |
dataStream |
InputStreamSource |
logFile |
LogFile |
testModuleEnded
public void testModuleEnded ()
यह कुकी, मॉड्यूल के रन के खत्म होने की जानकारी देती है.
testModuleStarted
public void testModuleStarted (IInvocationContext moduleContext)
यह कुकी, मॉड्यूल के चलने की शुरुआत की जानकारी देती है. यह कॉलबैक, testModuleEnded() से जुड़ा है. साथ ही, यह क्रम में ज़रूरी नहीं है. इसका इस्तेमाल सिर्फ़ ऐसे रन के दौरान किया जाता है जो मॉड्यूल का इस्तेमाल करते हैं: सुइट आधारित रनर.
| पैरामीटर | |
|---|---|
moduleContext |
IInvocationContext: मॉड्यूल का IInvocationContext. |
testRunEnded
public void testRunEnded (long elapsedTime,
HashMap<String, MetricMeasurement.Metric> runMetrics)यह कुकी, टेस्ट रन के खत्म होने की जानकारी देती है. FIXME: We cannot have two Map<> interfaces with different type, so we have to use HashMap here.
| पैरामीटर | |
|---|---|
elapsedTime |
long: डिवाइस ने मिलीसेकंड में बीता हुआ समय रिपोर्ट किया |
runMetrics |
HashMap: Metric के साथ टेस्ट रन के आखिर में रिपोर्ट किए गए की-वैल्यू पेयर. |
testRunFailed
public void testRunFailed (FailureDescription failure)
FailureDescription की वजह से, रिपोर्ट टेस्ट रन पूरा नहीं हो सका.
| पैरामीटर | |
|---|---|
failure |
FailureDescription: FailureDescription में गड़बड़ी और उसके संदर्भ के बारे में बताया गया हो. |
testRunFailed
public void testRunFailed (String errorMessage)
गंभीर गड़बड़ी की वजह से, रिपोर्ट के टेस्ट रन को पूरा नहीं किया जा सका.
| पैरामीटर | |
|---|---|
errorMessage |
String: String, रन फ़ेल होने की वजह के बारे में बताता है. |
testRunStarted
public void testRunStarted (String name,
int testCount,
int attemptNumber,
long startTime)यह कुकी, टेस्ट रन शुरू होने की जानकारी देती है.
| पैरामीटर | |
|---|---|
name |
String: टेस्ट रन का नाम |
testCount |
int: टेस्ट रन में कुल टेस्ट की संख्या |
attemptNumber |
int: ऑर्डर नंबर, जो एक ही runName
के अलग-अलग प्रयासों की पहचान करता है. यह कई बार चलता है. attemptNumber, 0 से शुरू होता है और हर बार नया रन होने पर इसे बढ़ाना चाहिए. उदाहरण के लिए, अगर किसी टेस्ट को तीन बार फिर से चलाया जाता है, तो उसे एक ही runName के तहत कुल चार बार चलाया जाना चाहिए. साथ ही, attemptNumber 0 से 3 तक होना चाहिए. |
startTime |
long: दौड़ शुरू होने का समय, जिसे System.currentTimeMillis() के ज़रिए मेज़र किया जाता है |
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() के ज़रिए मेज़र किया जाता है |
प्रोटेक्टेड मेथड
getEventsLogs
protected File[] getEventsLogs ()
| रिटर्न | |
|---|---|
File[] |
|