public interface CapturedOutput extends CharSequenceSE
OutputCaptureExtension
または OutputCaptureRule
によってキャプチャーされた System.out
SE および System.err
SE 出力へのアクセスを提供します。AssertJ または標準の JUnit アサーションを使用してアサーションを適用するために使用できます。例:assertThat(output).contains("started"); // Checks all output assertThat(output.getErr()).contains("failed"); // Only checks System.err assertThat(output.getOut()).contains("ok"); // Only checks System.out
OutputCaptureExtension
修飾子と型 | メソッドと説明 |
---|---|
default char | charAt(int index) |
StringSE | getAll() すべてのコンテンツ( System.out SE および System.err SE の両方)がキャプチャーされた順序で返されます。 |
StringSE | getErr() System.err SE コンテンツをキャプチャーした順に返します。 |
StringSE | getOut() System.out SE コンテンツをキャプチャーした順に返します。 |
default int | length() |
default CharSequenceSE | subSequence(int start, int end) |
charsSE, codePointsSE, toStringSE
default int length()
CharSequenceSE
の lengthSE
default char charAt(int index)
CharSequenceSE
の charAtSE
default CharSequenceSE subSequence(int start, int end)
CharSequenceSE
の subSequenceSE
StringSE getAll()
System.out
SE および System.err
SE の両方)がキャプチャーされた順序で返されます。StringSE getOut()
System.out
SE コンテンツをキャプチャーした順に返します。System.out
SE キャプチャー出力 StringSE getErr()
System.err
SE コンテンツをキャプチャーした順に返します。System.err
SE キャプチャー出力