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

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

public abstract class MutableFSATests<L extends LabelInterface>
extends FSATests<L>


Field Summary
protected  MutableFSAInterface<L> fsa_
           
protected  AbstractMutableFSAFactory<L> fsaFactory_
           
protected  LabelPatternInterface<L> labelPattern_
           
protected  MutableFSAInterface<L> labelPatternDFA_
           
 
Fields inherited from class laser.regularlanguage.fsa.test.FSARelatedTests
emptyDFA_, labelDFA_, labelEpsilonFreeNFA_, starDFA_, starNFA_
 
Constructor Summary
MutableFSATests()
           
 
Method Summary
 AlphabetInterface<L> _createAlphabetInstance()
          Creates a new empty Alphabet.
protected  MutableFSAInterface<L> _createEmptyDFA()
          Creates an empty DFA.
protected  MutableFSAInterface<L> _createLabelDFA()
          Creates a label DFA.
protected  MutableFSAInterface<L> _createLabelEpsilonFreeNFA()
          Creates a label epsilon-free NFA if non-determinism is supported.
protected  MutableFSAInterface<L> _createLabelPatternDFA()
           
protected abstract  AbstractMutableFSAFactory<L> _createMutableFSAFactory()
           
protected  MutableFSAInterface<L> _createStarDFA()
          Creates a star DFA.
protected  MutableFSAInterface<L> _createStarNFA()
          Creates a star NFA if epsilon transitions are supported.
protected  void _setUp()
           
protected  void abstractEquals(FSAInterface<L> oldFSA, FSAInterface<L> newFSA)
           
protected  MutableFSAInterface<L> getEmptyDFA()
           
protected  MutableFSAInterface<L> getLabelDFA()
           
protected  MutableFSAInterface<L> getLabelEpsilonFreeNFA()
           
protected  MutableFSAInterface<L> getLabelPatternDFA()
           
protected  MutableFSAInterface<L> getStarDFA()
           
protected  MutableFSAInterface<L> getStarNFA()
           
 void testAddEpsilonTransitionNullSource()
           
 void testAddEpsilonTransitionNullTarget()
           
 void testAddEpsilonTransitionOnce()
           
 void testAddEpsilonTransitionSourceNotInQ()
           
 void testAddEpsilonTransitionTargetNotInQ()
           
 void testAddEpsilonTransitionTwice()
           
 void testAddLabel()
           
 void testAddLabelInSigma()
           
 void testAddLabelNull()
           
 void testAddLabelPatternTransitionNullLabelPattern()
           
 void testAddLabelPatternTransitionNullSource()
           
 void testAddLabelPatternTransitionNullTarget()
           
 void testAddLabelPatternTransitionOnce()
           
 void testAddLabelPatternTransitionSourceNotInQ()
           
 void testAddLabelPatternTransitionTargetNotInQ()
           
 void testAddLabelPatternTransitionTwice()
           
 void testAddLabelTransitionLabelNotInSigma()
           
 void testAddLabelTransitionNullLabel()
           
 void testAddLabelTransitionNullSource()
           
 void testAddLabelTransitionNullTarget()
           
 void testAddLabelTransitionOnce()
           
 void testAddLabelTransitionSourceNotInQ()
           
 void testAddLabelTransitionTargetNotInQ()
           
 void testAddLabelTransitionTwice()
           
 void testAddState()
           
 void testCheckWellFormedNullStartStateReturnsNotNull()
           
 void testCreateLabelInstance()
           
 void testDeleteDeadReturnsFalse()
           
 void testDeleteDeadReturnsTrue()
           
 void testDeleteUnreachableReturnsFalse()
           
 void testDeleteUnreachableReturnsTrue()
           
 void testGetLabelPatternTransitionNullLabelPattern()
           
 void testGetLabelPatternTransitionNullSource()
           
 void testGetLabelPatternTransitionNullTarget()
           
 void testGetLabelPatternTransitionReturnsNotNull()
           
 void testGetLabelPatternTransitionReturnsNull()
           
 void testGetLabelPatternTransitionSourceNotInQ()
           
 void testGetLabelPatternTransitionTargetNotInQ()
           
 void testGetRunnableFSANotWellFormedFSA()
           
 void testGetRunnableFSAWellFormedFSA()
           
 void testHasLabelPatternTransitionsReturnFalse()
           
 void testHasLabelPatternTransitionsReturnsTrue()
           
 void testIsDeterministicNotWellFormed()
           
 void testMakeTotalReturnsNotNull()
           
 void testMakeTotalReturnsNull()
           
 void testRemoveEpsilonTransitionInT()
           
 void testRemoveEpsilonTransitionNotInT()
           
 void testRemoveEpsilonTransitionNull()
           
