コンソール

public class Console
extends Object

java.lang.Object
   ↳ com.android.tradefed.command.Console


ユーザーが操作するためのインターフェースを提供するメインの TradeFederation コンソール

現在、次のようなオペレーションがサポートされています。

  • テストするコマンドを追加します。
  • デバイスとその状態を一覧表示します。
  • 進行中の呼び出しを一覧表示します。
  • キュー内のコマンドを一覧表示します。
  • 呼び出しログをファイル/stdout にダンプします。
  • シャットダウン

概要

ネストされたクラス

class Console.ArgRunnable<T>

引数を取ることができる run メソッドを持つ Runnable  

class Console.CaptureList

List<List<String>> の便利な型

フィールド

protected static final String DEBUG_PATTERN

protected static final String DUMP_PATTERN

protected static final String EXIT_PATTERN

protected static final String HELP_PATTERN

protected static final String INVOC_PATTERN

protected static final String LINE_SEPARATOR

protected static final String LIST_COMMANDS_PATTERN

protected static final String LIST_PATTERN

protected static final String REMOVE_PATTERN

protected static final String RUN_PATTERN

protected static final String SET_PATTERN

protected static final String VERSION_PATTERN

protected LineReader mConsoleReader

protected IKeyStoreFactory mKeyStoreFactory

protected ICommandScheduler mScheduler

保護されたコンストラクタ

Console()

パブリック メソッド

static void main(String[] mainArgs)
void run()

コンソールを起動するメイン メソッド。

void setArgs( mainArgs)

コンソールの起動引数を設定します。

static void startConsole(Console console, String[] args)

指定された引数で指定された Tradefed コンソールを起動します。

保護されたメソッド

String getConsolePrompt()
String getGenericHelpString( genericHelp)

表示する一般的なヘルプ文字列を返します。

static LineReader getReader()

新しい LineReader を返します。IOException が発生した場合は null を返します。

void printLine(String output)

コンソールに 1 行のテキストを表示する

void printLine(String output, PrintStream pw)

行を Printwriter に出力します。

void setCustomCommands(RegexTrie<Runnable> trie, genericHelp, commandHelp)

サブクラスがコンソールで使用できるコマンドを変更するために使用できるカスタマイズ ポイント。

フィールド

DEBUG_PATTERN

protected static final String DEBUG_PATTERN

DUMP_PATTERN

protected static final String DUMP_PATTERN

EXIT_PATTERN

protected static final String EXIT_PATTERN

HELP_PATTERN

protected static final String HELP_PATTERN

INVOC_PATTERN

protected static final String INVOC_PATTERN

LINE_SEPARATOR

protected static final String LINE_SEPARATOR

LIST_COMMANDS_PATTERN

protected static final String LIST_COMMANDS_PATTERN

LIST_PATTERN

protected static final String LIST_PATTERN

REMOVE_PATTERN

protected static final String REMOVE_PATTERN

RUN_PATTERN

protected static final String RUN_PATTERN

SET_PATTERN

protected static final String SET_PATTERN

VERSION_PATTERN

protected static final String VERSION_PATTERN

mConsoleReader

protected LineReader mConsoleReader

mKeyStoreFactory

protected IKeyStoreFactory mKeyStoreFactory

mScheduler

protected ICommandScheduler mScheduler

保護されたコンストラクタ

コンソール

protected Console ()

パブリック メソッド

main

public static void main (String[] mainArgs)

パラメータ
mainArgs String

例外
ConfigurationException

ホームラン

public void run ()

コンソールを起動するメイン メソッド。シャットダウン コマンドが実行されるまで実行を続けます。

setArgs

public void setArgs ( mainArgs)

コンソールの起動引数を設定します。

パラメータ
mainArgs : 引数

startConsole

public static void startConsole (Console console, 
                String[] args)

指定された引数で指定された Tradefed コンソールを起動する

パラメータ
console Console: 起動する Console

args String: コマンドライン引数

例外
ConfigurationException

保護されたメソッド

getConsolePrompt

protected String getConsolePrompt ()

戻り値
String コンソール プロンプトに表示するテキスト String

getGenericHelpString

protected String getGenericHelpString ( genericHelp)

表示する一般的なヘルプ文字列を返します。

パラメータ
genericHelp : 集約される汎用ヘルプを表す String のリスト。

戻り値
String

getReader

protected static LineReader getReader ()

新しい LineReader を返します。IOException が発生した場合は null を返します。この関数は、スーパークラスのコンストラクタの前に実行できるように静的である必要があります。

戻り値
LineReader

printLine

protected void printLine (String output)

コンソールに 1 行のテキストを表示する

printLine

protected void printLine (String output, 
                PrintStream pw)

行を Printwriter に出力する

パラメータ
pw PrintStream

setCustomCommands

protected void setCustomCommands (RegexTrie<Runnable> trie, 
                 genericHelp, 
                 commandHelp)

サブクラスがコンソールで使用できるコマンドを変更するために使用できるカスタマイズ ポイント。

実装では、genericHelp 変数と commandHelp 変数を変更して、追加、変更、削除された可能性のある機能を記録する必要があります。

パラメータ
trie RegexTrie: コマンドを追加する RegexTrie

genericHelp : ユーザーが引数なしで「help」コマンドを実行したときに出力する行の ERROR(/List)

commandHelp : 追加された可能性のある新しいコマンドのドキュメントを含む ERROR(/Map)。キーは、RegexTrie のキーとして使用する正規表現です。値は、そのコマンドに出力するヘルプテキストを含む文字列にする必要があります。