|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
edu.rice.cs.drjava.DrJavaTestCase
edu.rice.cs.drjava.model.FindReplaceMachineTest
public class FindReplaceMachineTest
Tests the FindReplaceMachine.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class junit.framework.TestCase |
|---|
TestCase.WrappedException |
| Field Summary | |
|---|---|
private OpenDefinitionsDocument |
_doc
|
private OpenDefinitionsDocument |
_docNext
|
private OpenDefinitionsDocument |
_docPrev
|
private FindReplaceMachine |
_frm
|
private static AbstractGlobalModel |
_model
|
private int |
_offset
|
private FindResult |
_result
|
private java.io.File |
_tempDir
|
private static java.lang.String |
EVIL_TEXT
|
private static java.lang.String |
EVIL_TEXT_NEXT
|
private static java.lang.String |
EVIL_TEXT_PREV
|
private static java.lang.String |
FIND_MULTI_LINE_SEARCH_STR
|
private static java.lang.String |
FIND_WHOLE_WORD_TEST_1
|
private static java.lang.String |
IGNORE_TEXT
|
| Constructor Summary | |
|---|---|
FindReplaceMachineTest()
|
|
| Method Summary | |
|---|---|
private void |
_assertOffset(FindReplaceMachine frm,
int current)
|
private void |
_assertOffsets(FindReplaceMachine frm,
int start,
int current)
|
private void |
_initFrm(int pos)
|
private void |
_testFindNextFails(FindReplaceMachine frm,
int start,
int current)
|
private void |
_testFindNextSucceeds(FindReplaceMachine frm,
int start,
int found)
|
private void |
_testFindNextSucceeds(FindReplaceMachine frm,
int start,
int found,
OpenDefinitionsDocument doc)
|
private void |
replaceAll()
|
void |
setUp()
Initializes the document for the tests. |
void |
tearDown()
Clean up for every test case. |
void |
testAnyOccurrenceSearchIgnore()
|
void |
testCreateMachineSuccess()
|
void |
testFindMatchWithCaretInMiddle()
|
void |
testFindMatchWithCaretInMiddleBackwards()
|
void |
testFindMultiLine()
|
void |
testFindNextAndFailIsOnMatch()
|
void |
testFindNextOnSuffix()
|
void |
testFindNextUpdatesCurrent()
|
void |
testFindNoMatchCase()
|
void |
testFindPartialSubstrings()
This test checks that a findNext won't find two matches that partially overlap. |
void |
testFindPrevOnPrefix()
|
void |
testFindReplaceInAllOpenFiles()
This test addresses feature request #784514 Find/Replace in all Open Files. |
void |
testFindReplaceInAllOpenFilesWholeWord()
|
void |
testMultipleCallsToFindNext()
|
void |
testNotInDocument()
|
void |
testReplaceAllBackwards()
|
void |
testReplaceAllContinue()
|
void |
testReplaceAllContinueNoMatchCase()
|
void |
testReplaceAllSameWord()
This test checks that replacing a word with itself will halt on replace all. |
void |
testReplaceCreatesMatch()
This tests that a replace all where the replacement action creates a new match does not replace this new match |
void |
testReplaceCreatesMatchBackwards()
This tests that a replace all backwards where the replacement action creates a new match does not replace this new match |
void |
testSearchesDoNotRepeatWhenChangingDirection()
This test addresses bug #745714 Searches Repeat When Changing Direction. |
void |
testSimpleReplace()
|
void |
testStartFromTopContinue()
|
void |
testWholeWordSearchIgnore()
|
void |
testWholeWordSearchOnTestString1()
|
| Methods inherited from class edu.rice.cs.drjava.DrJavaTestCase |
|---|
setConfigSetting, setDocText |
| Methods inherited from class junit.framework.TestCase |
|---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, 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, format |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private volatile OpenDefinitionsDocument _doc
private volatile OpenDefinitionsDocument _docPrev
private volatile OpenDefinitionsDocument _docNext
private volatile FindResult _result
private volatile FindReplaceMachine _frm
private volatile java.io.File _tempDir
private volatile int _offset
private static final AbstractGlobalModel _model
private static final java.lang.String EVIL_TEXT
private static final java.lang.String EVIL_TEXT_PREV
private static final java.lang.String EVIL_TEXT_NEXT
private static final java.lang.String FIND_WHOLE_WORD_TEST_1
private static final java.lang.String FIND_MULTI_LINE_SEARCH_STR
private static final java.lang.String IGNORE_TEXT
| Constructor Detail |
|---|
public FindReplaceMachineTest()
| Method Detail |
|---|
public void setUp()
throws java.lang.Exception
setUp in class DrJavaTestCasejava.lang.Exception - This convention is mandated by JUnit.TestCase, the superclass of this class.
public void tearDown()
throws java.lang.Exception
DrJavaTestCase
tearDown in class DrJavaTestCasejava.lang.Exceptionprivate void _initFrm(int pos)
public void testCreateMachineSuccess()
throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationException
public void testFindNextUpdatesCurrent()
throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationException
public void testFindNextAndFailIsOnMatch()
throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationException
public void testFindNextOnSuffix()
throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationException
public void testFindPrevOnPrefix()
throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationException
public void testMultipleCallsToFindNext()
throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationException
public void testStartFromTopContinue()
throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationException
public void testNotInDocument()
throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationException
public void testSimpleReplace()
throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationException
public void testReplaceAllContinue()
throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationException
public void testFindNoMatchCase()
throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationException
public void testReplaceAllContinueNoMatchCase()
throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationException
public void testReplaceAllBackwards()
throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationException
public void testFindMatchWithCaretInMiddle()
throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationException
public void testFindMatchWithCaretInMiddleBackwards()
throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationException
public void testReplaceCreatesMatch()
throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationException
public void testReplaceCreatesMatchBackwards()
throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationException
public void testReplaceAllSameWord()
throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationException
public void testFindPartialSubstrings()
throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationException
public void testSearchesDoNotRepeatWhenChangingDirection()
throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationException
public void testFindReplaceInAllOpenFiles()
throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationException
public void testFindReplaceInAllOpenFilesWholeWord()
throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationException
public void testFindMultiLine()
throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationException
public void testWholeWordSearchOnTestString1()
throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationException
public void testWholeWordSearchIgnore()
throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationException
public void testAnyOccurrenceSearchIgnore()
throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationException
private void _testFindNextSucceeds(FindReplaceMachine frm,
int start,
int found,
OpenDefinitionsDocument doc)
private void _testFindNextSucceeds(FindReplaceMachine frm,
int start,
int found)
private void _testFindNextFails(FindReplaceMachine frm,
int start,
int current)
private void _assertOffsets(FindReplaceMachine frm,
int start,
int current)
private void _assertOffset(FindReplaceMachine frm,
int current)
private void replaceAll()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||