protected  void testRemoveLabelInSigma(L l)
           
 void testRemoveLabelInSigmaWithoutTransition()
           
 void testRemoveLabelInSigmaWithTransition()
           
 void testRemoveLabelNotInSigma()
           
 void testRemoveLabelNull()
           
 void testRemoveLabelPatternTransitionInT()
           
 void testRemoveLabelPatternTransitionNotInT()
           
 void testRemoveLabelPatternTransitionNull()
           
protected  void testRemoveLabelsInSigma(java.util.Set<L> labels)
           
 void testRemoveLabelsInSigmaWithoutTransition()
           
 void testRemoveLabelsInSigmaWithTransition()
           
 void testRemoveLabelsLabelNotInSigma()
           
 void testRemoveLabelsLabelNull()
           
 void testRemoveLabelsNull()
           
 void testRemoveLabelTransitionInT()
           
 void testRemoveLabelTransitionNotInT()
           
 void testRemoveLabelTransitionNull()
           
 void testRemoveStateInQIsNotStartIsAccept()
           
 void testRemoveStateInQIsStartIsNotAccept()
           
 void testRemoveStateNotInQ()
           
 void testRemoveStateNull()
           
 void testRemoveTransitionInT(MutableFSAInterface<L> fsa, FSATransitionInterface<L> t)
           
protected  void testRemoveTransitionNotInT(MutableFSAInterface<L> fsa, FSATransitionInterface<L> t)
           
protected  void testRemoveTransitionNull(MutableFSAInterface<L> fsa, FSATransitionInterface<L> t)
           
 void testReplaceLabelPatternTransitionsWithLabelTransitionsHasLabelPatterns()
           
 void testReplaceLabelPatternTransitionsWithLabelTransitionsNotHasLabelPatterns()
           
 void testSetAlphabetNotNull()
           
 void testSetAlphabetNotNullIsCopy()
           
 void testSetAlphabetNull()
           
 void testSetStartStateInQ()
           
 void testSetStartStateNotInQ()
           
 void testSetStartStateNull()
           
 
Methods inherited from class laser.regularlanguage.fsa.test.FSATests
testCheckWellFormedReturnsNull, testClone, testGetAcceptStatesAndGetNonAcceptStatesAreMutuallyExclusive, testGetAcceptStatesIsCopy, testGetAcceptStatesThenIsAcceptReturnsTrue, testGetAcceptStatesUnionGetNonAcceptStatesIsGetStates, testGetAlphabetIsCopy, testGetDescriptionNotNullIsCopy, testGetEpsilonTransitionNullSource, testGetEpsilonTransitionNullTarget, testGetEpsilonTransitionReturnsNotNull, testGetEpsilonTransitionReturnsNull, testGetEpsilonTransitionSourceNotInQ, testGetEpsilonTransitionTargetNotInQ, testGetLabelTransitionLabelNotInSigma, testGetLabelTransitionNullLabel, testGetLabelTransitionNullSource, testGetLabelTransitionNullTarget, testGetLabelTransitionReturnsNotNull, testGetLabelTransitionReturnsNull, testGetLabelTransitionSourceNotInQ, testGetLabelTransitionTargetNotInQ, testGetNonAcceptStatesIsCopy, testGetNonAcceptStatesThenIsAcceptReturnsFalse, testGetStartStateReturnsNotNull, testGetStatesHaveUniqueIDs, testGetStatesIsCopy, testGetTransitionsHaveUniqueIDs, testGetTransitionsIsCopy, testGetTransitionsNullSource, testGetTransitionsNullTarget, testGetTransitionsReturnsEmpty, testGetTransitionsReturnsEmptyIsCopy, testGetTransitionsReturnsNotEmpty, testGetTransitionsReturnsNotEmptyIsCopy, testGetTransitionsSourceNotInQ, testGetTransitionsTargetNotInQ, testHasEpsilonTransitionsReturnsFalse, testHasEpsilonTransitionsReturnsTrue, testIsDeterministicHasEpsilonReturnsFalse, testIsDeterministicHasNondeterminismReturnsFalse, testIsDeterministicReturnsTrue, testIsTotalReturnsFalse, testIsTotalReturnsTrue, testSetDescriptionNotNull, testSetDescriptionNotNullIsCopy, testSetDescriptionNull, testSetNameNotNull, testSetNameNull
 
