टेस्ट लिस्टनर एकत्रित करना
public class CollectingTestListener
extends Object
implements ITestInvocationListener, ILogSaverListener
java.lang.ऑब्जेक्ट | |
मैं | 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, testMetrics) testEnded (TestDescription test, long endTime, testMetrics) |
void | testEnded (TestDescription test, testMetrics) testEnded (TestDescription test, testMetrics) |
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, runMetrics) testRunEnded (long elapsedTime, runMetrics) |
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 ()
सार्वजनिक तरीके
गेटबिल्डइन्फो
public IBuildInfo getBuildInfo ()
यह विधि बहिष्कृत है।
पर भरोसा करते हैं IBuildInfo
से getInvocationContext()
बिल्ड जानकारी लौटाता है।
रिटर्न | |
---|---|
IBuildInfo |
getCurrentRunResults
public TestRunResult getCurrentRunResults ()
वर्तमान परीक्षण चलाने के लिए परिणाम प्राप्त करता है।
ध्यान दें कि परिणाम पूर्ण नहीं हो सकते हैं। यह के मूल्य का परीक्षण करने की सिफारिश की है TestRunResult.isRunComplete()
परिणाम प्रक्रिया से पहले और / या (@link TestRunResult # isRunFailure ()} के रूप में उपयुक्त।
रिटर्न | |
---|---|
TestRunResult | TestRunResult डेटा का प्रतिनिधित्व अंतिम परीक्षण चलाने के दौरान एकत्र |
अपेक्षित परीक्षण प्राप्त करें
public int getExpectedTests ()
अपेक्षित परीक्षणों की संख्या लौटाता है। से अलग किया जा सका getNumTotalTests()
करता है, तो कुछ परीक्षण नहीं चला था।
रिटर्न | |
---|---|
int |
इंवोकेशन कॉन्टेक्स्ट प्राप्त करें
public IInvocationContext getInvocationContext ()
लौटें मंगलाचरण संदर्भ कि के माध्यम से सूचना मिली थी invocationStarted(com.android.tradefed.invoker.IInvocationContext)
रिटर्न | |
---|---|
IInvocationContext |
मर्ज किए गए टेस्ट रन परिणाम प्राप्त करें
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> |
गैर-एसोसिएटेड लॉगफाइल प्राप्त करें
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 |
कुल कुल परीक्षण प्राप्त करें
public int getNumTotalTests ()
सभी रनों के लिए पूर्ण परीक्षणों की कुल संख्या देता है।
रिटर्न | |
---|---|
int |
getPrimaryBuildInfo
public IBuildInfo getPrimaryBuildInfo ()
प्राथमिक निर्माण की जानकारी है कि के माध्यम से सूचना मिली थी लौटें invocationStarted(com.android.tradefed.invoker.IInvocationContext)
। प्राइमरी बिल्ड वह बिल्ड है जो रनिंग कॉन्फ़िगरेशन के पहले बिल्ड प्रोवाइडर द्वारा लौटाया जाता है। यदि कोई संदर्भ नहीं है (बिल्ड टू टेस्ट केस) तो अशक्त लौटाता है।
रिटर्न | |
---|---|
IBuildInfo |
getRunResults
publicgetRunResults ()
यह विधि बहिष्कृत है।
का प्रयोग करें getMergedTestRunResults()
सभी टेस्ट रन के लिए परिणाम देता है।
रिटर्न | |
---|---|
getTestRunAttempt
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 |
getTestRunप्रयास
publicgetTestRunAttempts (String testRunName)
एक के लिए सभी प्रयास हो जाता है TestRunResult
किसी दिए गए परीक्षण चालन की।
मापदंडों | |
---|---|
testRunName | String : नाम {द्वारा दिए गए testRunStarted(String, int) । |
रिटर्न | |
---|---|
सभी TestRunResult किसी दिए गए परीक्षण चालन के लिए, प्रयास द्वारा आदेश दिया। |
GetTestRunForAttempts
publicgetTestRunForAttempts (int attempt)
किसी दिए गए प्रयास के लिए सभी परिणाम प्राप्त करता है।
मापदंडों | |
---|---|
attempt | int : प्रयास हम के लिए परिणाम चाहते हैं। |
रिटर्न | |
---|---|
सभी TestRunResult किसी दिए गए प्रयास के लिए। |
GetTestRunNames
publicgetTestRunNames ()
सभी टेस्ट रन के लिए सभी नाम लौटाएं।
ये परीक्षण रन अलग-अलग प्रयासों के साथ कई बार चल सकते हैं।
रिटर्न | |
---|---|
हैअसफल परीक्षण
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 |
परीक्षण धारणाविफलता
public void testAssumptionFailure (TestDescription test, String trace)
मापदंडों | |
---|---|
test | TestDescription |
trace | String |
परीक्षण धारणाविफलता
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 |
टेस्टरनसमाप्त
public void testRunEnded (long elapsedTime,runMetrics)
मापदंडों | |
---|---|
elapsedTime | long |
runMetrics |
टेस्टरनविफल
public void testRunFailed (FailureDescription failure)
मापदंडों | |
---|---|
failure | FailureDescription |
टेस्टरनविफल
public void testRunFailed (String errorMessage)
मापदंडों | |
---|---|
errorMessage | String |
टेस्टरनस्टार्ट किया गया
public void testRunStarted (String name, int numTests, int attemptNumber)
मापदंडों | |
---|---|
name | String |
numTests | int |
attemptNumber | int |
टेस्टरनस्टार्ट किया गया
public void testRunStarted (String name, int numTests)
मापदंडों | |
---|---|
name | String |
numTests | int |
टेस्टरनस्टार्ट किया गया
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 |
संरक्षित तरीके
ClearModuleLogFiles
protected final void clearModuleLogFiles ()
मॉड्यूल फ़ाइल को साफ करने की अनुमति देता है ताकि हम उन्हें बहुत लंबे समय तक ले जाने से बचें।
ClearResultsForName
protected final void clearResultsForName (String testRunName)
किसी दिए गए रन नाम के परिणामों को साफ़ करने की अनुमति देता है। परिणामों के एग्रीगेटर जैसे कुछ मामलों में ही उपयोग किया जाना चाहिए।
मापदंडों | |
---|---|
testRunName | String |
setIsAggregrateMetrics
protected void setIsAggregrateMetrics (boolean aggregate)
'एग्रीगेट मेट्रिक्स' विकल्प को टॉगल करें
मापदंडों | |
---|---|
aggregate | boolean |