public class SimpleHttpSource extends AbstractModuleFixture<SimpleHttpSource>
label| コンストラクターと説明 |
|---|
SimpleHttpSource() ホストを指定して、新しい SimpleHttpSource を構築します。 |
SimpleHttpSource(java.lang.String host) ホストを指定して、新しい SimpleHttpSource を構築します。 |
SimpleHttpSource(java.lang.String host, int port) ホストと接続先のポートを指定して、新しい SimpleHttpSource を構築します。 |
| 修飾子と型 | メソッドと説明 |
|---|---|
SimpleHttpSource | ensureReady() ソースに最大 2 秒間 HTTP ヘッダーリクエストを送信して、ソースがリクエストを受け入れる準備ができていることを確認します。 |
SimpleHttpSource | ensureReady(int timeoutInMillis) 試行間に 100 ミリ秒のスリープ時間を設け、最大でミリ秒単位で指定されたタイムアウトまで HTTP ヘッダーリクエストを送信することにより、ソースがリクエストを受け入れる準備ができていることを確認します。 |
void | postData(java.lang.String payload)http 本文に指定された文字列を使用して HTTP POST リクエストを作成します。 |
void | postFromFile(java.io.File file) ファイルの内容から HTTP リクエストを生成する |
protected java.lang.String | toDSL() ストリーム定義に含めるのに適したモジュールの表現を返します。 例: file --dir=xxxx --name=yyyy |
label, toStringpublic SimpleHttpSource()
public SimpleHttpSource(java.lang.String host)
host - 接続するホスト public SimpleHttpSource(java.lang.String host,
int port)host - 接続先のホスト port - 接続するポート public SimpleHttpSource ensureReady()
java.lang.IllegalStateException - 指定されたタイムアウト内にソースに接続できない場合。public SimpleHttpSource ensureReady(int timeoutInMillis)
timeoutInMillis -java.lang.IllegalStateException - 指定されたタイムアウト内にソースに接続できない場合。protected java.lang.String toDSL()
AbstractModuleFixturefile --dir=xxxx --name=yyyyAbstractModuleFixture<SimpleHttpSource> の toDSL public void postData(java.lang.String payload)
payload - http 本文で送信する文字列。public void postFromFile(java.io.File file)
file - 投稿するデータを含むファイル GeneratorException - ファイル処理に関連するエラーが発生した場合。