public class ProtocolSession extends Object implements ProtocolInteractor
Modifier and Type | Class and Description |
---|---|
static class |
ProtocolSession.InvalidServerResponseException
An exception which is thrown when the actual response from a server is
different from that expected.
|
protected static class |
ProtocolSession.TimerCommand |
Modifier and Type | Field and Description |
---|---|
protected List<org.apache.james.mpt.protocol.ProtocolSession.ProtocolElement> |
testElements |
Constructor and Description |
---|
ProtocolSession() |
Modifier and Type | Method and Description |
---|---|
void |
CL(int sessionNumber,
String clientLine)
adds a new Client request line to the test elements
|
void |
CL(String clientLine)
adds a new Client request line to the test elements
|
void |
CONT(int sessionNumber)
Adds a continuation.
|
void |
doContinue() |
int |
getSessionCount()
Returns the number of sessions required to run this ProtocolSession.
|
boolean |
isContinueAfterFailure() |
void |
LOG(int sessionNumber,
org.apache.james.mpt.protocol.ProtocolSession.LolLevel level,
String message) |
void |
REINIT(int sessionNumber) |
void |
runSessions(Session[] sessions)
Executes the ProtocolSession in real time against the readers and writers
supplied, writing client requests and reading server responses in the
order that they appear in the test elements.
|
void |
setContinueAfterFailure(boolean continueAfterFailure) |
void |
SL(int sessionNumber,
String serverLine,
String location,
String lastClientMessage)
adds a new Server Response line to the test elements, with the specified
location.
|
void |
SL(String serverLine,
String location)
adds a new Server Response line to the test elements, with the specified
location.
|
void |
SUB(int sessionNumber,
List<String> serverLines,
String location,
String lastClientMessage)
adds a new Server Unordered Block to the test elements.
|
void |
SUB(List<String> serverLines,
String location)
adds a new Server Unordered Block to the test elements.
|
void |
TIMER(ProtocolSession.TimerCommand timerCommand,
String timerName) |
String |
toString()
Constructs a
String with all attributes in name = value
format. |
void |
WAIT(int sessionNumber,
long timeToWaitInMs)
adds a Wait condition
|
protected List<org.apache.james.mpt.protocol.ProtocolSession.ProtocolElement> testElements
public ProtocolSession()
public final boolean isContinueAfterFailure()
public final void setContinueAfterFailure(boolean continueAfterFailure)
public int getSessionCount()
public void runSessions(Session[] sessions) throws Exception
out
- The client requests are written to here.in
- The server responses are read from here.Exception
public void doContinue()
public void CL(String clientLine)
CL
in interface ProtocolInteractor
public void SL(String serverLine, String location)
SL
in interface ProtocolInteractor
public void SUB(List<String> serverLines, String location)
SUB
in interface ProtocolInteractor
public void CL(int sessionNumber, String clientLine)
CL
in interface ProtocolInteractor
public void CONT(int sessionNumber) throws Exception
CONT
in interface ProtocolInteractor
Exception
public void SL(int sessionNumber, String serverLine, String location, String lastClientMessage)
SL
in interface ProtocolInteractor
public void SUB(int sessionNumber, List<String> serverLines, String location, String lastClientMessage)
SUB
in interface ProtocolInteractor
public void WAIT(int sessionNumber, long timeToWaitInMs)
public void LOG(int sessionNumber, org.apache.james.mpt.protocol.ProtocolSession.LolLevel level, String message)
public void REINIT(int sessionNumber)
public void TIMER(ProtocolSession.TimerCommand timerCommand, String timerName)
Copyright © 2008-2017 The Apache Software Foundation. All Rights Reserved.