ModuleResultsAndMetricsForwarder
public
class
ModuleResultsAndMetricsForwarder
extends ResultAndLogForwarder
| java.lang.Object | |||
| ↳ | com.android.tradefed.result.ResultForwarder | ||
| ↳ | com.android.tradefed.result.ResultAndLogForwarder | ||
| ↳ | com.android.tradefed.result.ModuleResultsAndMetricsForwarder | ||
यह ResultAndLogForwarder का एक्सटेंशन है. यह टेस्ट के नतीजों में, मॉड्यूल से जुड़ी अतिरिक्त मेट्रिक जोड़ता है.
खास जानकारी
सार्वजनिक कंस्ट्रक्टर | |
|---|---|
ModuleResultsAndMetricsForwarder(ITestInvocationListener... listeners)
|
|
पब्लिक मेथड | |
|---|---|
void
|
setAttemptIsolation(CurrentInvocation.IsolationGrade isolation)
इससे यह सेट किया जाता है कि कोशिश को अलग तौर पर रिपोर्ट किया जाना चाहिए या नहीं. |
void
|
setMarkTestsSkipped(boolean skip)
सभी टेस्ट केस को स्किप के तौर पर मार्क करना है या नहीं. |
void
|
setModuleId(String moduleId)
|
void
|
setTestMappingSources(List<String> testMappingSources)
यह विकल्प, टेस्ट-मैपिंग के ऐसे सोर्स सेट करता है जिन्हें मेट्रिक में शामिल किया जाएगा. |
void
|
testEnded(TestDescription test, HashMap<String, MetricMeasurement.Metric> testMetrics)
यह कुकी, किसी टेस्ट केस के खत्म होने की जानकारी देती है. |
void
|
testEnded(TestDescription test, long endTime, HashMap<String, MetricMeasurement.Metric> testMetrics)
|
void
|
testFailed(TestDescription test, FailureDescription failure)
यह किसी टेस्ट केस के फ़ेल होने की जानकारी देता है. |
void
|
testFailed(TestDescription test, String trace)
यह किसी टेस्ट केस के फ़ेल होने की जानकारी देता है. |
void
|
testRunEnded(long elapsedTime, HashMap<String, MetricMeasurement.Metric> runMetrics)
यह कुकी, टेस्ट रन के खत्म होने की जानकारी देती है. |
void
|
testRunEnded(long elapsedTimeMillis, Map<String, String> runMetrics)
|
void
|
testRunFailed(FailureDescription failure)
|
void
|
testRunFailed(String errorMessage)
गंभीर गड़बड़ी की वजह से, रिपोर्ट के टेस्ट रन को पूरा नहीं किया जा सका. |
void
|
testRunStarted(String runName, int testCount, int attemptNumber)
यह कुकी, टेस्ट रन शुरू होने की जानकारी देती है. |
void
|
testRunStarted(String runName, int testCount, int attemptNumber, long startTime)
यह कुकी, टेस्ट रन शुरू होने की जानकारी देती है. |
void
|
testStarted(TestDescription test, long startTime)
|
void
|
testStarted(TestDescription test)
यह फ़ंक्शन, किसी टेस्ट केस के शुरू होने की जानकारी देता है. |
सार्वजनिक कंस्ट्रक्टर
ModuleResultsAndMetricsForwarder
public ModuleResultsAndMetricsForwarder (ITestInvocationListener... listeners)
| पैरामीटर | |
|---|---|
listeners |
ITestInvocationListener |
पब्लिक मेथड
setAttemptIsolation
public void setAttemptIsolation (CurrentInvocation.IsolationGrade isolation)
इससे यह सेट किया जाता है कि कोशिश को अलग तौर पर रिपोर्ट किया जाना चाहिए या नहीं.
| पैरामीटर | |
|---|---|
isolation |
CurrentInvocation.IsolationGrade |
setMarkTestsSkipped
public void setMarkTestsSkipped (boolean skip)
सभी टेस्ट केस को स्किप के तौर पर मार्क करना है या नहीं.
| पैरामीटर | |
|---|---|
skip |
boolean |
setModuleId
public void setModuleId (String moduleId)
| पैरामीटर | |
|---|---|
moduleId |
String |
setTestMappingSources
public void setTestMappingSources (List<String> testMappingSources)
यह विकल्प, टेस्ट-मैपिंग के ऐसे सोर्स सेट करता है जिन्हें मेट्रिक में शामिल किया जाएगा.
| पैरामीटर | |
|---|---|
testMappingSources |
List |
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, 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: गड़बड़ी का स्टैक ट्रेस |
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 के साथ टेस्ट रन के आखिर में रिपोर्ट किए गए की-वैल्यू पेयर. |
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,
int attemptNumber,
long startTime)यह कुकी, टेस्ट रन शुरू होने की जानकारी देती है.
| पैरामीटर | |
|---|---|
runName |
String: टेस्ट रन का नाम |
testCount |
int: टेस्ट रन में कुल टेस्ट की संख्या |
attemptNumber |
int: ऑर्डर नंबर, जो एक ही runName
के अलग-अलग प्रयासों की पहचान करता है. यह कई बार चलता है. attemptNumber, 0 से शुरू होता है और हर बार नया रन होने पर इसे बढ़ाना चाहिए. उदाहरण के लिए, अगर किसी टेस्ट को तीन बार फिर से चलाया जाता है, तो उसे एक ही runName के तहत कुल चार बार चलाया जाना चाहिए. साथ ही, attemptNumber 0 से 3 तक होना चाहिए. |
startTime |
long: दौड़ शुरू होने का समय, जिसे System.currentTimeMillis() के ज़रिए मेज़र किया जाता है |
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: इससे टेस्ट की पहचान होती है |