| <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> | |
| <html> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> | |
| <title>Test Scenario: Text Editor</title> | |
| </head> | |
| <body> | |
| <h3> | |
| Text Editor</h3> | |
| Purpose: To test the Text Editor in Eclipse. We will open a text | |
| file, adding some text, play with the edit actions, verify the save and | |
| save as, and then test persistance between sessions. | |
| <p>Setup: | |
| <ol> | |
| <li> | |
| Install Eclipse Platform.</li> | |
| <li> | |
| Create a project.</li> | |
| </ol> | |
| Method: | |
| <ol> | |
| <li> | |
| Start the workbench.</li> | |
| <li> | |
| Invoke File > New > File. Create a new text file with some name like | |
| test1.txt. Verify that a new editor opens on the file.</li> | |
| <li> | |
| Copy and paste the following text into the editor ..</li> | |
| </ol> | |
| <blockquote>Beware the beast man, for he is the devil's pawn. Alone among | |
| God's primates, | |
| <br>he kills for sport, or lust or greed. Yes, he will murder his brother | |
| to possess his | |
| <br>brother's land. Let him not breed in great numbers, for he will make | |
| a desert of | |
| <br>his home and yours. Shun him. Drive him back into his jungle lair: | |
| For he is the | |
| <br>harbinger of death. | |
| <p>(Planet of the Apes)</blockquote> | |
| <ol> | |
| <li> | |
| After paste has been performed the editor state should be dirty. | |
| Verify that File > Save is enabled and that Save is enabled in the context | |
| menu. Invoke Save and verify that save is disabled.</li> | |
| <li> | |
| The Save As menu action is always enabled. Invoke this action to | |
| create a new file, say test2.txt, and verify that the name of the new file | |
| name is reflected in the editor tab.</li> | |
| <li> | |
| Modify the contents of test2.txt and save. Then open test1.txt and | |
| verify that it still contains the original text.</li> | |
| <li> | |
| In text1.txt select the first 3 lines and invoke Edit Copy. Activate | |
| text2.txt, put the cursor at the end of the file, and invoke Edit Paste. | |
| Verify that the first 3 lines of text1.txt are copied to text2.txt.</li> | |
| <li> | |
| Invoke Undo and Redo a few times in text2.txt to undo and redo the paste.</li> | |
| <li> | |
| Select a few lines of text and invoke Shift Right and Shift Left a few | |
| times.</li> | |
| <li> | |
| Now close text2.txt. The file has been modified, so a Save dialog | |
| should appear. Press No to avoid saving.</li> | |
| <li> | |
| Now we need to test Find / Replace. Select the text1.txt editor. | |
| This file contains many instances of he and his. Invoke Find / Replace | |
| and replace all instances of he by "she". You may find that various | |
| words like "the" are modified to "tshe". Close the find dialog and | |
| invoke Revert in the context menu. Verify that the file contents | |
| are now equal to the original text. Then try Find / Replace again | |
| with "whole word" selected and verify the results.</li> | |
| <li> | |
| Open up text2.txt. Now there should be one open editor with changs | |
| and one without.</li> | |
| <li> | |
| Invoke File > Close All. At this point a "Save Resources" dialog | |
| should appear where you can save the modified files. Check all modifications | |
| and then press "Yes". Verify that all editors are closed. Then | |
| open up any editor which was saved and verify changes.</li> | |
| </ol> | |
| </body> | |
| </html> |