com.ohrasys.cad.bnf
Class BNFNoFallthruTest

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

public class BNFNoFallthruTest
extends BNFAbstractTest

Represents a terminal test


Field Summary
protected  int requirement
          The requirement that must be matched in order for the test to pass
 
Fields inherited from class com.ohrasys.cad.bnf.BNFAbstractTest
collectedData, collecting, committed, formatting, i18n, nextTest, playable, result, tests
 
Constructor Summary
BNFNoFallthruTest(int requirement)
          Creates a new BNFNoFallthruTest object.
 
Method Summary
protected  void checkTests()
          A method to ensure that the sub-test list is null.
 BNFTestResult test(BNFTestableObject obj)
          A method to evaluate this test.
 java.lang.String toString()
          Returns a text representation of this test
 
Methods inherited from class com.ohrasys.cad.bnf.BNFAbstractTest
collect, isFirstTest, isLastTest, isNotLastTest, reset, setCollecting, setFormatting
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

requirement

protected int requirement
The requirement that must be matched in order for the test to pass

Constructor Detail

BNFNoFallthruTest

public BNFNoFallthruTest(int requirement)
                  throws BNFTestException
Creates a new BNFNoFallthruTest object.

Parameters:
requirement - The requirement for the test.
Throws:
BNFTestException - If an error in test creation occurs
Method Detail

test

public BNFTestResult test(BNFTestableObject obj)
A method to evaluate this test.

Specified by:
test in interface BNFTestImplementor
Specified by:
test in class BNFAbstractTest
Parameters:
obj - The testable object from which to extract the token used to evaluate the test.
Returns:
A BNFTestResult object representing the result of this test evaluation. If the test passes, the status of the result is FINISHED and the BNFTestableObject used to evaluate the test is added to the committable list of the result. Otherwise the status of the result is FAILED and the BNFTestableObject used to evaluate the test is added to the replayable list of the result.

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

checkTests

protected void checkTests()
                   throws BNFTestException
A method to ensure that the sub-test list is null. This is required since this is a terminal test.

Overrides:
checkTests in class BNFAbstractTest
Throws:
BNFTestException - If the sub-test list of this test is not null