BugreportCollector
public
class
BugreportCollector
extends Object
implements
ITestInvocationListener
java.lang.Object | |
↳ | com.android.tradefed.result.BugreportCollector |
Przepuszczająca reguła ITestInvocationListener
, która zbiera raporty o błędach po wystąpieniu zdarzeń konfigurowalnych, a potem wywołuje regułę ITestInvocationListener#testLog
w swoich elementach podrzędnych po zebraniu każdego raportu o błędzie.
Zachowania: (FIXME: finish this)
- Przechwyć po każdym teście, jeśli któryś z nich się nie powiódł.
- Rejestrowanie po każdym teście
- Przechwyć po każdym nieudanym teście.
- Rejestruj
Podsumowanie
Zagnieżdżone klasy | |
---|---|
enum |
BugreportCollector.Filter
|
enum |
BugreportCollector.Freq
|
enum |
BugreportCollector.Noun
|
class |
BugreportCollector.Predicate
Pełny predykat opisujący, kiedy należy przechwycić raport o błędzie. |
enum |
BugreportCollector.Relation
|
interface |
BugreportCollector.SubPredicate
|
Fieldsem | |
---|---|
public
static
final
BugreportCollector.Predicate |
AFTER_FAILED_TESTCASES
Wstępnie zdefiniowany predykat, który jest uruchamiany po każdym nieudanym teście. |
public
static
final
BugreportCollector.Predicate |
AT_START
Wstępnie zdefiniowany predykat, który jest uruchamiany w momencie rozpoczęcia pierwszego wywołania. |
Konstruktory publiczne | |
---|---|
BugreportCollector(ITestInvocationListener listener, ITestDevice testDevice)
|
Metody publiczne | |
---|---|
void
|
addPredicate(BugreportCollector.Predicate p)
|
void
|
blockUntilIdle()
Blokowanie do momentu, gdy zbieracz nie będzie zbierać żadnych raportów o błędach. |
TestSummary
|
getSummary()
|
void
|
invocationEnded(long elapsedTime)
|
void
|
invocationFailed(Throwable cause)
|
void
|
invocationStarted(IInvocationContext context)
|
void
|
setAsynchronous(boolean asynchronous)
Określ, czy raport o błędach ma być zbierany w ramach innego wątku ( |
void
|
setDescriptiveName(String name)
Ustaw nazwę opisową, która będzie używana podczas rejestrowania raportów o błędach. |
void
|
setDeviceWaitTime(int waitTime)
Ustaw czas (w sekundach) oczekiwania na połączenie z internetem urządzenia, zanim spróbujemy przechwycić raport o błędzie. |
void
|
testAssumptionFailure(TestDescription test, String trace)
|
void
|
testEnded(TestDescription test,
|
void
|
testFailed(TestDescription test, String trace)
|
void
|
testIgnored(TestDescription test)
|
void
|
testLog(String dataName, LogDataType dataType, InputStreamSource dataStream)
|
void
|
testRunEnded(long elapsedTime,
|
void
|
testRunFailed(String errorMessage)
|
void
|
testRunStarted(String runName, int testCount)
|
void
|
testRunStopped(long elapsedTime)
|
void
|
testStarted(TestDescription test)
|
Fieldsem
AFTER_FAILED_TESTCASES
public static final BugreportCollector.Predicate AFTER_FAILED_TESTCASES
Wstępnie zdefiniowany predykat, który jest uruchamiany po każdym nieudanym teście.
AT_START
public static final BugreportCollector.Predicate AT_START
Wstępnie zdefiniowany predykat, który jest uruchamiany w momencie rozpoczęcia pierwszego wywołania.
Konstruktory publiczne
BugreportCollector
public BugreportCollector (ITestInvocationListener listener, ITestDevice testDevice)
Parametry | |
---|---|
listener |
ITestInvocationListener |
testDevice |
ITestDevice |
Metody publiczne
addPredicate
public void addPredicate (BugreportCollector.Predicate p)
Parametry | |
---|---|
p |
BugreportCollector.Predicate |
blockUntilIdle
public void blockUntilIdle ()
Blokowanie do momentu, gdy zbieracz nie będzie zbierać żadnych raportów o błędach. Jeśli kolektor nie zbiera aktywnie raportu o błędzie, zwracany jest natychmiast
getSummary
public TestSummary getSummary ()
Zwroty | |
---|---|
TestSummary |
invocationEnded
public void invocationEnded (long elapsedTime)
Parametry | |
---|---|
elapsedTime |
long |
invocationFailed
public void invocationFailed (Throwable cause)
Parametry | |
---|---|
cause |
Throwable |
invocationStarted
public void invocationStarted (IInvocationContext context)
Parametry | |
---|---|
context |
IInvocationContext |
setAsynchronous
public void setAsynchronous (boolean asynchronous)
Określ, czy raport o błędach ma być zbierany w ramach innego wątku (asynchronous = true
), czy też ma blokować dzwoniącego, dopóki raport o błędach nie zostanie przechwycony (asynchronous = false
).
Parametry | |
---|---|
asynchronous |
boolean |
setDescriptiveName
public void setDescriptiveName (String name)
Ustaw nazwę opisową, która będzie używana podczas rejestrowania raportów o błędach. Jeśli null
,
BugreportCollector
użyje domyślnego zachowania, czyli zserializuje nazwę zdarzenia, które spowodowało zebranie raportu o błędzie.
Parametry | |
---|---|
name |
String |
setDeviceWaitTime
public void setDeviceWaitTime (int waitTime)
Ustaw czas (w sekundach) oczekiwania na połączenie z internetem urządzenia, zanim spróbujemy przechwycić raport o błędzie. Jeśli odpowiedź jest negatywna, nie zostanie przeprowadzona żadna weryfikacja. Wszystkie DeviceNotAvailableException
wykryte podczas tej weryfikacji zostaną zapisane i zignorowane.
Parametry | |
---|---|
waitTime |
int |
testAssumptionFailure
public void testAssumptionFailure (TestDescription test, String trace)
Parametry | |
---|---|
test |
TestDescription |
trace |
String |
testEnded
public void testEnded (TestDescription test,testMetrics)
Parametry | |
---|---|
test |
TestDescription |
testMetrics |
|
testFailed
public void testFailed (TestDescription test, String trace)
Parametry | |
---|---|
test |
TestDescription |
trace |
String |
testIgnored
public void testIgnored (TestDescription test)
Parametry | |
---|---|
test |
TestDescription |
testLog
public void testLog (String dataName, LogDataType dataType, InputStreamSource dataStream)
Parametry | |
---|---|
dataName |
String |
dataType |
LogDataType |
dataStream |
InputStreamSource |
testRunEnded
public void testRunEnded (long elapsedTime,runMetrics)
Parametry | |
---|---|
elapsedTime |
long |
runMetrics |
|
testRunFailed
public void testRunFailed (String errorMessage)
Parametry | |
---|---|
errorMessage |
String |
testRunStarted
public void testRunStarted (String runName, int testCount)
Parametry | |
---|---|
runName |
String |
testCount |
int |
testRunStopped
public void testRunStopped (long elapsedTime)
Parametry | |
---|---|
elapsedTime |
long |
testStarted
public void testStarted (TestDescription test)
Parametry | |
---|---|
test |
TestDescription |