कलेक्टिंगटेस्टलिसनर
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)
'एग्रीगेट मेट्रिक' को टॉगल करें विकल्प |
सार्वजनिक कंस्ट्रक्टर
कलेक्टिंगटेस्टलिसनर
public CollectingTestListener ()
सार्वजनिक तरीके
GetBuildInfo
public IBuildInfo getBuildInfo ()
यह तरीका अब काम नहीं करता.
अभी तक किसी भी व्यक्ति ने चेक इन नहीं किया है
getInvocationContext()
के IBuildInfo
पर निर्भर होते हैं.
बिल्ड की जानकारी दिखाता है.
रिटर्न | |
---|---|
IBuildInfo |
getCurrentRun इसके नतीजे
public TestRunResult getCurrentRunResults ()
मौजूदा टेस्ट के नतीजे फ़ेच करता है.
ध्यान दें, हो सकता है कि नतीजे पूरे न हों. हमारा सुझाव है कि आप TestRunResult.isRunComplete()
और/या (@link TestRunresults#isRunFailure()} वैल्यू की जांच ज़रूरत के हिसाब से करें
पर क्लिक करें.
रिटर्न | |
---|---|
TestRunResult |
TestRunResult , जो पिछली बार किए गए टेस्ट के दौरान इकट्ठा किए गए डेटा को दिखाता है
|
उम्मीद के मुताबिक टेस्ट पाएं
public int getExpectedTests ()
अनुमानित टेस्ट की संख्या दिखाता है. getNumTotalTests()
से अलग हो सकता है, अगर
कुछ टेस्ट नहीं चलाए जा सके.
रिटर्न | |
---|---|
int |
गेट इनवोकेशन कॉन्टेक्स्ट
public IInvocationContext getInvocationContext ()
बातचीत शुरू करने का वह कॉन्टेक्स्ट दिखाएं जिसे invocationStarted(com.android.tradefed.invoker.IInvocationContext)
से रिपोर्ट किया गया था
रिटर्न | |
---|---|
IInvocationContext |
getMergedTestRun इसके नतीजे
publicgetMergedTestRunResults ()
अलग-अलग जगहों पर चलाए जाने के लिए, नतीजों का मर्ज किया गया संग्रह दिखाएं.
अगर एक से ज़्यादा नतीजे हैं, तो हर जांच को नए टेस्ट नतीजे के साथ मर्ज किया जाता है यह डेटा प्रोसेस किया जा सकता है. टेस्ट रन को, कोशिश की संख्या के हिसाब से क्रम में लगाया जाता है.
aggregate-metrics
की सेट की गई प्राथमिकता के आधार पर, एक ही कोशिश के लिए मेट्रिक मर्ज कर दी जाएंगी. आखिरी मेट्रिक, आखिरी कोशिश की मेट्रिक होंगी.
रिटर्न | |
---|---|
|
getmodeeContextForRunresults
public IInvocationContext getModuleContextForRunResult (String testRunName)
यह फ़ंक्शन नतीजों से जुड़े मॉड्यूल का IInvocationContext
दिखाता है.
पैरामीटर | |
---|---|
testRunName |
String : नाम {testRunStarted(String, int) . |
रिटर्न | |
---|---|
IInvocationContext |
किसी दिए गए टेस्ट रन नेम null के लिए, मॉड्यूल का IInvocationContext
अगर उस नाम के लिए कोई नतीजा नहीं है.
|
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 |
GetRun इसके नतीजे
publicgetRunResults ()
यह तरीका अब काम नहीं करता.
अभी तक किसी भी व्यक्ति ने चेक इन नहीं किया है
getMergedTestRunResults()
का इस्तेमाल करें
यह फ़ंक्शन सभी टेस्ट के नतीजे दिखाता है.
रिटर्न | |
---|---|
|
GetTestRunAt हटाएँ
public TestRunResult getTestRunAtAttempt (String testRunName, int attempt)
एक बार में TestRunResult
वापस करें.
पैरामीटर | |
---|---|
testRunName |
String : नाम {testRunStarted(String, int) . |
attempt |
int : कोशिश आईडी. |
रिटर्न | |
---|---|
TestRunResult |
दिए गए नाम और कोशिश आईडी का TestRunResult या अगर null
मौजूद नहीं है.
|
getTestRun प्रयासCount
public int getTestRunAttemptCount (String testRunName)
दिए गए टेस्ट रन नेम के लिए, कोशिशों की संख्या दिखाता है.
पैरामीटर | |
---|---|
testRunName |
String : नाम {testRunStarted(String, int) .
|
रिटर्न | |
---|---|
int |
getTestRun दिएs
publicgetTestRunAttempts (String testRunName)
दिए गए टेस्ट रन के TestRunResult
के लिए सभी मौके मिलते हैं.
पैरामीटर | |
---|---|
testRunName |
String : नाम {testRunStarted(String, int) . |
रिटर्न | |
---|---|
|
किसी दिए गए टेस्ट रन के लिए, सभी TestRunResult . इनको कोशिशों के हिसाब से क्रम में लगाया जाएगा.
|
getTestRunFor प्रयासs
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 |
शुरू होने का समय खत्म
public void invocationEnded (long elapsedTime)
पैरामीटर | |
---|---|
elapsedTime |
long |
शुरू करने में समस्या
public void invocationFailed (Throwable cause)
पैरामीटर | |
---|---|
cause |
Throwable |
शुरू किया गया
public void invocationStarted (IInvocationContext context)
पैरामीटर | |
---|---|
context |
IInvocationContext |
लॉगअसोसिएशन
public void logAssociation (String dataName, LogFile logFile)
पैरामीटर | |
---|---|
dataName |
String |
logFile |
LogFile |
सेटबिल्डजानकारी
public void setBuildInfo (IBuildInfo buildInfo)
यह तरीका अब काम नहीं करता.
अभी तक किसी भी व्यक्ति ने चेक इन नहीं किया है
अब टेस्टिंग के लिए ज़रूरी नहीं है.
बिल्ड की जानकारी सेट करें. इसका इस्तेमाल सिर्फ़ जांच के लिए किया जाना चाहिए.
पैरामीटर | |
---|---|
buildInfo |
IBuildInfo |
सेटमर्जस्ट्रैटजी
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 |
परीक्षण खत्म
public void testEnded (TestDescription test, long endTime,testMetrics)
पैरामीटर | |
---|---|
test |
TestDescription |
endTime |
long |
testMetrics |
|
परीक्षण खत्म
public void testEnded (TestDescription test,testMetrics)
पैरामीटर | |
---|---|
test |
TestDescription |
testMetrics |
|
जांच नहीं की जा सकी
public void testFailed (TestDescription test, FailureDescription failure)
पैरामीटर | |
---|---|
test |
TestDescription |
failure |
FailureDescription |
जांच नहीं की जा सकी
public void testFailed (TestDescription test, String trace)
पैरामीटर | |
---|---|
test |
TestDescription |
trace |
String |
जांच के लिए अनदेखा किया गया
public void testIgnored (TestDescription test)
पैरामीटर | |
---|---|
test |
TestDescription |
परीक्षण मॉड्यूल खत्म
public void testModuleEnded ()
परीक्षण मॉड्यूल शुरू किया गया
public void testModuleStarted (IInvocationContext moduleContext)
पैरामीटर | |
---|---|
moduleContext |
IInvocationContext |
testRunEnded
public void testRunEnded (long elapsedTime,runMetrics)
पैरामीटर | |
---|---|
elapsedTime |
long |
runMetrics |
|
परीक्षणरन विफल
public void testRunFailed (FailureDescription failure)
पैरामीटर | |
---|---|
failure |
FailureDescription |
परीक्षणरन विफल
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 |
परीक्षण रन बंद
public void testRunStopped (long elapsedTime)
पैरामीटर | |
---|---|
elapsedTime |
long |
परीक्षण प्रारंभ
public void testStarted (TestDescription test, long startTime)
पैरामीटर | |
---|---|
test |
TestDescription |
startTime |
long |
परीक्षण प्रारंभ
public void testStarted (TestDescription test)
पैरामीटर | |
---|---|
test |
TestDescription |
सुरक्षित तरीके
क्लीयरमॉड्यूललॉग फ़ाइलें
protected final void clearModuleLogFiles ()
मॉड्यूल फ़ाइल को साफ़ करने की अनुमति देता है, ताकि हम उन्हें लंबे समय तक रखने से बचें.
क्लियरनतीजे फ़ॉरनाम
protected final void clearResultsForName (String testRunName)
दिए गए रन नेम के लिए, नतीजे हटाने की सुविधा देता है. इसका इस्तेमाल सिर्फ़ कुछ मामलों में ही किया जाना चाहिए, जैसे कि नतीजों का एग्रीगेटर.
पैरामीटर | |
---|---|
testRunName |
String |
सेटआइएग्रीगेट मेट्रिक्स
protected void setIsAggregrateMetrics (boolean aggregate)
'एग्रीगेट मेट्रिक' को टॉगल करें विकल्प
पैरामीटर | |
---|---|
aggregate |
boolean |