ResultForwarder
  public
  
  
  
  class
  ResultForwarder
  
    extends Object
  
  
  
  
  
      implements
      
        ITestInvocationListener
      
  
  
| java.lang.Object | |
| ↳ | com.android.tradefed.result.ResultForwarder | 
呼び出し結果を他のリスナーのリストに転送する ITestInvocationListener。
概要
パブリック コンストラクタ | |
|---|---|
      
      ResultForwarder(ITestInvocationListener... listeners)
      
      
        
  | 
  |
      
      ResultForwarder(
      
        
  | 
  |
保護されたコンストラクタ | |
|---|---|
      
      ResultForwarder()
      
      
        リスナーの遅延設定で   | 
  |
パブリック メソッド | |
|---|---|
        
        
        
        
        
        
     | 
  
    
      
      getListeners()
      
      
        リスナーのリストを取得します。  | 
  
        
        
        
        
        
        TestSummary
     | 
  
    
      
      getSummary()
      
      
        InvocationListener が概要を返すことができます。  | 
  
        
        
        
        
        
        void
     | 
  
    
      
      invocationEnded(long elapsedTime)
      
      
        呼び出しが正常に終了したか、なんらかのエラー条件が原因で終了したかを報告します。  | 
  
        
        
        
        
        
        void
     | 
  
    
      
      invocationFailed(FailureDescription failure)
      
      
        エラー状態が原因で呼び出しが完了しなかったことを報告します。  | 
  
        
        
        
        
        
        void
     | 
  
    
      
      invocationFailed(Throwable cause)
      
      
        エラー状態が原因で呼び出しが完了しなかったことを報告します。  | 
  
        
        
        
        
        
        void
     | 
  
    
      
      invocationSkipped(SkipReason reason)
      
      
        呼び出しをスキップされたものとして報告します  | 
  
        
        
        
        
        
        void
     | 
  
    
      
      invocationStarted(IInvocationContext context)
      
      
        テスト呼び出しの開始を報告します。  | 
  
        
        
        
        
        
        void
     | 
  
    
      
      testAssumptionFailure(TestDescription test, String trace)
      
      
        アトミック テストが false の条件を前提としていることを報告するフラグが立てられたときに呼び出されます。  | 
  
        
        
        
        
        
        void
     | 
  
    
      
      testAssumptionFailure(TestDescription test, FailureDescription failure)
      
      
        アトミック テストが false の条件を前提としていることを報告するフラグが立てられたときに呼び出されます。  | 
  
        
        
        
        
        
        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)
      
      
        テストが実行されない場合に呼び出されます(通常は、テストメソッドに org.junit.Ignore がアノテーションされているため)。  | 
  
        
        
        
        
        
        void
     | 
  
    
      
      testLog(String dataName, LogDataType dataType, InputStreamSource dataStream)
      
      
        テスト呼び出しから関連するログデータまたはデバッグデータを提供します。  | 
  
        
        
        
        
        
        void
     | 
  
    
      
      testModuleEnded()
      
      
        モジュールの実行の終了を報告します。  | 
  
        
        
        
        
        
        void
     | 
  
    
      
      testModuleStarted(IInvocationContext moduleContext)
      
      
        モジュールの実行開始を報告します。  | 
  
        
        
        
        
        
        void
     | 
  
    
      
      testRunEnded(long elapsedTime, 
      
        テスト実行の終了を報告します。  | 
  
        
        
        
        
        
        void
     | 
  
    
      
      testRunFailed(FailureDescription failure)
      
      
        
  | 
  
        
        
        
        
        
        void
     | 
  
    
      
      testRunFailed(String errorMessage)
      
      
        致命的なエラーが発生したため、レポートのテスト実行が完了しませんでした。  | 
  
        
        
        
        
        
        void
     | 
  
    
      
      testRunStarted(String runName, int testCount, int attemptNumber)
      
      
        テスト実行の開始を報告します。  | 
  
        
        
        
        
        
        void
     | 
  
    
      
      testRunStarted(String runName, int testCount)
      
      
        テスト実行の開始を報告します。  | 
  
        
        
        
        
        
        void
     | 
  
    
      
      testRunStarted(String runName, int testCount, int attemptNumber, long startTime)
      
      
        テスト実行の開始を報告します。  | 
  
        
        
        
        
        
        void
     | 
  
    
      
      testRunStopped(long elapsedTime)
      
      
        ユーザーのリクエストにより、レポートのテスト実行が完了前に停止しました。  | 
  
        
        
        
        
        
        void
     | 
  
    
      
      testSkipped(TestDescription test, SkipReason reason)
      
      
        通常は想定されない理由でテストがスキップされ、実行されなかった場合に呼び出されます。  | 
  
        
        
        
        
        
        void
     | 
  
    
      
      testStarted(TestDescription test, long startTime)
      
      
        
  | 
  
        
        
        
        
        
        void
     | 
  
    
      
      testStarted(TestDescription test)
      
      
        個々のテストケースの開始を報告します。  | 
  
保護されたメソッド | |
|---|---|
        
        
        
        
        
        void
     | 
  
    
      
      setListeners(ITestInvocationListener... listeners)
      
      
        作成後にリスナーを設定します。  | 
  
        
        
        
        
        
        void
     | 
  
    
      
      setListeners(
      
        作成後にリスナーを設定します。  | 
  
パブリック コンストラクタ
ResultForwarder
public ResultForwarder (ITestInvocationListener... listeners)
ResultForwarder の代替変数引数コンストラクタ。
| パラメータ | |
|---|---|
listeners | 
        
          ITestInvocationListener: 結果を転送する実際の ITestInvocationListener | 
      
ResultForwarder
public ResultForwarder (listeners) 
ResultForwarder を作成します。
| パラメータ | |
|---|---|
listeners | 
        
          : 結果を転送する実際の ITestInvocationListener | 
      
保護されたコンストラクタ
ResultForwarder
protected ResultForwarder ()
リスナーの遅延設定で ResultForwarder を作成します。サブクラスによる使用のみを目的としています。
パブリック メソッド
getSummary
public TestSummary getSummary ()
InvocationListener が概要を返すことができます。
| 戻り値 | |
|---|---|
TestSummary | 
        実行を要約した TestSummary、または null | 
      
invocationEnded
public void invocationEnded (long elapsedTime)
呼び出しが正常に終了したか、なんらかのエラー条件が原因で終了したかを報告します。
TradeFederation フレームワークによって自動的に呼び出されます。
| パラメータ | |
|---|---|
elapsedTime | 
        
          long: 呼び出しの所要時間(ミリ秒単位) | 
      
invocationFailed
public void invocationFailed (FailureDescription failure)
エラー状態が原因で呼び出しが完了しなかったことを報告します。
TradeFederation フレームワークによって自動的に呼び出されます。
| パラメータ | |
|---|---|
failure | 
        
          FailureDescription: 障害の原因を説明する FailureDescription | 
      
invocationFailed
public void invocationFailed (Throwable cause)
エラー状態が原因で呼び出しが完了しなかったことを報告します。
TradeFederation フレームワークによって自動的に呼び出されます。
| パラメータ | |
|---|---|
cause | 
        
          Throwable: 失敗の原因である Throwable | 
      
invocationSkipped
public void invocationSkipped (SkipReason reason)
呼び出しをスキップとして報告する
| パラメータ | |
|---|---|
reason | 
        
          SkipReason  | 
      
invocationStarted
public void invocationStarted (IInvocationContext context)
テスト呼び出しの開始を報告します。
TradeFederation フレームワークによって自動的に呼び出されます。複数のデバイスのレポートをサポートするには、レポーターがこのメソッドをオーバーライドする必要があります。
| パラメータ | |
|---|---|
context | 
        
          IInvocationContext: 呼び出しに関する情報 | 
      
testAssumptionFailure
public void testAssumptionFailure (TestDescription test, String trace)
アトミック テストが false の条件を前提としていることを報告するフラグが立てられたときに呼び出されます。
| パラメータ | |
|---|---|
test | 
        
          TestDescription: テストを識別します。 | 
      
trace | 
        
          String: 障害のスタック トレース | 
      
testAssumptionFailure
public void testAssumptionFailure (TestDescription test, FailureDescription failure)
アトミック テストが false の条件を前提としていることを報告するフラグが立てられたときに呼び出されます。
| パラメータ | |
|---|---|
test | 
        
          TestDescription: テストを識別します。 | 
      
failure | 
        
          FailureDescription: 障害とそのコンテキストを記述する FailureDescription。 | 
      
testEnded
public void testEnded (TestDescription test, long endTime,testMetrics) 
終了時間を直接指定できる ERROR(/#testEnded(com.android.tradefed.result.TestDescription,Map)) の代替手段。正確な測定を行うには、testStarted(com.android.tradefed.result.TestDescription, long) と組み合わせてください。
| パラメータ | |
|---|---|
test | 
        
          TestDescription: テストを識別します。 | 
      
endTime | 
        
          long: テストが終了した時刻(System.currentTimeMillis() で測定) | 
      
testMetrics | 
        
          : 出力された指標の ERROR(/Map) | 
      
testEnded
public void testEnded (TestDescription test,testMetrics) 
個々のテストケースの実行終了を報告します。
testFailed(TestDescription, FailureDescription) が呼び出されなかった場合、このテストは合格です。また、テストケースの実行中に出力された Key-Value 指標も返します。
| パラメータ | |
|---|---|
test | 
        
          TestDescription: テストを識別します。 | 
      
testMetrics | 
        
          : 出力された指標の ERROR(/Map) | 
      
testFailed
public void testFailed (TestDescription test, FailureDescription failure)
個々のテストケースの失敗を報告します。
testStarted と testEnded の間で呼び出されます。
| パラメータ | |
|---|---|
test | 
        
          TestDescription: テストを識別します。 | 
      
failure | 
        
          FailureDescription: 障害とそのコンテキストを記述する FailureDescription。 | 
      
testFailed
public void testFailed (TestDescription test, String trace)
個々のテストケースの失敗を報告します。
testStarted と testEnded の間で呼び出されます。
| パラメータ | |
|---|---|
test | 
        
          TestDescription: テストを識別します。 | 
      
trace | 
        
          String: 障害のスタック トレース | 
      
testIgnored
public void testIgnored (TestDescription test)
テストが実行されない場合に呼び出されます(通常は、テストメソッドに org.junit.Ignore がアノテーションされているため)。
| パラメータ | |
|---|---|
test | 
        
          TestDescription: テストを識別します。 | 
      
testLog
public void testLog (String dataName, 
                LogDataType dataType, 
                InputStreamSource dataStream)テスト呼び出しから関連するログデータまたはデバッグデータを提供します。
 ERROR(/ITestInvocationListener#invocationFailed(Throwable)) または ERROR(/ITestInvocationListener#invocationEnded(long)) の前に呼び出す必要があります。
TradeFederation フレームワークは、このメソッドを自動的に呼び出し、ホストログと、必要に応じてデバイスの logcat を提供します。
| パラメータ | |
|---|---|
dataName | 
        
          String: データのわかりやすい名前(例: device_logcat)。String注: dataName は呼び出しごとに一意ではない場合があります。つまり、実装者は同じ dataName で複数の呼び出しを処理できる必要があります。 | 
      
dataType | 
        
          LogDataType: データの LogDataType | 
      
dataStream | 
        
          InputStreamSource: データの InputStreamSource。実装者は createInputStream を呼び出してデータの読み取りを開始し、完了したら結果の InputStream を必ず閉じる必要があります。呼び出し元は、testLog メソッドが完了するまで、データソースが存在し、アクセス可能であることを確認する必要があります。 | 
      
testModuleEnded
public void testModuleEnded ()
モジュールの実行の終了を報告します。
testModuleStarted
public void testModuleStarted (IInvocationContext moduleContext)
モジュールの実行開始を報告します。このコールバックは testModuleEnded() に関連付けられており、シーケンスでは省略可能です。モジュール(スイートベースのランナー)を使用する実行中にのみ使用されます。
| パラメータ | |
|---|---|
moduleContext | 
        
          IInvocationContext: モジュールの IInvocationContext。 | 
      
testRunEnded
public void testRunEnded (long elapsedTime, 
                 runMetrics) テスト実行の終了を報告します。
| パラメータ | |
|---|---|
elapsedTime | 
        
          long: デバイスが報告した経過時間(ミリ秒単位) | 
      
runMetrics | 
        
          : テスト実行の終了時に報告される Key-Value ペア | 
      
testRunFailed
public void testRunFailed (FailureDescription failure)
FailureDescription で説明されているエラーが原因で、テスト実行が完了しなかったことを報告します。
| パラメータ | |
|---|---|
failure | 
        
          FailureDescription: 障害とそのコンテキストを記述する FailureDescription。 | 
      
testRunFailed
public void testRunFailed (String errorMessage)
致命的なエラーが発生したため、レポートのテスト実行を完了できませんでした。
| パラメータ | |
|---|---|
errorMessage | 
        
          String: 実行失敗の理由を説明する String。 | 
      
testRunStarted
public void testRunStarted (String runName, 
                int testCount, 
                int attemptNumber)テスト実行の開始を報告します。
| パラメータ | |
|---|---|
runName | 
        
          String: テスト実行名 | 
      
testCount | 
        
          int: テスト実行のテスト数の合計 | 
      
attemptNumber | 
        
          int: オーダー番号。同じ runName を複数回実行する際の試行を識別します。attemptNumber は 0 から始まり、新しい実行が行われるたびにインクリメントされます。たとえば、テストが 3 回きめ細かく再試行される場合、同じ runName で合計 4 回の実行が行われ、attemptNumber は 0 ~ 3 になります。 | 
      
testRunStarted
public void testRunStarted (String runName, 
                int testCount)テスト実行の開始を報告します。
| パラメータ | |
|---|---|
runName | 
        
          String: テスト実行名 | 
      
testCount | 
        
          int: テスト実行のテスト数の合計 | 
      
testRunStarted
public void testRunStarted (String runName, 
                int testCount, 
                int attemptNumber, 
                long startTime)テスト実行の開始を報告します。
| パラメータ | |
|---|---|
runName | 
        
          String: テスト実行名 | 
      
testCount | 
        
          int: テスト実行のテスト数の合計 | 
      
attemptNumber | 
        
          int: オーダー番号。同じ runName を複数回実行する際の試行を識別します。attemptNumber は 0 から始まり、新しい実行が行われるたびにインクリメントされます。たとえば、テストが 3 回きめ細かく再試行される場合、同じ runName で合計 4 回の実行が行われ、attemptNumber は 0 ~ 3 になります。 | 
      
startTime | 
        
          long: 実行が開始された時刻(System.currentTimeMillis() で測定) | 
      
testRunStopped
public void testRunStopped (long elapsedTime)
ユーザー リクエストにより、レポートのテスト実行が完了前に停止しました。
TODO: 現在使用されていません。削除を検討してください
| パラメータ | |
|---|---|
elapsedTime | 
        
          long: デバイスが報告した経過時間(ミリ秒単位) | 
      
testSkipped
public void testSkipped (TestDescription test, SkipReason reason)
通常は想定されない理由でテストがスキップされ、実行されなかった場合に呼び出されます。これらのテストは、適切な実行を試すために再試行されます。
| パラメータ | |
|---|---|
test | 
        
          TestDescription: テストを識別します。 | 
      
reason | 
        
          SkipReason: SkipReason | 
      
testStarted
public void testStarted (TestDescription test, long startTime)
testStarted(com.android.tradefed.result.TestDescription) の代替手段。テストの開始時刻も指定します。ERROR(/#testEnded(com.android.tradefed.result.TestDescription,long,Map)) と組み合わせて正確な測定を行います。
| パラメータ | |
|---|---|
test | 
        
          TestDescription: テストを識別します。 | 
      
startTime | 
        
          long: テストの開始時間(System.currentTimeMillis() で測定) | 
      
testStarted
public void testStarted (TestDescription test)
個々のテストケースの開始を報告します。古いインターフェース。可能な限り testStarted(com.android.tradefed.result.TestDescription) を使用してください。
| パラメータ | |
|---|---|
test | 
        
          TestDescription: テストを識別します。 | 
      
保護されたメソッド
setListeners
protected void setListeners (ITestInvocationListener... listeners)
リスナーは作成後に設定します。サブクラスによる使用のみを目的としています。
| パラメータ | |
|---|---|
listeners | 
        
          ITestInvocationListener: 結果を転送する実際の ITestInvocationListener | 
      
setListeners
protected void setListeners (listeners) 
リスナーは作成後に設定します。サブクラスによる使用のみを目的としています。
| パラメータ | |
|---|---|
listeners | 
        
          : 結果を転送する実際の ITestInvocationListener |