com.ohrasys.cad.bnf
Class BNFOptionalTest

java.lang.Object
  extended by com.ohrasys.cad.bnf.BNFAbstractTest
      extended by com.ohrasys.cad.bnf.BNFOptionalTest
All Implemented Interfaces:
BNFTestImplementor

public class BNFOptionalTest
extends BNFAbstractTest

A test in which all sub-tests must occur zero or one time


Field Summary
 
Fields inherited from class com.ohrasys.cad.bnf.BNFAbstractTest
collectedData, collecting, committed, formatting, i18n, nextTest, playable, result, tests
 
Constructor Summary
BNFOptionalTest(BNFTestImplementor[] tests)
          Creates a new BNFOptionalTest object.
 
Method Summary
 BNFTestResult test(BNFTestableObject obj)
          A method to evaluate this test using the supplied testable object
 java.lang.String toString()
          Returns a text representation of this test
 
Methods inherited from class com.ohrasys.cad.bnf.BNFAbstractTest
checkTests, collect, isFirstTest, isLastTest, isNotLastTest, reset, setCollecting, setFormatting
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BNFOptionalTest

public BNFOptionalTest(BNFTestImplementor[] tests)
                throws BNFTestException
Creates a new BNFOptionalTest object.

Parameters:
tests - The sub-tests that comprise the test
Throws:
BNFTestException - If the sub-test list is null, zero length or one of the sub-tests is null
Method Detail

test

public BNFTestResult test(BNFTestableObject obj)
A method to evaluate this test using the supplied testable object

Specified by:
test in interface BNFTestImplementor
Specified by:
test in class BNFAbstractTest
Parameters:
obj - The BNFTestableObject from which to extract the token used to evaluate this test
Returns:
A BNFTestResult object representing the result of this test. If more tokens are required to resolve the test, then UNFINISHED is returned and the results committable tokens list and replayable tokens list are empty. If the test completed successfully then FINISHED is returned and the committable tokens list contains a list of all tokens successfully processed by this test and the replayable tokens list contains a list of tokens required to be replayed. Otherwise FAILED is returned and all tokens processed by this test are returned in the replayable list.

toString

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

Overrides:
toString in class BNFAbstractTest
Returns:
A text representation of this test