|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectwoolpack.test.TestConcurrent
public class TestConcurrent
並列性制御(セマフォとロック)をテストするための、execute()
内で実行状況を記録するクラス。
コンストラクタの概要 | |
---|---|
TestConcurrent(java.lang.String label,
java.lang.Object lock,
int minConcurrent,
int maxConcurrent,
int threadCount,
int threshold)
コンストラクタ。 |
|
TestConcurrent(java.lang.String label,
java.lang.Object lock,
int minConcurrent,
int maxConcurrent,
int threadCount,
int threshold,
double failOdds)
コンストラクタ。 |
メソッドの概要 | |
---|---|
boolean |
assertValid()
execute() の実行状況を検証する。 |
void |
execute()
並行性制御を実装しているクラスから呼び出される(called)。 |
int |
getCount()
execute() が実行された回数を返す。 |
void |
print()
execute() の実行状況を標準出力する。 |
void |
setThreadId(int i)
記録するスレッドの識別子(ゼロ開始)を設定する。 |
クラス java.lang.Object から継承されたメソッド |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
コンストラクタの詳細 |
---|
public TestConcurrent(java.lang.String label, java.lang.Object lock, int minConcurrent, int maxConcurrent, int threadCount, int threshold)
label
- 実行状況を標準出力する際の先頭の文字列。lock
- 実行状況を記録する際のロックオブジェクト。minConcurrent
- 期待される同時実行可能な最小のスレッド数。maxConcurrent
- 期待される同時実行可能な最大のスレッド数。threadCount
- テストにおいて並行して実行するスレッド数。threshold
- 実行状況を検証するための許容範囲(単位は件)。public TestConcurrent(java.lang.String label, java.lang.Object lock, int minConcurrent, int maxConcurrent, int threadCount, int threshold, double failOdds)
label
- 実行状況を標準出力する際の先頭の文字列。lock
- 実行状況を記録する際のロックオブジェクト。minConcurrent
- 期待される同時実行可能な最小のスレッド数。maxConcurrent
- 期待される同時実行可能な最大のスレッド数。threadCount
- テストにおいて並行して実行するスレッド数。threshold
- 実行状況を検証するための許容範囲(単位は件)。failOdds
- 実行状況を記録した後にRuntimeException
を発生させる確率。メソッドの詳細 |
---|
public int getCount()
execute()
が実行された回数を返す。
execute()
が実行された回数。public void setThreadId(int i)
i
- 記録するスレッドの識別子(ゼロ開始)。public void execute()
RuntimeException
を発生させる。
public void print()
execute()
の実行状況を標準出力する。
public boolean assertValid()
execute()
の実行状況を検証する。 検証結果が偽の場合は実行状況を標準出力する。
execute()
の実行状況を検証した結果。
|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |