TestTimeoutEnforcer
public
final
class
TestTimeoutEnforcer
extends ResultForwarder
| java.lang.Object | ||
| ↳ | com.android.tradefed.result.ResultForwarder | |
| ↳ | com.android.tradefed.testtype.TestTimeoutEnforcer | |
特定のテストケースの実行時間をチェックし、指定されたタイムアウトを超えると失敗するリスナー。
この適用機能はテストを中断しませんが、テストを失敗させます。
概要
フィールド | |
|---|---|
public
static
final
String |
TEST_CASE_TIMEOUT_DESCRIPTION
|
public
static
final
String |
TEST_CASE_TIMEOUT_OPTION
|
パブリック コンストラクタ | |
|---|---|
TestTimeoutEnforcer(long perTestCaseTimeout, TimeUnit unit, ITestInvocationListener... listeners)
適用するタイムアウトを指定して |
|
TestTimeoutEnforcer(long perTestCaseTimeout, TimeUnit unit,
適用するタイムアウトを指定して |
|
パブリック メソッド | |
|---|---|
void
|
testAssumptionFailure(TestDescription test, FailureDescription failure)
アトミック テストが false の条件を前提としていることを報告するフラグが立てられたときに呼び出されます。 |
void
|
testAssumptionFailure(TestDescription test, String trace)
アトミック テストが false の条件を前提としていることを報告するフラグが立てられたときに呼び出されます。 |
void
|
testEnded(TestDescription test, long endTime,
終了時間を直接指定できる |
void
|
testFailed(TestDescription test, FailureDescription failure)
個々のテストケースの失敗を報告します。 |
void
|
testFailed(TestDescription test, String trace)
個々のテストケースの失敗を報告します。 |
void
|
testIgnored(TestDescription test)
テストが実行されない場合に呼び出されます(通常は、テストメソッドに org.junit.Ignore がアノテーションされているため)。 |
void
|
testStarted(TestDescription test, long startTime)
|
フィールド
TEST_CASE_TIMEOUT_DESCRIPTION
public static final String TEST_CASE_TIMEOUT_DESCRIPTION
TEST_CASE_TIMEOUT_OPTION
public static final String TEST_CASE_TIMEOUT_OPTION
パブリック コンストラクタ
TestTimeoutEnforcer
public TestTimeoutEnforcer (long perTestCaseTimeout,
TimeUnit unit,
ITestInvocationListener... listeners)適用するタイムアウトを指定して TestTimeoutEnforcer を作成します。
| パラメータ | |
|---|---|
perTestCaseTimeout |
long: タイムアウトの値。 |
unit |
TimeUnit: perTestCaseTimeout の ERROR(/TimeUnit)。 |
listeners |
ITestInvocationListener: 転送先の ITestInvocationListener。 |
TestTimeoutEnforcer
public TestTimeoutEnforcer (long perTestCaseTimeout,
TimeUnit unit,
listeners) 適用するタイムアウトを指定して TestTimeoutEnforcer を作成します。
| パラメータ | |
|---|---|
perTestCaseTimeout |
long: タイムアウトの値。 |
unit |
TimeUnit: perTestCaseTimeout の ERROR(/TimeUnit)。 |
listeners |
: 転送先の ITestInvocationListener。 |
パブリック メソッド
testAssumptionFailure
public void testAssumptionFailure (TestDescription test, FailureDescription failure)
アトミック テストが false の条件を前提としていることを報告するフラグが立てられたときに呼び出されます。
| パラメータ | |
|---|---|
test |
TestDescription: テストを識別します。 |
failure |
FailureDescription: 障害とそのコンテキストを記述する FailureDescription。 |
testAssumptionFailure
public void testAssumptionFailure (TestDescription test, String trace)
アトミック テストが false の条件を前提としていることを報告するフラグが立てられたときに呼び出されます。
| パラメータ | |
|---|---|
test |
TestDescription: テストを識別します。 |
trace |
String: 障害のスタック トレース |
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) |
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: テストを識別します。 |
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() で測定) |