laser.regularlanguage.fsa.test
Class FSARelatedTests<L extends LabelInterface>

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by laser.regularlanguage.fsa.test.FSARelatedTests<L>
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
FSAStateTests, FSATests

public abstract class FSARelatedTests<L extends LabelInterface>
extends junit.framework.TestCase


Field Summary
protected  FSAInterface<L> emptyDFA_
           
protected  FSAInterface<L> labelDFA_
           
protected  FSAInterface<L> labelEpsilonFreeNFA_
           
protected  FSAInterface<L> starDFA_
           
protected  FSAInterface<L> starNFA_
           
 
Constructor Summary
FSARelatedTests()
           
 
Method Summary
protected abstract  AlphabetInterface<L> _createAlphabetInstance()
          Creates a new empty Alphabet.
protected abstract  FSAInterface<L> _createEmptyDFA()
          Creates an empty DFA.
protected abstract  FSAInterface<L> _createLabelDFA()
          Creates a label DFA.
protected abstract  FSAInterface<L> _createLabelEpsilonFreeNFA()
          Creates a label epsilon-free NFA if non-determinism is supported.
protected abstract  FSAInterface<L> _createStarDFA()
          Creates a star DFA.
protected abstract  FSAInterface<L> _createStarNFA()
          Creates a star NFA if epsilon transitions are supported.
protected  void _setUp()
           
protected  void checkEmptyDFAPostconditions(FSAInterface<L> emptyDFA)
          Checks that the empty DFA postconditions are met.
protected  void checkLabelDFAPostconditions(FSAInterface<L> labelDFA)
          Checks that the label DFA postconditions are met.
protected  void checkLabelEpsilonFreeNFAPostconditions(FSAInterface<L> labelEpsilonFreeNFA)
          Checks that the label epsilon free NFA postconditions are met.
protected  void checkStarDFAPostconditions(FSAInterface<L> starDFA)
          Checks that the star DFA postconditions are met.
 void checkStarNFAPostconditions(FSAInterface<L> starNFA)
          Checks that the star NFA postconditions are met.
protected  AlphabetInterface<L> copyAlphabetInstance(AlphabetInterface<L> sigma)
          Creates a copy of the given Alphabet.
protected  void setUp()
           
 void testCheckEmptyDFAPostconditions()
          Checks that the empty DFA postconditions are met.
 void testCheckLabelDFAPostconditions()
          Checks that the label DFA postconditions are met.
 void testCheckLabelEpsilonFreeNFAPostconditions()
          Checks that the label epsilon free NFA postconditions are met.
 void testCheckStarDFAPostconditions()
          Checks that the star DFA postconditions are met.
 void testCheckStarNFAPostconditions()
          Checks that the star NFA postconditions are met.
 void testDFAInterfaceIsWellDefined()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

emptyDFA_

protected FSAInterface<L extends LabelInterface> emptyDFA_

labelDFA_

protected FSAInterface<L extends LabelInterface> labelDFA_

starDFA_

protected FSAInterface<L extends LabelInterface> starDFA_

labelEpsilonFreeNFA_

protected FSAInterface<L extends LabelInterface> labelEpsilonFreeNFA_

starNFA_

protected FSAInterface<L extends LabelInterface> starNFA_
Constructor Detail

FSARelatedTests

public FSARelatedTests()
Method Detail

setUp

protected final void setUp()
                    throws java.lang.Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
java.lang.Exception

_setUp

protected void _setUp()
               throws java.lang.Exception
Throws:
java.lang.Exception

_createAlphabetInstance

protected abstract AlphabetInterface<L> _createAlphabetInstance()
Creates a new empty Alphabet. POSTCONDITIONS:


copyAlphabetInstance

protected final AlphabetInterface<L> copyAlphabetInstance(AlphabetInterface<L> sigma)
Creates a copy of the given Alphabet.

Parameters:
sigma - The Alphabet to be copied
Returns:
The copied Alphabet

_createEmptyDFA

protected abstract FSAInterface<L> _createEmptyDFA()
Creates an empty DFA.

POSTCONDITIONS:

Returns:
An empty DFA

_createLabelDFA

protected abstract FSAInterface<L> _createLabelDFA()
Creates a label DFA.

POSTCONDITIONS:

Returns:
A label DFA

_createStarDFA

protected abstract FSAInterface<L> _createStarDFA()
Creates a star DFA.

POSTCONDITIONS:

Returns:
A star DFA

_createLabelEpsilonFreeNFA

protected abstract FSAInterface<L> _createLabelEpsilonFreeNFA()
Creates a label epsilon-free NFA if non-determinism is supported.

POSTCONDITIONS if non-determinism is supported:

Returns:
A label epsilon-free NFA if non-determinism is supported otherwise null

_createStarNFA

protected abstract FSAInterface<L> _createStarNFA()
Creates a star NFA if epsilon transitions are supported.

POSTCONDITIONS if epsilon transitions are supported:

Returns:
A star NFA if epsilon transitions are supported otherwise null

checkEmptyDFAPostconditions

protected void checkEmptyDFAPostconditions(FSAInterface<L> emptyDFA)
Checks that the empty DFA postconditions are met.

See Also:
_createEmptyDFA()

checkLabelDFAPostconditions

protected void checkLabelDFAPostconditions(FSAInterface<L> labelDFA)
Checks that the label DFA postconditions are met.

See Also:
_createLabelDFA()

checkStarDFAPostconditions

protected void checkStarDFAPostconditions(FSAInterface<L> starDFA)
Checks that the star DFA postconditions are met.

See Also:
_createStarDFA()

checkLabelEpsilonFreeNFAPostconditions

protected void checkLabelEpsilonFreeNFAPostconditions(FSAInterface<L> labelEpsilonFreeNFA)
Checks that the label epsilon free NFA postconditions are met.

See Also:
_createLabelEpsilonFreeNFA()

checkStarNFAPostconditions

public void checkStarNFAPostconditions(FSAInterface<L> starNFA)
Checks that the star NFA postconditions are met.

See Also:
_createStarNFA()

testCheckEmptyDFAPostconditions

public final void testCheckEmptyDFAPostconditions()
Checks that the empty DFA postconditions are met.

See Also:
_createEmptyDFA()

testCheckLabelDFAPostconditions

public final void testCheckLabelDFAPostconditions()
Checks that the label DFA postconditions are met.

See Also:
_createLabelDFA()

testCheckStarDFAPostconditions

public final void testCheckStarDFAPostconditions()
Checks that the star DFA postconditions are met.

See Also:
_createStarDFA()

testCheckLabelEpsilonFreeNFAPostconditions

public final void testCheckLabelEpsilonFreeNFAPostconditions()
Checks that the label epsilon free NFA postconditions are met.

See Also:
_createLabelEpsilonFreeNFA()

testCheckStarNFAPostconditions

public void testCheckStarNFAPostconditions()
Checks that the star NFA postconditions are met.

See Also:
_createStarNFA()

testDFAInterfaceIsWellDefined

public final void testDFAInterfaceIsWellDefined()