org.sandev.basics.util
Interface MessageValidator

All Known Implementing Classes:
ConfirmationValidator

public interface MessageValidator

A MessageValidator class can be configured as part of a TestScript, to check for arbitrary input situations. The MessageDriver functions as an input filter, passing through any messages that meet the match specifications. The test then succeeds or fails based on the the returned value. See the method comments for details.


Field Summary
static int INVALID
          The given message is invalid, an error, problem, bad etc.
static int UNKNOWN
          The given message is unknown.
static int VALID
          The given message is valid, ok, not a problem, good etc.
 
Method Summary
 int asynchError(SandMessage msg, MessageDriverNode driver)
          The given message may be an error according to the match specification.
 int asynchExpected(SandMessage msg, MessageDriverNode driver)
          The given message may be correct input according to the match specification.
 int queryResult(SandMessage sent, SandMessage received, MessageDriverNode driver)
          Confirm the status of this response to the given query.
 

Field Detail

UNKNOWN

public static final int UNKNOWN
The given message is unknown. It is not known to be valid or invalid.

See Also:
Constant Field Values

VALID

public static final int VALID
The given message is valid, ok, not a problem, good etc.

See Also:
Constant Field Values

INVALID

public static final int INVALID
The given message is invalid, an error, problem, bad etc.

See Also:
Constant Field Values
Method Detail

asynchError

public int asynchError(SandMessage msg,
                       MessageDriverNode driver)
The given message may be an error according to the match specification. Confirm what the status is, using the reference to the MessageDriver for logging and other purposes.


asynchExpected

public int asynchExpected(SandMessage msg,
                          MessageDriverNode driver)
The given message may be correct input according to the match specification. Confirm what the status is, using the reference to the MessageDriver for logging and other purposes.


queryResult

public int queryResult(SandMessage sent,
                       SandMessage received,
                       MessageDriverNode driver)
Confirm the status of this response to the given query. Use the reference to the MessageDriver for logging and other purposes.