Methods inherited from class laser.regularlanguage.fsa.test.FSARelatedTests
checkEmptyDFAPostconditions, checkLabelDFAPostconditions, checkLabelEpsilonFreeNFAPostconditions, checkStarDFAPostconditions, checkStarNFAPostconditions, copyAlphabetInstance, setUp, testCheckEmptyDFAPostconditions, testCheckLabelDFAPostconditions, testCheckLabelEpsilonFreeNFAPostconditions, testCheckStarDFAPostconditions, testCheckStarNFAPostconditions, 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

fsaFactory_

protected AbstractMutableFSAFactory<L extends LabelInterface> fsaFactory_

fsa_

protected MutableFSAInterface<L extends LabelInterface> fsa_

labelPattern_

protected LabelPatternInterface<L extends LabelInterface> labelPattern_

labelPatternDFA_

protected MutableFSAInterface<L extends LabelInterface> labelPatternDFA_
Constructor Detail

MutableFSATests

public MutableFSATests()
Method Detail

_setUp

protected void _setUp()
               throws java.lang.Exception
Overrides:
_setUp in class FSARelatedTests<L extends LabelInterface>
Throws:
java.lang.Exception

_createEmptyDFA

protected MutableFSAInterface<L> _createEmptyDFA()
Description copied from class: FSARelatedTests
Creates an empty DFA.

POSTCONDITIONS:

Specified by:
_createEmptyDFA in class FSARelatedTests<L extends LabelInterface>
Returns:
An empty DFA

_createLabelDFA

protected MutableFSAInterface<L> _createLabelDFA()
Description copied from class: FSARelatedTests
Creates a label DFA.

POSTCONDITIONS:

Specified by:
_createLabelDFA in class FSARelatedTests<L extends LabelInterface>
Returns:
A label DFA

_createLabelPatternDFA

protected MutableFSAInterface<L> _createLabelPatternDFA()

_createLabelEpsilonFreeNFA

protected MutableFSAInterface<L> _createLabelEpsilonFreeNFA()
Description copied from class: FSARelatedTests
Creates a label epsilon-free NFA if non-determinism is supported.

POSTCONDITIONS if non-determinism is supported:

Specified by:
_createLabelEpsilonFreeNFA in class FSARelatedTests<L extends LabelInterface>
Returns:
A label epsilon-free NFA if non-determinism is supported otherwise null

_createStarDFA

protected MutableFSAInterface<L> _createStarDFA()
Description copied from class: FSARelatedTests
Creates a star DFA.

POSTCONDITIONS:

Specified by:
_createStarDFA in class FSARelatedTests<L extends LabelInterface>
Returns:
A star DFA

_createStarNFA

protected MutableFSAInterface<L> _createStarNFA()
Description copied from class: FSARelatedTests
Creates a star NFA if epsilon transitions are supported.

POSTCONDITIONS if epsilon transitions are supported:

Specified by:
_createStarNFA in class FSARelatedTests<L extends LabelInterface>
Returns:
A star NFA if epsilon transitions are supported otherwise null

getEmptyDFA

protected MutableFSAInterface<L> getEmptyDFA()

getLabelDFA

protected MutableFSAInterface<L> getLabelDFA()

getLabelPatternDFA

protected MutableFSAInterface<L> getLabelPatternDFA()

getLabelEpsilonFreeNFA

protected MutableFSAInterface<L> getLabelEpsilonFreeNFA()

getStarDFA

protected MutableFSAInterface<L> getStarDFA()

getStarNFA

protected MutableFSAInterface<L> getStarNFA()

_createMutableFSAFactory

