Package com.consol.citrus.actions
Class InputAction
- java.lang.Object
-
- com.consol.citrus.actions.AbstractTestAction
-
- com.consol.citrus.actions.InputAction
-
- All Implemented Interfaces:
com.consol.citrus.common.Described
,com.consol.citrus.common.Named
,com.consol.citrus.TestAction
,com.consol.citrus.TestActorAware
public class InputAction extends AbstractTestAction
Test action prompts user data from standard input stream. The input data is then stored as new test variable. Test workflow stops until user input is complete. Action can declare a set of valid answers, so user will be prompted until a valid answer was returned.- Author:
- Christoph Deppisch
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
InputAction.Builder
Action builder.
-
Field Summary
Fields Modifier and Type Field Description static String
ANSWER_SEPARATOR
Separates valid answer possibilities-
Fields inherited from class com.consol.citrus.actions.AbstractTestAction
description
-
-
Constructor Summary
Constructors Constructor Description InputAction(InputAction.Builder builder)
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doExecute(com.consol.citrus.context.TestContext context)
Subclasses may add custom execution logic here.protected BufferedReader
getInputReader()
Provides input stream reader from system in standard input stream.String
getMessage()
Gets the message.String
getValidAnswers()
Gets the validAnswers.String
getVariable()
Gets the variable.-
Methods inherited from class com.consol.citrus.actions.AbstractTestAction
execute, getActor, getDescription, getName, isDisabled, setActor, setDescription, setName
-
-
-
-
Field Detail
-
ANSWER_SEPARATOR
public static final String ANSWER_SEPARATOR
Separates valid answer possibilities- See Also:
- Constant Field Values
-
-
Constructor Detail
-
InputAction
public InputAction(InputAction.Builder builder)
Default constructor.
-
-
Method Detail
-
doExecute
public void doExecute(com.consol.citrus.context.TestContext context)
Description copied from class:AbstractTestAction
Subclasses may add custom execution logic here.- Specified by:
doExecute
in classAbstractTestAction
-
getInputReader
protected BufferedReader getInputReader()
Provides input stream reader from system in standard input stream.- Returns:
-
getMessage
public String getMessage()
Gets the message.- Returns:
- the message
-
getVariable
public String getVariable()
Gets the variable.- Returns:
- the variable
-
getValidAnswers
public String getValidAnswers()
Gets the validAnswers.- Returns:
- the validAnswers
-
-