|
||||||||||
| 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 |
|---|
junit.framework.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 File |
_tempDir
|
private static String |
EVIL_TEXT
|
private static String |
EVIL_TEXT_NEXT
|
private static String |
EVIL_TEXT_PREV
|
private static String |
FIND_MULTI_LINE_SEARCH_STR
|
private static String |
FIND_WHOLE_WORD_TEST_1
|
private static 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 File _tempDir
private volatile int _offset
private static final AbstractGlobalModel _model
private static final String EVIL_TEXT
private static final String EVIL_TEXT_PREV
private static final String EVIL_TEXT_NEXT
private static final String FIND_WHOLE_WORD_TEST_1
private static final String FIND_MULTI_LINE_SEARCH_STR
private static final String IGNORE_TEXT
| Constructor Detail |
|---|
public FindReplaceMachineTest()
| Method Detail |
|---|
public void setUp()
throws Exception
setUp in class DrJavaTestCaseException - This convention is mandated by JUnit.TestCase, the superclass of this class.
public void tearDown()
throws Exception
DrJavaTestCase
tearDown in class DrJavaTestCaseExceptionprivate void _initFrm(int pos)
public void testCreateMachineSuccess()
throws BadLocationException
BadLocationException
public void testFindNextUpdatesCurrent()
throws BadLocationException
BadLocationException
public void testFindNextAndFailIsOnMatch()
throws BadLocationException
BadLocationException
public void testFindNextOnSuffix()
throws BadLocationException
BadLocationException
public void testFindPrevOnPrefix()
throws BadLocationException
BadLocationException
public void testMultipleCallsToFindNext()
throws BadLocationException
BadLocationException
public void testStartFromTopContinue()
throws BadLocationException
BadLocationException
public void testNotInDocument()
throws BadLocationException
BadLocationException
public void testSimpleReplace()
throws BadLocationException
BadLocationException
public void testReplaceAllContinue()
throws BadLocationException
BadLocationException
public void testFindNoMatchCase()
throws BadLocationException
BadLocationException
public void testReplaceAllContinueNoMatchCase()
throws BadLocationException
BadLocationException
public void testReplaceAllBackwards()
throws BadLocationException
BadLocationException
public void testFindMatchWithCaretInMiddle()
throws BadLocationException
BadLocationException
public void testFindMatchWithCaretInMiddleBackwards()
throws BadLocationException
BadLocationException
public void testReplaceCreatesMatch()
throws BadLocationException
BadLocationException
public void testReplaceCreatesMatchBackwards()
throws BadLocationException
BadLocationException
public void testReplaceAllSameWord()
throws BadLocationException
BadLocationException
public void testFindPartialSubstrings()
throws BadLocationException
BadLocationException
public void testSearchesDoNotRepeatWhenChangingDirection()
throws BadLocationException
BadLocationException
public void testFindReplaceInAllOpenFiles()
throws BadLocationException
BadLocationException
public void testFindReplaceInAllOpenFilesWholeWord()
throws BadLocationException
BadLocationException
public void testFindMultiLine()
throws BadLocationException
BadLocationException
public void testWholeWordSearchOnTestString1()
throws BadLocationException
BadLocationException
public void testWholeWordSearchIgnore()
throws BadLocationException
BadLocationException
public void testAnyOccurrenceSearchIgnore()
throws BadLocationException
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 | |||||||||