Package org.beryx.textio.mock
Class MockTextTerminal
- java.lang.Object
-
- org.beryx.textio.AbstractTextTerminal<MockTextTerminal>
-
- org.beryx.textio.mock.MockTextTerminal
-
- All Implemented Interfaces:
TextTerminal<MockTextTerminal>
public class MockTextTerminal extends AbstractTextTerminal<MockTextTerminal>
A mock terminal for test purposes.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_MAX_READS
-
Fields inherited from class org.beryx.textio.AbstractTextTerminal
DEFAULT_USER_INTERRUPT_KEY, SYSPROP_PROPERTIES_FILE_LOCATION
-
-
Constructor Summary
Constructors Constructor Description MockTextTerminal()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.String>
getInputs()
int
getMaxReads()
java.lang.String
getOutput()
int
getReadCalls()
void
println()
Terminates the current line by writing the line separator string.void
rawPrint(java.lang.String message)
Prints the message in its raw form.java.lang.String
read(boolean masking)
Reads a line of textvoid
setMaxReads(int maxReads)
static java.lang.String
stripAll(java.lang.String text)
-
Methods inherited from class org.beryx.textio.AbstractTextTerminal
addDefaultProperty, getDefaultProperties, getProperties, getPropertiesPrefixes, getPropertiesReader, init, initProperties, initProperties, initProperties
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.beryx.textio.TextTerminal
abort, applyWithPropertiesConfigurator, dispose, dispose, executeWithPropertiesConfigurator, executeWithPropertiesPrefix, moveToLineStart, print, print, printf, printf, println, println, rawPrint, registerHandler, registerUserInterruptHandler, resetLine, resetToBookmark, setBookmark
-
-
-
-
Field Detail
-
DEFAULT_MAX_READS
public static final int DEFAULT_MAX_READS
- See Also:
- Constant Field Values
-
-
Method Detail
-
read
public java.lang.String read(boolean masking)
Description copied from interface:TextTerminal
Reads a line of text- Parameters:
masking
- true, if the input should be masked (for example to enter a password)- Returns:
- the entered text
-
rawPrint
public void rawPrint(java.lang.String message)
Description copied from interface:TextTerminal
Prints the message in its raw form. This method expects a single line of text. The behavior is undefined if the string contains line separators.
-
println
public void println()
Description copied from interface:TextTerminal
Terminates the current line by writing the line separator string.
-
getInputs
public java.util.List<java.lang.String> getInputs()
-
getOutput
public java.lang.String getOutput()
-
getReadCalls
public int getReadCalls()
-
getMaxReads
public int getMaxReads()
-
setMaxReads
public void setMaxReads(int maxReads)
-
stripAll
public static java.lang.String stripAll(java.lang.String text)
-
-