JUnitToInvocationResultForwarder

public class JUnitToInvocationResultForwarder
extends Object implements TestListener

java.lang.Object
   ↳ com.android.tradefed.result.JUnitToInvocationResultForwarder


Klasa, która nasłuchuje zdarzeń TestListener i przekazuje je do ITestInvocationListener.

Podsumowanie

Konstruktory publiczne

JUnitToInvocationResultForwarder(ITestInvocationListener invocationListener)
JUnitToInvocationResultForwarder(List<ITestInvocationListener> invocationListeners)

Metody publiczne

void addError(Test test, Throwable t)

void addFailure(Test test, AssertionFailedError t)

void endTest(Test test)

void endTest(Test test, HashMap<String, MetricMeasurement.Metric> metrics)

Wywołanie zwrotne z testów JUnit3, które może przekazywać dane.

void startTest(Test test)

void testLog(String dataName, LogDataType dataType, InputStreamSource dataStream)

Wywołanie zwrotne z przekierowania JUnit3 w celu pobrania logów z testu.

Konstruktory publiczne

JUnitToInvocationResultForwarder

public JUnitToInvocationResultForwarder (ITestInvocationListener invocationListener)

Parametry
invocationListener ITestInvocationListener

JUnitToInvocationResultForwarder

public JUnitToInvocationResultForwarder (List<ITestInvocationListener> invocationListeners)

Parametry
invocationListeners List

Metody publiczne

addError

public void addError (Test test, 
                Throwable t)

Parametry
test Test

t Throwable

addFailure

public void addFailure (Test test, 
                AssertionFailedError t)

Parametry
test Test

t AssertionFailedError

endTest

public void endTest (Test test)

Parametry
test Test

endTest

public void endTest (Test test, 
                HashMap<String, MetricMeasurement.Metric> metrics)

Wywołanie zwrotne z testów JUnit3, które może przekazywać dane.

Parametry
test Test: Test, który właśnie zakończył działanie.

metrics HashMap: dane w formacie Map, które mają zostać przekazane do wywołania zwrotnego wyników.

startTest

public void startTest (Test test)

Parametry
test Test

testLog

public void testLog (String dataName, 
                LogDataType dataType, 
                InputStreamSource dataStream)

Wywołanie zwrotne z przekierowania JUnit3 w celu pobrania logów z testu.

Parametry
dataName String: ciąg tekstowy z opisową nazwą danych, np. „device_logcat”. Uwaga: dataName może nie być unikalne w przypadku każdego wywołania. Oznacza to, że osoby wdrażające muszą być w stanie obsłużyć wiele wywołań z tą samą nazwą dataName.

dataType LogDataType: LogDataType danych

dataStream InputStreamSource: InputStreamSource danych. Wdrażający powinni wywołać funkcję createInputStream, aby rozpocząć odczytywanie danych, i po zakończeniu zamknąć wynikowy InputStream. Wywołujący powinni zadbać o to, aby źródło danych było dostępne do momentu zakończenia działania metody testLog.