protected abstract AbstractMutableFSAFactory<L> _createMutableFSAFactory()

_createAlphabetInstance

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

Specified by:
_createAlphabetInstance in class FSARelatedTests<L extends LabelInterface>

abstractEquals

protected void abstractEquals(FSAInterface<L> oldFSA,
                              FSAInterface<L> newFSA)
Overrides:
abstractEquals in class FSATests<L extends LabelInterface>

testCreateLabelInstance

public final void testCreateLabelInstance()

testAddLabelNull

public final void testAddLabelNull()

testAddLabelInSigma

public final void testAddLabelInSigma()

testAddLabel

public final void testAddLabel()

testRemoveLabelNull

public final void testRemoveLabelNull()

testRemoveLabelNotInSigma

public final void testRemoveLabelNotInSigma()

testRemoveLabelInSigma

protected final void testRemoveLabelInSigma(L l)

testRemoveLabelInSigmaWithTransition

public final void testRemoveLabelInSigmaWithTransition()

testRemoveLabelInSigmaWithoutTransition

public final void testRemoveLabelInSigmaWithoutTransition()

testRemoveLabelsNull

public final void testRemoveLabelsNull()

testRemoveLabelsLabelNull

public final void testRemoveLabelsLabelNull()

testRemoveLabelsLabelNotInSigma

public final void testRemoveLabelsLabelNotInSigma()

testRemoveLabelsInSigma

protected final void testRemoveLabelsInSigma(java.util.Set<L> labels)

testRemoveLabelsInSigmaWithTransition

public final void testRemoveLabelsInSigmaWithTransition()

testRemoveLabelsInSigmaWithoutTransition

public final void testRemoveLabelsInSigmaWithoutTransition()

testSetAlphabetNull

public final void testSetAlphabetNull()

testSetAlphabetNotNull

public final void testSetAlphabetNotNull()

testSetAlphabetNotNullIsCopy

public final void testSetAlphabetNotNullIsCopy()

testAddState

public final void testAddState()

testRemoveStateNull

public final void testRemoveStateNull()

testRemoveStateNotInQ

public final void testRemoveStateNotInQ()

testRemoveStateInQIsStartIsNotAccept

public final void testRemoveStateInQIsStartIsNotAccept()

testRemoveStateInQIsNotStartIsAccept

public final void testRemoveStateInQIsNotStartIsAccept()

testSetStartStateNull

public final void testSetStartStateNull()

testSetStartStateNotInQ

public final void testSetStartStateNotInQ()

testSetStartStateInQ

public final void testSetStartStateInQ()

testRemoveTransitionNull

protected final void testRemoveTransitionNull(MutableFSAInterface<L> fsa,
                                              FSATransitionInterface<L> t)

testRemoveTransitionNotInT

protected final void testRemoveTransitionNotInT(MutableFSAInterface<L> fsa,
                                                FSATransitionInterface<L> t)

testRemoveTransitionInT

public final void testRemoveTransitionInT(MutableFSAInterface<L> fsa,
                                          FSATransitionInterface<L> t)

testAddEpsilonTransitionNullSource

public final void testAddEpsilonTransitionNullSource()

testAddEpsilonTransitionNullTarget

public final void testAddEpsilonTransitionNullTarget()

testAddEpsilonTransitionSourceNotInQ

public final void testAddEpsilonTransitionSourceNotInQ()

testAddEpsilonTransitionTargetNotInQ

public final void testAddEpsilonTransitionTargetNotInQ()

testAddEpsilonTransitionOnce

public final void testAddEpsilonTransitionOnce()

testAddEpsilonTransitionTwice

public final void testAddEpsilonTransitionTwice()

testRemoveEpsilonTransitionNull

public final void testRemoveEpsilonTransitionNull()

testRemoveEpsilonTransitionNotInT

public final void testRemoveEpsilonTransitionNotInT()

testRemoveEpsilonTransitionInT

public final void testRemoveEpsilonTransitionInT()

testAddLabelTransitionNullSource

public final void testAddLabelTransitionNullSource()

testAddLabelTransitionNullTarget

public final void testAddLabelTransitionNullTarget()

testAddLabelTransitionNullLabel

public final void testAddLabelTransitionNullLabel()

testAddLabelTransitionSourceNotInQ

