EventsLoggerListener
public
class
EventsLoggerListener
extends Object
implements
ILogSaverListener
| java.lang.Object | |
| ↳ | com.android.tradefed.result.EventsLoggerListener |
यह लिसनर, इसे मिलने वाले सभी इवेंट को किसी फ़ाइल में लॉग करता है
खास जानकारी
सार्वजनिक कंस्ट्रक्टर | |
|---|---|
EventsLoggerListener(String name)
|
|
पब्लिक मेथड | |
|---|---|
File
|
getLoggedEvents()
|
void
|
invocationEnded(long elapsedTime)
यह रिपोर्ट करती है कि इनवॉकेशन खत्म हो गया है. भले ही, यह काम सही तरीके से हुआ हो या किसी गड़बड़ी की वजह से. |
void
|
invocationFailed(FailureDescription failure)
किसी गड़बड़ी की वजह से, यह कुकी इनवोकेशन पूरा न होने की सूचना देती है. |
void
|
invocationSkipped(SkipReason reason)
इस फ़ंक्शन का इस्तेमाल, किसी इनवोकेशन को 'अभी नहीं' के तौर पर रिपोर्ट करने के लिए किया जाता है |
void
|
invocationStarted(IInvocationContext context)
यह कुकी, टेस्ट शुरू होने की जानकारी देती है. |
void
|
logAssociation(String dataName, LogFile logFile)
कुछ मामलों में, लॉग को टेस्ट केस से जोड़ा जाना ज़रूरी होता है. हालांकि, सीधे |
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
|
testModuleEnded()
यह कुकी, मॉड्यूल के रन के खत्म होने की जानकारी देती है. |
void
|
testModuleStarted(IInvocationContext moduleContext)
यह कुकी, मॉड्यूल के चलने की शुरुआत की जानकारी देती है. |
void
|
testRunEnded(long elapsedTimeMillis, HashMap<String, MetricMeasurement.Metric> runMetrics)
यह कुकी, टेस्ट रन के खत्म होने की जानकारी देती है. |
void
|
testRunFailed(FailureDescription failure)
|
void
|
testRunFailed(String errorMessage)
गंभीर गड़बड़ी की वजह से, रिपोर्ट के टेस्ट रन को पूरा नहीं किया जा सका. |
void
|
testRunStarted(String runName, int testCount, int attemptNumber)
यह कुकी, टेस्ट रन शुरू होने की जानकारी देती है. |
void
|
testRunStarted(String runName, int testCount)
यह कुकी, टेस्ट रन शुरू होने की जानकारी देती है. |
void
|
testRunStarted(String runName, int testCount, int attemptNumber, long startTime)
यह कुकी, टेस्ट रन शुरू होने की जानकारी देती है. |
void
|
testSkipped(TestDescription test, SkipReason reason)
इस फ़ंक्शन को तब कॉल किया जाता है, जब किसी टेस्ट को स्किप किया जाता है और उसे किसी ऐसी वजह से लागू नहीं किया जाता जिसकी आम तौर पर उम्मीद नहीं होती. |
void
|
testStarted(TestDescription test, long startTime)
|
सार्वजनिक कंस्ट्रक्टर
EventsLoggerListener
public EventsLoggerListener (String name)
| पैरामीटर | |
|---|---|
name |
String |
पब्लिक मेथड
getLoggedEvents
public File getLoggedEvents ()
| रिटर्न | |
|---|---|
File |
|
invocationEnded
public void invocationEnded (long elapsedTime)
यह रिपोर्ट करती है कि इनवॉकेशन खत्म हो गया है. भले ही, यह काम सही तरीके से हुआ हो या किसी गड़बड़ी की वजह से.
इसे TradeFederation फ़्रेमवर्क अपने-आप कॉल करेगा.
| पैरामीटर | |
|---|---|
elapsedTime |
long: फ़ंक्शन को कॉल करने में लगा समय, मिलीसेकंड में |
invocationFailed
public void invocationFailed (FailureDescription failure)
किसी गड़बड़ी की वजह से, यह कुकी इनवोकेशन पूरा न होने की सूचना देती है.
इसे TradeFederation फ़्रेमवर्क अपने-आप कॉल करेगा.
| पैरामीटर | |
|---|---|
failure |
FailureDescription: FailureDescription, जिसमें अनुरोध पूरा न होने की वजह बताई गई है |
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 जिसे पहले लॉग किया गया था और जिसे टेस्ट केस से जोड़ा जाना चाहिए. |
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: इससे टेस्ट की पहचान होती है |
testModuleEnded
public void testModuleEnded ()
यह कुकी, मॉड्यूल के रन के खत्म होने की जानकारी देती है.
testModuleStarted
public void testModuleStarted (IInvocationContext moduleContext)
यह कुकी, मॉड्यूल के चलने की शुरुआत की जानकारी देती है. यह कॉलबैक, testModuleEnded() से जुड़ा है. साथ ही, यह क्रम में ज़रूरी नहीं है. इसका इस्तेमाल सिर्फ़ ऐसे रन के दौरान किया जाता है जो मॉड्यूल का इस्तेमाल करते हैं: सुइट आधारित रनर.
| पैरामीटर | |
|---|---|
moduleContext |
IInvocationContext: मॉड्यूल का IInvocationContext. |
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 के साथ टेस्ट रन के आखिर में रिपोर्ट किए गए की-वैल्यू पेयर. |
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() के ज़रिए मेज़र किया जाता है |
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() के ज़रिए मेज़र किया जाता है |