public class ProtocolSessionBuilder extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CLIENT_TAG |
static String |
CLOSE_UNORDERED_BLOCK_TAG |
static String |
COMMENT_TAG |
static String |
LOG |
static String |
OPEN_UNORDERED_BLOCK_TAG |
static String |
REINIT |
static String |
SERVER_CONTINUATION_TAG |
static String |
SERVER_TAG |
static String |
SESSION_TAG |
static String |
TIMER |
static String |
WAIT |
Constructor and Description |
---|
ProtocolSessionBuilder() |
Modifier and Type | Method and Description |
---|---|
void |
addProtocolLines(String scriptName,
InputStream is,
ProtocolInteractor session)
Reads ProtocolElements from the supplied InputStream and adds them to the
ProtocolSession.
|
void |
addProtocolLines(String scriptName,
Reader reader,
ProtocolInteractor session)
Reads ProtocolElements from the supplied Reader and adds them to the
ProtocolSession.
|
void |
addTestFile(String fileName,
ProtocolInteractor session)
Adds all protocol elements from a test file to the ProtocolSession
supplied.
|
ProtocolInteractor |
buildProtocolSession(String fileName)
Builds a ProtocolSession by reading lines from the test file with the
supplied name.
|
ProtocolInteractor |
buildProtocolSession(String scriptName,
Reader reader)
Builds a ProtocolSession by reading lines from the reader.
|
void |
setVariable(String name,
String value)
Sets a substitution varaible.
|
public static final String LOG
public static final String WAIT
public static final String SERVER_CONTINUATION_TAG
public static final String CLIENT_TAG
public static final String SERVER_TAG
public static final String OPEN_UNORDERED_BLOCK_TAG
public static final String CLOSE_UNORDERED_BLOCK_TAG
public static final String COMMENT_TAG
public static final String SESSION_TAG
public static final String REINIT
public static final String TIMER
public ProtocolSessionBuilder()
public void setVariable(String name, String value)
NAME
} is found in the input
where NAME
is the name of the variable.name
- not nullvalue
- not nullpublic ProtocolInteractor buildProtocolSession(String fileName) throws Exception
fileName
- The name of the protocol session file.Exception
public ProtocolInteractor buildProtocolSession(String scriptName, Reader reader) throws Exception
scriptName
- not nullreader
- not nullException
public void addTestFile(String fileName, ProtocolInteractor session) throws Exception
fileName
- The name of the protocol session file.session
- The ProtocolSession to add the elements to.Exception
public void addProtocolLines(String scriptName, InputStream is, ProtocolInteractor session) throws Exception
scriptName
- The name of the source file, for error messages.is
- The input stream containing the protocol definition.session
- The ProtocolSession to add elements to.Exception
public void addProtocolLines(String scriptName, Reader reader, ProtocolInteractor session) throws Exception
scriptName
- The name of the source file, for error messages.reader
- the reader containing the protocol definition.session
- The ProtocolSession to add elements to.Exception
Copyright © 2008-2017 The Apache Software Foundation. All Rights Reserved.