public final void testAddLabelTransitionSourceNotInQ()

testAddLabelTransitionTargetNotInQ

public final void testAddLabelTransitionTargetNotInQ()

testAddLabelTransitionLabelNotInSigma

public final void testAddLabelTransitionLabelNotInSigma()

testAddLabelTransitionOnce

public final void testAddLabelTransitionOnce()

testAddLabelTransitionTwice

public final void testAddLabelTransitionTwice()

testRemoveLabelTransitionNull

public final void testRemoveLabelTransitionNull()

testRemoveLabelTransitionNotInT

public final void testRemoveLabelTransitionNotInT()

testRemoveLabelTransitionInT

public final void testRemoveLabelTransitionInT()

testAddLabelPatternTransitionNullSource

public final void testAddLabelPatternTransitionNullSource()

testAddLabelPatternTransitionNullTarget

public final void testAddLabelPatternTransitionNullTarget()

testAddLabelPatternTransitionNullLabelPattern

public final void testAddLabelPatternTransitionNullLabelPattern()

testAddLabelPatternTransitionSourceNotInQ

public final void testAddLabelPatternTransitionSourceNotInQ()

testAddLabelPatternTransitionTargetNotInQ

public final void testAddLabelPatternTransitionTargetNotInQ()

testAddLabelPatternTransitionOnce

public final void testAddLabelPatternTransitionOnce()

testAddLabelPatternTransitionTwice

public final void testAddLabelPatternTransitionTwice()

testGetLabelPatternTransitionNullSource

public final void testGetLabelPatternTransitionNullSource()

testGetLabelPatternTransitionNullTarget

public final void testGetLabelPatternTransitionNullTarget()

testGetLabelPatternTransitionNullLabelPattern

public final void testGetLabelPatternTransitionNullLabelPattern()

testGetLabelPatternTransitionSourceNotInQ

public final void testGetLabelPatternTransitionSourceNotInQ()

testGetLabelPatternTransitionTargetNotInQ

public final void testGetLabelPatternTransitionTargetNotInQ()

testGetLabelPatternTransitionReturnsNotNull

public final void testGetLabelPatternTransitionReturnsNotNull()

testGetLabelPatternTransitionReturnsNull

public final void testGetLabelPatternTransitionReturnsNull()

testHasLabelPatternTransitionsReturnFalse

public final void testHasLabelPatternTransitionsReturnFalse()

testHasLabelPatternTransitionsReturnsTrue

public final void testHasLabelPatternTransitionsReturnsTrue()

testRemoveLabelPatternTransitionNull

public final void testRemoveLabelPatternTransitionNull()

testRemoveLabelPatternTransitionNotInT

public final void testRemoveLabelPatternTransitionNotInT()

testRemoveLabelPatternTransitionInT

public final void testRemoveLabelPatternTransitionInT()

testCheckWellFormedNullStartStateReturnsNotNull

public final void testCheckWellFormedNullStartStateReturnsNotNull()

testDeleteDeadReturnsFalse

public final void testDeleteDeadReturnsFalse()

testDeleteDeadReturnsTrue

public final void testDeleteDeadReturnsTrue()

testDeleteUnreachableReturnsFalse

public final void testDeleteUnreachableReturnsFalse()

testDeleteUnreachableReturnsTrue

public final void testDeleteUnreachableReturnsTrue()

testGetRunnableFSANotWellFormedFSA

public final void testGetRunnableFSANotWellFormedFSA()

testGetRunnableFSAWellFormedFSA

public final void testGetRunnableFSAWellFormedFSA()

testIsDeterministicNotWellFormed

public final void testIsDeterministicNotWellFormed()

testMakeTotalReturnsNotNull

public final void testMakeTotalReturnsNotNull()

testMakeTotalReturnsNull

public final void testMakeTotalReturnsNull()

testReplaceLabelPatternTransitionsWithLabelTransitionsHasLabelPatterns

public final void testReplaceLabelPatternTransitionsWithLabelTransitionsHasLabelPatterns()

testReplaceLabelPatternTransitionsWithLabelTransitionsNotHasLabelPatterns

public final void testReplaceLabelPatternTransitionsWithLabelTransitionsNotHasLabelPatterns()