CollectingTestListener
public
class
CollectingTestListener
extends Object
implements
ITestInvocationListener,
ILogSaverListener
java.lang.Object | |
↳ | com.android.tradefed.result.CollectingTestListener |
एक ITestInvocationListener
, जो टेस्ट के सभी नतीजे इकट्ठा करेगा.
इस ऑब्जेक्ट में इस्तेमाल किए गए डेटा स्ट्रक्चर, थ्रेड-सेफ़ होते हैं. हालांकि, ITestInvocationListener
कॉलबैक को सही क्रम में कॉल किया जाना चाहिए.
खास जानकारी
पब्लिक कंस्ट्रक्टर | |
---|---|
CollectingTestListener()
|
सार्वजनिक तरीके | |
---|---|
IBuildInfo
|
getBuildInfo()
इस तरीके का इस्तेमाल नहीं किया जा सकता.
|
TestRunResult
|
getCurrentRunResults()
मौजूदा टेस्ट रन के नतीजे दिखाता है. |
int
|
getExpectedTests()
अनुमानित टेस्ट की संख्या दिखाता है. |
IInvocationContext
|
getInvocationContext()
|
|
getMergedTestRunResults()
अलग-अलग कोशिशों के सभी रन के नतीजों का मर्ज किया गया कलेक्शन दिखाता है. |
IInvocationContext
|
getModuleContextForRunResult(String testRunName)
नतीजों से जुड़े मॉड्यूल का |
MultiMap<String, LogFile>
|
getModuleLogFiles()
इस फ़ंक्शन से, उस मैप की कॉपी मिलती है जिसमें मॉड्यूल से जुड़ी सभी लॉग की गई फ़ाइलें होती हैं |
MultiMap<String, LogFile>
|
getNonAssociatedLogFiles()
मैप की एक कॉपी दिखाता है. इसमें, टेस्ट रन या किसी मॉड्यूल से जुड़ी सभी लॉग की गई फ़ाइलें शामिल नहीं होती हैं. |
int
|
getNumAllFailedTestRuns()
गड़बड़ी की स्थिति में टेस्ट रन की कुल संख्या दिखाता है |
int
|
getNumAllFailedTests()
गड़बड़ी की स्थिति में मौजूद टेस्ट की कुल संख्या दिखाता है. इसमें सिर्फ़ गड़बड़ी वाली टेस्ट की गिनती की जाती है, न कि गलत अनुमान की गिनती की जाती है. |
int
|
getNumTestsInState(TestResult.TestStatus status)
इस रन के लिए, दी गई स्थिति में मौजूद टेस्ट की संख्या दिखाता है. |
int
|
getNumTotalTests()
सभी रन के लिए, पूरे किए गए टेस्ट की कुल संख्या दिखाता है. |
IBuildInfo
|
getPrimaryBuildInfo()
|
|
getRunResults()
इस तरीके का इस्तेमाल नहीं किया जा सकता.
|
TestRunResult
|
getTestRunAtAttempt(String testRunName, int attempt)
एक बार कोशिश करने के लिए |
int
|
getTestRunAttemptCount(String testRunName)
किसी टेस्ट रन के नाम के लिए, कोशिशों की संख्या दिखाता है. |
|
getTestRunAttempts(String testRunName)
किसी टेस्ट रन के |
|
getTestRunForAttempts(int attempt)
किसी दिए गए प्रयास के लिए सभी नतीजे पाता है. |
|
getTestRunNames()
सभी टेस्ट रन के लिए सभी नाम दिखाता है. |
boolean
|
hasFailedTests()
यह बताता है कि क्या अनुरोध में कोई ऐसी जांच शामिल थी जो पूरी नहीं हुई या जिसकी पुष्टि नहीं हुई. |
boolean
|
hasTestRunResultsForName(String testRunName)
यह बताता है कि किसी टेस्ट रन के नाम से कोई नतीजा मिलता है या नहीं. |
void
|
invocationEnded(long elapsedTime)
|
void
|
invocationFailed(Throwable cause)
|
void
|
invocationStarted(IInvocationContext context)
|
void
|
logAssociation(String dataName, LogFile logFile)
|
void
|
setBuildInfo(IBuildInfo buildInfo)
इस तरीके का इस्तेमाल नहीं किया जा सकता. अब टेस्टिंग के लिए ज़रूरी नहीं है. |
void
|
setMergeStrategy(MergeStrategy strategy)
नतीजों को मर्ज करते समय इस्तेमाल करने के लिए |
void
|
testAssumptionFailure(TestDescription test, String trace)
|
void
|
testAssumptionFailure(TestDescription test, FailureDescription failure)
|
void
|
testEnded(TestDescription test, long endTime,
|
void
|
testEnded(TestDescription test,
|
void
|
testFailed(TestDescription test, FailureDescription failure)
|
void
|
testFailed(TestDescription test, String trace)
|
void
|
testIgnored(TestDescription test)
|
void
|
testModuleEnded()
|
void
|
testModuleStarted(IInvocationContext moduleContext)
|
void
|
testRunEnded(long elapsedTime,
|
void
|
testRunFailed(FailureDescription failure)
|
void
|
testRunFailed(String errorMessage)
|
void
|
testRunStarted(String name, int numTests, int attemptNumber)
|
void
|
testRunStarted(String name, int numTests)
|
void
|
testRunStarted(String name, int numTests, int attemptNumber, long startTime)
|
void
|
testRunStopped(long elapsedTime)
|
void
|
testStarted(TestDescription test, long startTime)
|
void
|
testStarted(TestDescription test)
|
सुरक्षित तरीके | |
---|---|
final
void
|
clearModuleLogFiles()
मॉड्यूल फ़ाइल को साफ़ करने की अनुमति देता है, ताकि हम उन्हें ज़्यादा समय तक न रखें. |
final
void
|
clearResultsForName(String testRunName)
इससे किसी रन के नाम के लिए नतीजे मिटाए जा सकते हैं. |
void
|
setIsAggregrateMetrics(boolean aggregate)
'एग्रीगेट मेट्रिक' विकल्प को टॉगल करना |
पब्लिक कंस्ट्रक्टर
CollectingTestListener
public CollectingTestListener ()
सार्वजनिक तरीके
getBuildInfo
public IBuildInfo getBuildInfo ()
इस तरीके का इस्तेमाल नहीं किया जा सकता.
getInvocationContext()
से IBuildInfo
पर भरोसा करें.
बिल्ड की जानकारी दिखाता है.
रिटर्न | |
---|---|
IBuildInfo |
getCurrentRunResults
public TestRunResult getCurrentRunResults ()
मौजूदा टेस्ट रन के नतीजे दिखाता है.
ध्यान दें कि हो सकता है कि नतीजे पूरे न हों. हमारा सुझाव है कि नतीजों को प्रोसेस करने से पहले, TestRunResult.isRunComplete()
और/या (@link TestRunResult#isRunFailure()} की वैल्यू की जांच करें.
रिटर्न | |
---|---|
TestRunResult |
TestRunResult , पिछले टेस्ट रन के दौरान इकट्ठा किए गए डेटा को दिखाता है
|
getExpectedTests
public int getExpectedTests ()
अनुमानित टेस्ट की संख्या दिखाता है. अगर कुछ टेस्ट नहीं चले, तो यह getNumTotalTests()
से अलग हो सकता है.
रिटर्न | |
---|---|
int |
getInvocationContext
public IInvocationContext getInvocationContext ()
invocationStarted(com.android.tradefed.invoker.IInvocationContext)
के ज़रिए रिपोर्ट किया गया, ट्रिगर करने का कॉन्टेक्स्ट दिखाता है
रिटर्न | |
---|---|
IInvocationContext |
getMergedTestRunResults
publicgetMergedTestRunResults ()
अलग-अलग कोशिशों के सभी रन के नतीजों का मर्ज किया गया कलेक्शन दिखाता है.
अगर एक से ज़्यादा नतीजे हैं, तो हर टेस्ट रन को मर्ज कर दिया जाता है. साथ ही, नया टेस्ट नतीजा, पिछले टेस्ट के नतीजों को ओवरराइट कर देता है. टेस्ट रन को कोशिश की संख्या के हिसाब से क्रम में लगाया जाता है.
एक ही कोशिश की मेट्रिक, aggregate-metrics
की सेट की गई प्राथमिकता के आधार पर मर्ज हो जाएंगी. आखिरी मेट्रिक, आखिरी कोशिश की मेट्रिक होंगी.
रिटर्न | |
---|---|
|
getModuleContextForRunResult
public IInvocationContext getModuleContextForRunResult (String testRunName)
नतीजों से जुड़े मॉड्यूल का IInvocationContext
दिखाता है.
पैरामीटर | |
---|---|
testRunName |
String : {testRunStarted(String, int) ने जो नाम दिया है. |
रिटर्न | |
---|---|
IInvocationContext |
किसी टेस्ट रन के नाम के लिए मॉड्यूल का IInvocationContext null
अगर उस नाम के लिए कोई नतीजा नहीं मिलता है.
|
getModuleLogFiles
public MultiMap<String, LogFile> getModuleLogFiles ()
इस फ़ंक्शन से, उस मैप की कॉपी मिलती है जिसमें मॉड्यूल से जुड़ी सभी लॉग की गई फ़ाइलें होती हैं
रिटर्न | |
---|---|
MultiMap<String, LogFile> |
getNonAssociatedLogFiles
public MultiMap<String, LogFile> getNonAssociatedLogFiles ()
मैप की एक कॉपी दिखाता है. इसमें, लॉग की गई ऐसी सभी फ़ाइलें शामिल होती हैं जो किसी टेस्ट रन या मॉड्यूल से नहीं जुड़ी होती हैं.
रिटर्न | |
---|---|
MultiMap<String, LogFile> |
getNumAllFailedTestRuns
public int getNumAllFailedTestRuns ()
गड़बड़ी की स्थिति में टेस्ट रन की कुल संख्या दिखाता है
रिटर्न | |
---|---|
int |
getNumAllFailedTests
public int getNumAllFailedTests ()
गड़बड़ी की स्थिति में मौजूद टेस्ट की कुल संख्या दिखाता है. इसमें सिर्फ़ गड़बड़ी वाली टेस्ट की गिनती की जाती है, न कि गलत अनुमान की गिनती की जाती है.
रिटर्न | |
---|---|
int |
getNumTestsInState
public int getNumTestsInState (TestResult.TestStatus status)
इस रन के लिए, दी गई स्थिति में मौजूद टेस्ट की संख्या दिखाता है.
पैरामीटर | |
---|---|
status |
TestResult.TestStatus |
रिटर्न | |
---|---|
int |
getNumTotalTests
public int getNumTotalTests ()
सभी रन के लिए, पूरे किए गए टेस्ट की कुल संख्या दिखाता है.
रिटर्न | |
---|---|
int |
getPrimaryBuildInfo
public IBuildInfo getPrimaryBuildInfo ()
invocationStarted(com.android.tradefed.invoker.IInvocationContext)
के ज़रिए रिपोर्ट की गई, प्राइमरी बिल्ड की जानकारी दिखाता है. प्राइमरी बिल्ड, चल रहे कॉन्फ़िगरेशन के पहले बिल्ड प्रोवाइडर से मिलने वाला बिल्ड होता है. अगर कोई संदर्भ नहीं है, तो यह फ़ंक्शन शून्य दिखाता है. इसका मतलब है कि जांच के लिए कोई बिल्ड नहीं है.
रिटर्न | |
---|---|
IBuildInfo |
getRunResults
publicgetRunResults ()
इस तरीके का इस्तेमाल नहीं किया जा सकता.
getMergedTestRunResults()
का इस्तेमाल करना
टेस्ट के सभी रन के नतीजे दिखाता है.
रिटर्न | |
---|---|
|
getTestRunAtAttempt
public TestRunResult getTestRunAtAttempt (String testRunName, int attempt)
एक बार कोशिश करने के लिए TestRunResult
दिखाएं.
पैरामीटर | |
---|---|
testRunName |
String : {testRunStarted(String, int) ने जो नाम दिया है. |
attempt |
int : कोशिश का आईडी. |
रिटर्न | |
---|---|
TestRunResult |
दिए गए नाम और कोशिश के आईडी के लिए TestRunResult या अगर यह मौजूद नहीं है, तो null .
|
getTestRunAttemptCount
public int getTestRunAttemptCount (String testRunName)
किसी टेस्ट रन के नाम के लिए, कोशिशों की संख्या दिखाता है.
पैरामीटर | |
---|---|
testRunName |
String : {testRunStarted(String, int) ने जो नाम दिया है.
|
रिटर्न | |
---|---|
int |
getTestRunAttempts
publicgetTestRunAttempts (String testRunName)
किसी टेस्ट रन के TestRunResult
के लिए किए गए सभी प्रयासों की जानकारी मिलती है.
पैरामीटर | |
---|---|
testRunName |
String : {testRunStarted(String, int) ने जो नाम दिया है. |
रिटर्न | |
---|---|
|
किसी टेस्ट रन के लिए सभी TestRunResult , कोशिशों के हिसाब से क्रम में लगाए गए.
|
getTestRunForAttempts
publicgetTestRunForAttempts (int attempt)
किसी दिए गए प्रयास के लिए सभी नतीजे पाता है.
पैरामीटर | |
---|---|
attempt |
int : वह कोशिश जिसके लिए हमें नतीजे चाहिए. |
रिटर्न | |
---|---|
|
किसी एक कोशिश के लिए सभी TestRunResult .
|
getTestRunNames
publicgetTestRunNames ()
सभी टेस्ट रन के लिए सभी नाम दिखाता है.
हो सकता है कि ये टेस्ट अलग-अलग कोशिशों के साथ कई बार चलाए गए हों.
रिटर्न | |
---|---|
|
hasFailedTests
public boolean hasFailedTests ()
यह बताता है कि क्या अनुरोध में कोई ऐसी जांच शामिल थी जो पूरी नहीं हुई या जिसकी पुष्टि नहीं हुई.
रिटर्न | |
---|---|
boolean |
hasTestRunResultsForName
public boolean hasTestRunResultsForName (String testRunName)
यह बताता है कि किसी टेस्ट रन के नाम से कोई नतीजा मिलता है या नहीं.
पैरामीटर | |
---|---|
testRunName |
String : {testRunStarted(String, int) ने जो नाम दिया है.
|
रिटर्न | |
---|---|
boolean |
invocationEnded
public void invocationEnded (long elapsedTime)
पैरामीटर | |
---|---|
elapsedTime |
long |
invocationFailed
public void invocationFailed (Throwable cause)
पैरामीटर | |
---|---|
cause |
Throwable |
invocationStarted
public void invocationStarted (IInvocationContext context)
पैरामीटर | |
---|---|
context |
IInvocationContext |
logAssociation
public void logAssociation (String dataName, LogFile logFile)
पैरामीटर | |
---|---|
dataName |
String |
logFile |
LogFile |
setBuildInfo
public void setBuildInfo (IBuildInfo buildInfo)
इस तरीके का इस्तेमाल नहीं किया जा सकता.
अब टेस्टिंग के लिए ज़रूरी नहीं है.
बिल्ड की जानकारी सेट करें. इसका इस्तेमाल सिर्फ़ टेस्टिंग के लिए किया जाना चाहिए.
पैरामीटर | |
---|---|
buildInfo |
IBuildInfo |
setMergeStrategy
public void setMergeStrategy (MergeStrategy strategy)
नतीजों को मर्ज करते समय इस्तेमाल करने के लिए MergeStrategy
सेट करता है.
पैरामीटर | |
---|---|
strategy |
MergeStrategy |
testAssumptionFailure
public void testAssumptionFailure (TestDescription test, String trace)
पैरामीटर | |
---|---|
test |
TestDescription |
trace |
String |
testAssumptionFailure
public void testAssumptionFailure (TestDescription test, FailureDescription failure)
पैरामीटर | |
---|---|
test |
TestDescription |
failure |
FailureDescription |
testEnded
public void testEnded (TestDescription test, long endTime,testMetrics)
पैरामीटर | |
---|---|
test |
TestDescription |
endTime |
long |
testMetrics |
|
testEnded
public void testEnded (TestDescription test,testMetrics)
पैरामीटर | |
---|---|
test |
TestDescription |
testMetrics |
|
testFailed
public void testFailed (TestDescription test, FailureDescription failure)
पैरामीटर | |
---|---|
test |
TestDescription |
failure |
FailureDescription |
testFailed
public void testFailed (TestDescription test, String trace)
पैरामीटर | |
---|---|
test |
TestDescription |
trace |
String |
testIgnored
public void testIgnored (TestDescription test)
पैरामीटर | |
---|---|
test |
TestDescription |
testModuleEnded
public void testModuleEnded ()
testModuleStarted
public void testModuleStarted (IInvocationContext moduleContext)
पैरामीटर | |
---|---|
moduleContext |
IInvocationContext |
testRunEnded
public void testRunEnded (long elapsedTime,runMetrics)
पैरामीटर | |
---|---|
elapsedTime |
long |
runMetrics |
|
testRunFailed
public void testRunFailed (FailureDescription failure)
पैरामीटर | |
---|---|
failure |
FailureDescription |
testRunFailed
public void testRunFailed (String errorMessage)
पैरामीटर | |
---|---|
errorMessage |
String |
testRunStarted
public void testRunStarted (String name, int numTests, int attemptNumber)
पैरामीटर | |
---|---|
name |
String |
numTests |
int |
attemptNumber |
int |
testRunStarted
public void testRunStarted (String name, int numTests)
पैरामीटर | |
---|---|
name |
String |
numTests |
int |
testRunStarted
public void testRunStarted (String name, int numTests, int attemptNumber, long startTime)
पैरामीटर | |
---|---|
name |
String |
numTests |
int |
attemptNumber |
int |
startTime |
long |
testRunStopped
public void testRunStopped (long elapsedTime)
पैरामीटर | |
---|---|
elapsedTime |
long |
testStarted
public void testStarted (TestDescription test, long startTime)
पैरामीटर | |
---|---|
test |
TestDescription |
startTime |
long |
testStarted
public void testStarted (TestDescription test)
पैरामीटर | |
---|---|
test |
TestDescription |
सुरक्षित तरीके
clearModuleLogFiles
protected final void clearModuleLogFiles ()
मॉड्यूल फ़ाइल को साफ़ करने की अनुमति देता है, ताकि हम उन्हें बहुत लंबे समय तक न रखें.
clearResultsForName
protected final void clearResultsForName (String testRunName)
इससे किसी रन के नाम के लिए नतीजे मिटाए जा सकते हैं. इसका इस्तेमाल सिर्फ़ कुछ मामलों में किया जाना चाहिए, जैसे कि नतीजों को इकट्ठा करने के लिए.
पैरामीटर | |
---|---|
testRunName |
String |
setIsAggregrateMetrics
protected void setIsAggregrateMetrics (boolean aggregate)
'एग्रीगेट मेट्रिक' विकल्प को टॉगल करना
पैरामीटर | |
---|---|
aggregate |
boolean |