JUnitToInvocationResultForwarder

public class JUnitToInvocationResultForwarder
extends Object implements TestListener

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


TestListener イベントをリッスンして ITestInvocationListener に転送するクラス。

概要

パブリック コンストラクタ

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

パブリック メソッド

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)

指標を転送できる JUnit3 テストからのコールバック。

void startTest(Test test)

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

テストからログを取得するための JUnit3 フォワーダーからのコールバック。

パブリック コンストラクタ

JUnitToInvocationResultForwarder

public JUnitToInvocationResultForwarder (ITestInvocationListener invocationListener)

パラメータ
invocationListener ITestInvocationListener

JUnitToInvocationResultForwarder

public JUnitToInvocationResultForwarder (List<ITestInvocationListener> invocationListeners)

パラメータ
invocationListeners List

パブリック メソッド

addError

public void addError (Test test, 
                Throwable t)

パラメータ
test Test

t Throwable

addFailure

public void addFailure (Test test, 
                AssertionFailedError t)

パラメータ
test Test

t AssertionFailedError

endTest

public void endTest (Test test)

パラメータ
test Test

endTest

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

指標を転送できる JUnit3 テストからのコールバック。

パラメータ
test Test: 実行が完了したばかりの Test

metrics HashMap: 結果のコールバックに渡されるマップ形式の指標。

startTest

public void startTest (Test test)

パラメータ
test Test

testLog

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

テストからログを取得するための JUnit3 フォワーダーからのコールバック。

パラメータ
dataName String: データの説明的な名前(例: device_logcat)。dataName は呼び出しごとに一意でない場合があります。つまり、実装担当者は同じ dataName で複数回呼び出されても処理できるようにする必要があります。

dataType LogDataType: データの LogDataType

dataStream InputStreamSource: データの InputStreamSource。実装担当者は、 createInputStream を呼び出してデータの読み取りを開始し、完了したら結果の InputStream を閉じる必要があります。呼び出し元は、testLog メソッドが完了するまで、データのソースが存在し 、アクセス可能であることを確認する必要があります。