クラス ShellTestClient

java.lang.ObjectSE
org.springframework.shell.test.ShellTestClient

public class ShellTestClient extends ObjectSE
シェルセッションのクライアント。シェルアプリケーションとプログラム的にやり取りするための手段として使用できます。一般的なテストでは、ユーザーが入力したかのようにシェルにコマンドを送信し、シェルの出力を検証する必要があります。
作成者:
Janne Valkealahti, Mahmoud Ben Hassine, David Pilar
  • コンストラクターの詳細

  • 方法の詳細

    • sendCommand

      public ShellScreen sendCommand(StringSE input) throws ExceptionSE
      コマンドを実行し、その結果をシェル画面に書き込みます。
      パラメーター:
      input - 生の入力コマンド
      戻り値:
      コマンド実行後のシェル画面
      例外:
      ExceptionSE - コマンド実行中にエラーが発生した場合
    • sendCommand

      public ShellScreen sendCommand(ShellInputProvider inputProvider) throws ExceptionSE
      シェルにコマンドを送信し、必要に応じてユーザー入力やパスワードを処理し、結果として得られたシェル画面の出力を返します。
      パラメーター:
      inputProvider - 入力とパスワードを含む、シミュレーションされたユーザーコマンドを格納したプロバイダ
      戻り値:
      ShellScreen object containing the output of the shell after command execution
      例外:
      ExceptionSE - if an error occurs during the command execution
      導入:
      4.0.2