com.ohrasys.cad.bnf
Class BNFTestResult

java.lang.Object
  extended by com.ohrasys.cad.bnf.BNFTestResult

public class BNFTestResult
extends java.lang.Object

A class used to represent the completion status of a test. This object contains a list of tokens successfully evaluated by the test, a list of tokens that must be replayed and the completion status of the test which must be one of FINISHED, UNFINISHED, or FAILED.


Field Summary
protected  java.util.List<BNFTestableObject> committable
          A list of tokens that have been successfully evaluated
static int FAILED
          Indicates the test failed
static int FINISHED
          Indicates the test completed successfully
protected  java.util.List<BNFTestableObject> replayable
          A list of tokens that must be replayed
protected  int status
          The completion status of the test
static int UNFINISHED
          Indicates the test requires more tokens to resolve
 
Constructor Summary
BNFTestResult()
          Creates a new BNFTestResult object.
 
Method Summary
 boolean addCommittableToken(BNFTestableObject token)
          Adds a token to the list of committable tokens
 boolean addCommittableTokens(java.util.List<BNFTestableObject> list)
          Adds a list of tokens to the list of committable tokens
 boolean addReplayableToken(BNFTestableObject token)
          Adds a token to the list of replayable tokens
 boolean addReplayableTokens(java.util.List<BNFTestableObject> list)
          Adds a list of tokens to the list of replayable tokens
 java.util.List<BNFTestableObject> getCommittableTokens()
          Destructively retrieves the list of committable tokens.
 java.util.List<BNFTestableObject> getReplayableTokens()
          Destructively retrieves the list of replayable tokens.
 boolean isFailed()
          Indicates the test failed
 boolean isFinished()
          Indicates that the test finished
 boolean isUnfinished()
          Indicatest that the test is unfinished
 void setResult(int result)
          Sets the completion status of this result object
 java.lang.String toString()
          Returns a text representation of this object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FINISHED

public static final int FINISHED
Indicates the test completed successfully

See Also:
Constant Field Values

UNFINISHED

public static final int UNFINISHED
Indicates the test requires more tokens to resolve

See Also:
Constant Field Values

FAILED

public static final int FAILED
Indicates the test failed

See Also:
Constant Field Values

committable

protected java.util.List<BNFTestableObject> committable
A list of tokens that have been successfully evaluated


replayable

protected java.util.List<BNFTestableObject> replayable
A list of tokens that must be replayed


status

protected int status
The completion status of the test

Constructor Detail

BNFTestResult

public BNFTestResult()
Creates a new BNFTestResult object.

Method Detail

addCommittableToken

public boolean addCommittableToken(BNFTestableObject token)
Adds a token to the list of committable tokens

Parameters:
token - The token to add
Returns:
true if the token was successfully added

addCommittableTokens

public boolean addCommittableTokens(java.util.List<BNFTestableObject> list)
Adds a list of tokens to the list of committable tokens

Parameters:
list - The list of tokens to add
Returns:
true if the tokens were successfully added

addReplayableToken

public boolean addReplayableToken(BNFTestableObject token)
Adds a token to the list of replayable tokens

Parameters:
token - The token to add
Returns:
true if the token was successfully added

addReplayableTokens

public boolean addReplayableTokens(java.util.List<BNFTestableObject> list)
Adds a list of tokens to the list of replayable tokens

Parameters:
list - The list of tokens to add
Returns:
true if the tokens were successfully added

getCommittableTokens

public java.util.List<BNFTestableObject> getCommittableTokens()
Destructively retrieves the list of committable tokens. After invoking this method the list of committable tokens is empty

Returns:
The list of committable tokens

getReplayableTokens

public java.util.List<BNFTestableObject> getReplayableTokens()
Destructively retrieves the list of replayable tokens. After invoking this method the list of replayable tokens is empty

Returns:
The list of replayable tokens

isFailed

public boolean isFailed()
Indicates the test failed

Returns:
true if the test failed

isFinished

public boolean isFinished()
Indicates that the test finished

Returns:
true if the test finished

isUnfinished

public boolean isUnfinished()
Indicatest that the test is unfinished

Returns:
true if the test is unfinished

setResult

public void setResult(int result)
Sets the completion status of this result object

Parameters:
result - The completion status of the result object
Throws:
java.lang.IllegalArgumentException - If the result is not one of FINISHED, UNFINISHED or FAILED

toString

public java.lang.String toString()
Returns a text representation of this object

Overrides:
toString in class java.lang.Object
Returns:
A text representation of this object