com.ohrasys.cad.bnf
Class BNFOneOrMoreRequiredTest

java.lang.Object
  extended by com.ohrasys.cad.bnf.BNFAbstractTest
      extended by com.ohrasys.cad.bnf.BNFOneOrMoreRequiredTest
All Implemented Interfaces:
BNFTestImplementor
Direct Known Subclasses:
AndFactorsValidator, BNFValidator, OrFactorsValidator

public class BNFOneOrMoreRequiredTest
extends BNFAbstractTest

A test in which all of the sub-tests must occur one or more times.


Field Summary
 
Fields inherited from class com.ohrasys.cad.bnf.BNFAbstractTest
collectedData, collecting, committed, formatting, i18n, nextTest, playable, result, tests
 
Constructor Summary
BNFOneOrMoreRequiredTest(BNFTestImplementor[] tests)
          Creates a new BNFOneOrMoreRequiredTest object.
 
Method Summary
 void reset()
          Resets the state of the test
 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, setCollecting, setFormatting
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BNFOneOrMoreRequiredTest

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

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

reset

public void reset()
Resets the state of the test

Specified by:
reset in interface BNFTestImplementor
Overrides:
reset in class BNFAbstractTest

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