TS 71 Editor

Revision as of 13:18, 27 September 2011 by Jiriprox (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)

Plain Editor Test Specification

Author:Jiri Prox
Version: 7.1
Last update:2011/09/19
Introduction:This specification cover features of plain editor. This functionality common to all files and should work in every kind of editor. It cover basis editing, navigation, text selecting and other commont utilities.

Contents

Test suite: Keyboard and Shortcuts

Purpose: Tests key shortcuts, basic manipulations with caret and modifying editor's content

  1. Typing characters in editor
    1. Open some Java file and focus the editor
    2. Try to type some text in the editor
    3. Press Insert to switch from insertion to overwrite mode (on mac first map the Toggle Typing Mode keymap in NetBeans Preferences)
    4. Type some characters when overwrite mode is on
    5. Open some Java file and focus the editor
    6. Press arrow keys , , and
    7. Press arrow keys and in combination with Ctrl key (on Mac OS X use Alt key instead) (Ctrl+→ and Ctrl+←)
    8. Open some Java file and focus the editor, place caret to some line with indented text
    9. Press Home key several times (on Mac OS X use fn+left arrow)
    10. Open some Java file and focus the editor, place caret to some line with text
    11. Press End key (on Mac OS X use fn+right arrow)
    12. Press Ctrl-Up/Down several times
    13. Press PageUp/PageDown for a few times (on Mac OS X use fn+up/down arrow)
    14. Press Ctrl+Home/End a few times (on Mac OS X use cmd+up/down arrow)
    15. If you have changed some settings concerning key bindings, start IDE with a fresh userdir, open the some project and open some files in editor
    16. Try shortcuts for clipboard actions: Ctrl+C (Copy), Ctrl+X (Cut), Ctrl+V (Paste), Delete (Delete).
    17. Try shortcuts for other actions: Ctrl+F (find), Ctrl+G (Go to line), Ctrl+H (Replace) and Ctrl+F4 (Close).
    18. Open some file that has not been opened yet in the editor (from the any Java application)
    19. Try to use Undo/Redo shortcuts Ctrl-Z/Ctrl-Y, it should not be possible to do it because no changes were done previously
    20. Check if menu items for Undo/Redo (Edit|Undo and Edit|Redo) are disabled
    21. Perform any changes__ in the file
    22. Use the Undo action once (Ctrl+Z or a toolbar icon)
    23. Use the Redo action once (Ctrl+Y or a toolbar icon)
    24. Type__ another characters
    25. Use Undo as long as possible (vary between shortcut/toolbar action/main menu action), so that opened file has the same content as previously saved version
    • EXPECTED RESULT: Flag suggesting file is modified (small star next to the name of file in editor's tab) disappeared after the last step and undo properly cleared all typed changes (characters).
  2. Other keybindings
    1. Try some of the key shortcuts defined in Tools|Options|Keymap
    2. Set a new shortcut for some action and then invoke it in editor
    3. Try to change existing shortcut to something different
    • EXPECTED RESULT: The proper action is always called. In step 3, the old shortcut does not work any more.
  3. Remove line
    1. Open some file in the editor
    2. Place caret to some non-empty line
    3. Press Shift+Delete (or Ctrl+E)
    4. Undo the last action
    • EXPECTED RESULT: Whole line is removed when you press Shift+Delete. Line deletion can be undone.
  4. Remove next/prevoius word
    1. Open some file in the editor
    2. Place caret in the middle of some non-empty line
    3. Press Ctrl+Delete to delete next word
    4. Press Ctrl+Backspace to delete previous word
    5. OPTIONAL: Try to use these shortcuts in front of/behind the guarded blocks → it mustn't be possible to delete guarded blocks using these shortcuts
    • EXPECTED RESULT: Ctrl+Delete deletes the word just behind caret, Ctrl+Backspace deletes word just in front of caret.

Test suite: Mouse Test

Purpose: Tests basic mouse functionality.

Setup: Opened some Java file in editor

  1. Mouse click
    1. Change focus to another window different from editor window.
    2. Click to editor window at any position.
    3. Try to click to different places in editor.
    • EXPECTED RESULT: Focus is changed to editor and cursor should be positioned at the clicked place or at end of line you have clicked.
  2. Mouse click after EOF
    1. Click on the first row in a file, caret should move to this place.
    2. Click behind the end of file to an empty area of editor.
    • EXPECTED RESULT: Caret must move to last line in editor. Caret is placed at EOL or at the column you have clicked (if it exists).
  3. Mouse double click
    1. Move mouse over any word in editor window.
    2. Double click quickly.
    3. Double click in front of the first character of the word.
    4. Double click behind last char of the word.
    • EXPECTED RESULT: Words must be selected (highlighted) and cursor positioned at end of selected words. If you double click between words and separator, the the first positioned (word or separator) will be selected.
  4. Mouse triple click
    1. Quickly triple click on any line in editor.
    • EXPECTED RESULT: Whole line you have clicked on should be selected.
  5. Mouse wheel
    1. Try to use the mouse wheel in editor.
    • EXPECTED RESULT: Document in editor should scroll up or down.
  6. Pop-up menu
    1. Open class in editor
    2. Right-click the editor and check the pop-up menu
    3. Left-click somewhere else in the editor to hide the pop-up menu
    4. Invoke pop-up menu using right-click again
    5. Right-click some other place in editor, pop-up menu should appear in that place
    6. Invoke the pop-up menu for the last time
    7. Press Esc key to hide the pop-up menu
    • EXPECTED RESULT: Pop-up menu is shown and hidden as expected.
  7. Support for URLs in editor
    1. Open class in editor.
    2. Enter some code that contains URL, e.g.:
    • EXPECTED RESULT: Entire URL specified in previous step should be underlined. Clicking the URL while holding CTRL (Cmd on Mac) should open this page in preferred browser.

Test suite: Selecting text

Purpose: This suite describes variou ways of selecting text

  1. Select by mouse
    1. Open some file
    2. Put mouse caret somewhere and select part of line
    3. Try expand selection over several lines
    • EXPECTED RESULT: Selection text is highlighted, the selection area expands as expected
  2. Select by keyboard
    1. Open some file
    2. Put cursor in the midle of the file
    3. Press Shift + arrow keys
    4. Try Shift-Home/Shift-End, Shift-PgUp/Shift/End
    5. Try Ctrl-A
    • EXPECTED RESULT: Selected text is highlighted, selection is expanded as expected
  3. Double click
    1. Open some file
    2. Try double click on some word (press-release-press and hold)
    • EXPECTED RESULT: The whole word is selected
  4. Triple click
    1. Open some file
    2. Try triple click on non empty line (press-release-press-release-press and hold)
    • EXPECTED RESULT: Whole line is selected
  5. Rectangular selection
    1. Open some file
    2. Toggle Rectangular Selection (Alt-Shift-R or by button in editor toolbar)
    3. Select text with keyboard (shift+arrow keys) or by mouse
    4. Try expanding existing selection (shift-arrow keys, or Home/End/PgUp/PgDown)
    • EXPECTED RESULT: Rectangular block of text is selected, selection expands as expected
  6. Rectangular copy&paste
    1. Open some file
    2. Select block of text
    3. Press Ctrl-C
    4. Select block of text as target area
    5. Press ctrl-V
    • EXPECTED RESULT: Block of text is copied

Test suite: Creating a New File

Purpose: Tests if it is possible to create a new file in a project and if editor's tabs are correctly focused.

Setup: Open a File:SampleEditorFiles TS 68 JavaEditorFiles.zip sample project.

  1. New file
    1. Invoke File|New File... from the main menu
    2. Select Java category and Java Class file type
    3. Click Next, fill in some class name and click Finish
    4. Create a few more Java classes (repeat these steps a few more times)
    • EXPECTED RESULT: Whenever a new file is created it is opened in editor and focused.

Test suite: Opening Files in Editor

Purpose: This suite checks if is possible open files in Editor. There are more possibilities how to open file - they are described below.

Setup: Close all opened projects. Use files from File:SampleEditorFiles TS 68 JavaEditorFiles.zip sample project in following test cases.

  1. Open external file
    1. Open external file (file that is not a part of any NB project) from main menu action File|Open File...
    • EXPECTED RESULT:
      - File must be opened in editor.
      - There is a lot of limitations, because the file is not part of any project. (no classpath is set)
      - These features must work: Syntax coloring, Code Completion for JDK classes, Code Folding
      - These features won't work: Code Completion for non JDK classes, Compile/run the class
  2. Open file from project that is not opened
    1. Open OpenFileBasic.java with File|Open File... menu. This class can be found in sample project archive under sampleEdirorFiles/src/test/opening directory
    • EXPECTED RESULT:
      - File must be opened in editor and all java-related stuff must work: Code Completion, Code Folding, compilation, running, etc.
      - This action does not open the project where the class belongs to.
  3. Open a file in Projects view and close it
    1. Open a File:SampleEditorFiles TS 68 JavaEditorFiles.zip sample project
    2. Expand test.opening package under Source Packages node in Project view and double click the OpenFile.java source file
    3. Don't modify this file in editor
    4. Invoke popup menu above editor's tab and choose Close All Documents item
    • EXPECTED RESULT: The selected file should be opened in editor and then closed without any dialogs.
  4. Open a file in Files view and close it
    1. Open a File:SampleEditorFiles TS 68 JavaEditorFiles.zip sample project if it is not opened yet
    2. Expand nodes in Files view and double click on the OpenFile.java source file
    3. Don't modify this file in editor
    4. Invoke popup menu above editor's tab and choose Close All Documents item
    • EXPECTED RESULT: The selected file should be opened in editor and then closed without any dialogs.
  5. Open a file from main menu and close it
    1. Select File|Open File from the main menu and find OpenFile.java file used in previous case
    2. Open it
    3. Don't modify the opened file
    4. Invoke popup menu above editor's tab and choose Close All Documents item
    • EXPECTED RESULT: The selected file should be opened in editor and then closed without any dialogs.
  6. Opening a file that is already opened in editor
    1. Expand nodes in Projects view and double click OpenFile.java source file
    2. Double click OpenFileBasic.java source file in Projects view
    3. Double click OpenFile.java source file in Projects view
    4. Invoke popup menu above editor's tab and choose Close All Documents item
    • EXPECTED RESULT:
      - The document that was just opened (double-clicked) must be opened and focused in editor
      - All opened documents must be closed after you perform the last step
  7. Clone opened document ("Fake Editor Split")
    1. Open a java class (for example OpenFile.java from the sample project)
    2. Right click on editor's tab and choose Clone Document
    3. Move the cloned document to the bottom of the screen
    4. Try to open more files (use files under test.dummy package, for example)
    5. Move opened files from the top window to the bottom one and vice versa (move files between fake splits)
    6. Try to close all documents one by one
    • EXPECTED RESULT:
      - Editor should split into two views
      - It should be possible to drag & drop editor tabs from top editor to the bottom one
      - When closing the documents, the split should disappear when all documents are in the top or bottom part

Test suite: Closing Modified Files

Purpose: This suite checks if a dialog shows up when user attempts to close a modified file.

Setup: Close all opened projects except for the sample project and close all opened files.

  1. Close a modified file (Save)
    1. Open OpenFile.java and modify it
    2. Modify flag (bold font) must by used in editor tab
    3. Close file with the X on editor's tab
    4. Confirm your changes by clicking Save
    • EXPECTED RESULT:
      - Modify flag must show up after you modify a file.
      - A dialog asking for confirmation must show up after the fourth step.
      - The file must be saved (check it on hard disk) and editor tab must be closed.
  2. Close a modified file (Discard)
    1. Open OpenFile.java and modify it
    2. Close the sample file using Ctrl+W shortcut
    3. Choose Discard in the dialog to discard your changes
    • EXPECTED RESULT:
      - Editor tab should be closed.
      - All changes are lost (check the file on hard disk)
  3. Close a modified file (Cancel)
    1. Open OpenFile.java and modify it
    2. Close the sample file using main menu action Window|Close Window
    3. Choose Cancel
    • EXPECTED RESULT:
      - Nothing happens - a file remains opened and it is not saved
      - A star next to file name must remain in editor tab
  4. Persistence of opened files
    1. Open several classes from the project
    2. Try to remember which files are opened
    3. Close IDE
    4. Start IDE
    • EXPECTED RESULT:
      - Files that were opened before closing IDE are opened in the editor after IDE restart
      - The projects that were opened are reopened as well, but their nodes are collapsed (because of performance)

Test suite: Read-Only Files

  1. Open read-only file
    1. Open a read-only file in editor
    2. Try to type some characters inside
    • EXPECTED RESULT:
      - It is not possible to make any changes in read-only file
      - Read-only status is indicated by italics font in the editor's tab
  2. Make file read only
    1. Open any read/write file in editor
    2. Make some changes inside
    3. Make file read only (outside IDE)
    4. Save file
    • EXPECTED RESULT: Saving should not be possible, a warning should be displayed, telling the user that the file has become read only.
  3. Read only file from JDK
    1. Open JDK class (you can use "Go To Type" dialog)
    • EXPECTED RESULT: JDK class is read-only and no change can be done in the file

Test suite: Tab Focus

  1. Switching editor tabs
    1. Open two Java source files in editor and focus one of them (move mouse cursor to editor pane and click)
    2. Repeatedly switch to next file and return to previous one by clicking on editor tabs
    3. Use next tab action (Ctrl+PgUp/PgDown) to switch to next file
    4. Use Ctrl+Tab to switch to next file
    • EXPECTED RESULT: Tabs should be switched intuitively and focus should remain in editor window.
  2. Closing editor tabs
    1. Open at least two java files in the Editor Window
    2. Close one of them (using Ctrl+F4)
    • EXPECTED RESULT: Focus should be moved to another opened Editor tab.

Test suite: Performance After Startup

Purpose: Test speed and issues caused by IDE initialization.

Setup: Start these tests immediately after main window is opened

  1. Open File After Startup
    1. Start the IDE
    2. Open file (just a file, not a project) OpenFile.java from the sample project in IDE (use "File|Open File" from the main menu)
    3. Close the file
    • EXPECTED RESULT: Editor should be opened within a reasonable time. It should be less than 3 sec. on usual workstation.
  2. Open Project
    1. Start IDE with a fresh userdir
    2. Open sample project
    3. Open file OpenFile.java
    4. Wait until file is opened, wait until scanning is finished (you can see the progress in right-bottom corner of IDE)
    • EXPECTED RESULT:
      - The selected project is opened in reasonable time.
      - Scanning is started immediately after opening the project and should be performed in reasonable time.
      - If IDE was installed from zip the JDK classes are scanned as well.
      - The file can be edited when opened, syntax coloring for all elements is shown in reasonable time.
  3. Open Editing Options After Startup
    1. Start the IDE
    2. Try to open Java editor options from Tools|Options|Editor|Formatting immediately after startup
    3. Switch tabs in Editor's options
    • EXPECTED RESULT: Options should be opened in reasonable time. Tabs should be switched in acceptable time.

Test suite: Performance when working with long files

Purpose: Tests speed of editing long files in editor

Setup: Prepare bigger file (PerformanceBigJava.java from sample project).

  1. Open Long Java File
    1. Open big java file in editor (e.g. from main menu : File|Open File)
    2. Wait for the file to be opened
    3. Close the file
    4. Open it again and keep it opened
    • EXPECTED RESULT: Time of opening/closing file should be acceptable
  2. Working With Long Java File - No comments
    1. Use the same file from previous case, open it if it is not opened
    2. Try to scroll the file with scrollbars sliders
    3. Add Javadoc comment before the method "newMethod" - type e.g. /** My first javadoc comment */
    4. Test the speed of Enter key inside JavaDoc - press Enter when caret is just after "/**" that you typed in the previous step
    • EXPECTED RESULT: All actions should be done in acceptable time.
  3. Working With Long Java File - No Errors
    1. Switch to the big java file (should be opened in editor from previous case)
    2. Type some new java elements to class, e.g. type Integer myInt = new Integer( and wait for completion
    3. Go through the code completion list
    4. Type 10); and press enter
    5. Go to the end of document (Ctrl+End)
    6. Go to the beginning of document (Ctrl+Home)
    7. Scroll the editor window - hold Ctrl+Up/Down longer then 4 seconds
    • EXPECTED RESULT: All actions should be completed in a very short time
  4. Working With Long Java File - Errors
    1. Switch to the java file (should be opened in editor from previous case)
    2. Do some changes that corrupts the file - corrupt some fields and methods, for example
    3. Go to the end of document (Ctrl+End)
    4. Go to the beginning of document (Ctrl+Home)
    5. Scroll to the editor window - press Ctrl+Up/Down longer then 4 seconds
    6. Type new field to body of a class - type "Integer myInt2 = new Integer(10);"
    • EXPECTED RESULT: All actions should be completed in a short time, errors should show up in editor almost instantly.
  5. Multiple Cloned Windows
    1. Switch to the big java file (should be opened in editor from previous case)
    2. Show popup menu over editor's tab and choose Clone Document item
    3. Undock the cloned document and dock it to the bottom of IDE, so that you create a "fake split view"
    4. Type some characters into original editor window
    5. Save file (Ctrl+S)
    6. Type some characters into cloned editor window
    7. Save file (Ctrl+S)
    • EXPECTED RESULT:
      - All cloned windows should have the same content as the original editor window.
      - Characters should appear in both original and cloned windows when typing
      - A flag indicating modified file is present in both tabs.

Test suite: Internationalization

Purpose: Checks editor's support for national characters.

Setup: You must have national support in OS set up (fonts, keyboard, etc.) and some file opened in editor. You can find information about your locale in Help|About

  1. National keyboards
    1. Create a new Java file (File|New File...)
    2. Switch to a keyboard layout that is different from English (e.g. to Czech or German)
    3. Type some non-English characters in the editor
    • EXPECTED RESULT: All characters in chosen language should be displayed properly.
  2. I18N undo action
    1. Select part of the text with national characters and invoke Cut action (Ctrl+X).
    2. Try to invoke the Undo action (Ctrl+Z).
    • EXPECTED RESULT: All changes should be correctly undone.
  3. Clipboard with localized characters
    1. Copy any localized string from other application.
    2. Paste this string into IDE's editor.
    3. Copy the localized string in the IDE.
    4. Paste it back to the other application.
    • EXPECTED RESULT: Text should be properly copied and displayed.

Test suite: Line Endings

Setup: Use a File:SampleEditorFiles TS 68 JavaEditorFiles.zip sample project

  1. Line endings - new files
    1. Create new Java file
    • EXPECTED RESULT: Check line endings of the new file in any binary editor (for example "mc" in Linux, press F3 to view the file and then F4 to switch to HEX mode).
  2. Line endings - existing Java files
    1. Open a file with Unix EOL's (NewCanvasActionUnix.java under test.eols package)
    2. Type some new lines
    3. Open a file with windows EOL's (NewCanvasActionWin.java under test.eols package)
    4. Type some new lines
    5. Open a file with Mac EOL's (NewCanvasActionMac.java under test.eols package)
    6. Type some new lines
    7. Save files
    • EXPECTED RESULT: Check line endings in any binary editor for all files. The type of line endings must be preserved
  3. Manipulating file with not native EOL
    1. Open java file with non native EOL (example: If you use Windows, then open file with Unix line endings)
    2. Try to manipulate this file - move from package to package, copy, use hints and code templates to generate code
    • EXPECTED RESULT: Line endings are not changed, the code is not corrupted by any action.

Test suite: Using Clipboard

Purpose: To test Copy/Cut/Paste actions and interoperability with external/native editors.

Setup: You will need two java files opened in editor.

  1. Copy/Cut data inside a single Java file
    1. Switch to a java file in editor.
    2. Select a portion of text and copy it to the clipboard (Edit|Copy or Ctrl+C)
    3. Move blinking caret to another place of editor and paste data from clipboard to the source file (Edit|Paste or Ctrl+V)
    4. Select another portion of text and cut it to the clipboard (Edit|Cut or Ctrl+X)
    5. Move blinking caret to another place of editor and paste data from clipboard to the source file (Edit|Paste or Ctrl+V)
    • EXPECTED RESULT: Copied text is duplicated in editor, cut text is removed, texts are placed in caret position. Caret should be behind pasted data.
  2. Copy/Cut data between two edited files
    1. Switch to the first file.
    2. Select any portion of text and copy (or cut) it to the clipboard
    3. Switch to the second file.
    4. Paste the data from clipboard to the second file
    • EXPECTED RESULT: Selected text is copied (cut) from the first file to the second file.
  3. Copy/Cut data To cloned view
    1. Switch to a java file.
    2. Select any portion of text and copy (or cut) it to the clipboard
    3. Clone view (display popup menu over editor's tab and invoke "Clone Document").
    4. There should be auto focus on the cloned view, if no then get focus to the cloned view (click to cloned view).
    5. Paste data from clipboard to source file in cloned view
    • EXPECTED RESULT: Text is correctly pasted in caret's position and both editor windows (cloned and original) contain the same data.
  4. Copy/Cut data from OS to Netbeans
    1. Open any file in native editor which uses system clipboard
    2. Select some text and copy (or cut) it to the system clipboard (depends on native editor)
    3. Focus some Netbeans Java editor tab
    4. Paste text from clipboard to the edited file
    • EXPECTED RESULT: Selected text is copied from native editor and correctly pasted to Netbeans editor.
  5. Copy/Cut data from Netbeans to OS
    1. Switch to a file in IDE's editor
    2. Select some text in and copy (or cut) it to clipboard
    3. Open any file in native editor which use system clipboard
    4. Paste text from clipboard to a text file in native editor (depends on native editor)
    • EXPECTED RESULT: Selected text is copied from Netbeans to native editor
  6. Formatted vs. non-formatted paste
    1. Open some java class in IDE
    2. Copy following code to the clipboard: for(i= 0; i<10;i++ ) {System.out.println("i="+i);}
    3. Invoke Paste action using Ctrl+V inside some method
    4. Press Ctrl+Z to undo previous Paste action
    5. Invoke "Paste Formatted" using Ctrl+Shift+V
    • EXPECTED RESULT:
      - When you press Ctrl+V, code is pasted in the Editor "as it is", without any shifting or reformatting.
      - Code is pasted re-formatted and properly indented when you press Ctrl+Shift+V.

Test suite: Drag & Drop

Purpose: Tests the drag & drop functionality inside NetBeans editor.

Setup: Opened any file in editor and focus should be in editor window.

  1. Basic test
    1. Select a block of code by mouse
    2. Drag the code and drop it to a different position in source code
    • EXPECTED RESULT: The code should be moved to the new position.
  2. Undo test
    1. Drag & Drop a piece of code
    2. Press Ctrl+Z
    • EXPECTED RESULT: The code should be moved and undo should return the code into it's original position.
  3. Interaction with guarded blocks
    1. Create a new form
    2. Try to invoke drag&drop action on guarded blocks
    • EXPECTED RESULT: Only the code outside guarded blocks should be moved. The code inside guarded blocks is copied.
  4. Cursor change
    1. Try to drag & drop the text inside editor and outside editor
    • EXPECTED RESULT: The cursor should change according to whether drag & drop action is available (inside editor) or not.

Test suite: Editor's Toolbar and Line numbers

  1. Show and hide line numbers (using gutter)
    1. Open a file in editor.
    2. Check if gutter is in its position (gutter = gray left edge of editor window).
    3. Invoke popup menu above gutter
    4. Try to check/uncheck Show Line Numbers
    • EXPECTED RESULT:
      - Gutter must be displayed on the left side of the Editor Window
      - Line numbers should be shown or hidden according to state of checkbox in gutter's context menu
  2. Show and hide editor's toolbar (using gutter)
    1. Open a file in editor
    2. Check if gutter is in its position (gutter = gray left edge of editor window).
    3. Invoke popup menu above gutter
    4. Try to check/uncheck Show Toolbar
    • EXPECTED RESULT:
      - Gutter must be displayed on the left side of the Editor Window
      - Editor's toolbar should be shown or hidden according to state of checkbox in gutter's context menu
  3. Show and hide line numbers (using main menu)
    1. Open Java file in editor
    2. Try to show/hide line numbers using main menu action View|Show Line Numbers
    • EXPECTED RESULT: Line numbers should be displayed and hidden according to state of checkbox state.
  4. Show and hide editor's toolbar (using main menu)
    1. Open Java file in editor
    2. Try to show/hide editor's toolbar using main menu action View|Show Editor Toolbar
    • EXPECTED RESULT: Toolbar should be displayed and hidden according to state of checkbox state.
  5. Editor's toolbar actions
    1. Check if all action icons in editor's toolbar have tooltip and if they are enabled
    2. Try to invoke actions from toolbar
    • EXPECTED RESULT: The tooltip is available for all icons in toolbar. Each icon invokes expected action.

Test suite: Find&Replace Test

Purpose: This suite tests the find dialog.

Setup: Opened any file in editor and focus should be on editor window.

  1. Replace Dialog Open Close
    1. Open find dialog from main menu (Alt+E|E or with mouse).
    2. Press the Esc key.
    3. Open find dialog (Ctrl+H).
    4. Click on the Help button and wait till help is opened.
    5. Close help (use small cross on window).
    6. Click on the Close button.
    • EXPECTED RESULT: Dialog must be opened and then closed. The Help window must by closed, too.
  2. Find Selection Repeated
    1. Select a piece of text, and invoke replace dialog (Ctrl+H).
    2. Immediately press "Find" button.
    3. Select another piece of text, invoke replace dialog (Ctrl+H).
    4. Immediately press "Find" button.
    • EXPECTED RESULT: When replace dialog is opened, the "Find What" input line should contain selected piece of code. After pressing "Find" button, appropriate text should be found.
  3. Replace Dialog Combo Box
    1. Perform three searches (for three different words/texts).
    2. Invoke the replace dialog (Ctrl+H).
    3. The line "Find What:" is a combo box. Try to use it.
    4. When you select a word from combo box, perform "Find" on it.
    • EXPECTED RESULT: The combo box should contain all texts you were searching for. These texts should be fully functional, including searching for these texts.
  4. No Find - Unselected All Options
    1. Open replace dialog.
    2. Unselect all checkboxes in the dialog.
    3. Type some word which is not contained in editor (e.g. foo).
    4. Press the Find button.
    • EXPECTED RESULT: Status line of editor should have red background and should contain text 'foo' not found.
  5. Find - Option Match Case
    1. Open replace dialog (in the same file as previous case).
    2. Select only Match Case.
    3. Type a word which editor contains, but change case in the searched word e.g. use Private (we are searching for "private" modifier in source file) -> message "Private" not found in status bar.
    4. Open the dialog anyway and type exactly the word private.
    5. Press the Find button.
    • EXPECTED RESULT: Word "private" should be found.
  6. Find - Option Match Whole Words Only
    1. Open replace dialog.
    2. Unselect all checkboxes.
    3. Select Match Whole Words Only.
    4. Type word which editor contains (this word should be typed 1. from beginning of a row and separated witch space or 2. separated witch space character on both sides or 3. space in front of word and ended with end of row).
    5. Press the Find button.
    • EXPECTED RESULT: First occurrence of the word should be found so that it fulfills all three conditions from action 4.
  7. Find - Option Highlight Search
    1. Open replace dialog.
    2. Unselect all checkboxes.
    3. Select only Highlight Search.
    4. Type any word which exists in editor multiple times.
    5. Press the Find button.
    • EXPECTED RESULT: All occurrences of searched word should be highlighted.
  8. Find - Option Incremental Search
    1. Open replace dialog.
    2. Unselect all checkboxes.
    3. Select only Incremental Search.
    4. Type any word which exists in editor - durring typing editor tries to find strings (it is jumping to strings) and highlights them.
    5. Press the Find button.
    • EXPECTED RESULT: Editor should jump to string which you wrote to the dialog and such strings should be highlighted.
  9. Find - Option Backward Search
    1. Open replace dialog.
    2. Unselect all checkboxes.
    3. Select only Backward Search.
    4. Type any word which contained editor, the word should be positioned in front of the cursor.
    5. Press the Find button.
    • EXPECTED RESULT: The first occurrence in backward direction should be found.
  10. Find - Option Wrap Search
    1. Open replace dialog.
    2. Unselect all checkboxes.
    3. Select Wrap Search only.
    4. Type any word which exists in editor, all matched words should be in front of the cursor.
    5. Press the Find button.
    • EXPECTED RESULT: First occurrence of the searched work should be found in editor. The following messages should be displayed: "End of document reached, continuing search from beginning.".
  11. Find - Next/Previous
    1. Open the replace dialog.
    2. Unselect all checkboxes.
    3. Type a word (the word should occur in the editor 2-3 times).
    4. Press the Find button.
    5. Close find dialog. Try pressing "Find Next" (F3) and "Find Previous" (Shift+F3).
    • EXPECTED RESULT: The searched word should be found forwards and backwards from current position.
  12. Find - Selection Without Dialog
    1. Select a word in editor (the word should occur in the editor 2-3 times).
    2. Use "Find Selection" (only shortcut Ctrl-F3, no menu).
      Caution: this shortcuts are mapped to system in Linux/KDE. You must change the shortcut in IDE or in OS if this is your case.
    3. Find Next (F3)
    4. Try search for a different word (Ctrl-F3 on different word).
    • EXPECTED RESULT: Each selected word must be searched.(without dialog)
  13. Find - Search Selected Text
    1. Select several lines of text in which you will perform search.
    2. Open replace dialog, The "search in selection" checkbox should be automatically checked. Search for some word which can be found in the selection.
    3. Repeat the search to find all occurrences of the word in selected text.
    • EXPECTED RESULT: All occurrences of the word are found inside of the selected text. All words which are found are highlighted and status bar contains a message about successful search. If the word exists outside selection too, it is not found.
  14. Find - Search Selected Text Negative
    1. Select several lines of text in which you will perform search.
    2. Open replace dialog, check "find in selection" and try to search for several words which are not inside of the selection but exist somewhere in the source code.
    • EXPECTED RESULT: None of the words outside selection should be found.
  15. Find - Regular Expressions - Simple
    1. Open file testRegexpSimple.java from samples.
    2. Open replace dialog, select regexp search and search for expression:
      [[AA | aA]][[HH | hH]][[OO | oO]][[JJ | jJ]][09]{1,3} 
    • EXPECTED RESULT: There are lines in the file with "ok" on the right side. Strings on these lines should be found. Lines with "not ok" on right side should be skipped.
  16. Find - Regular Expressions - Complex
    1. Open file testRegexpComplex.java from samples.
    2. Open replace dialog, select regexp search and search for expression: a?B*c{2} dDe{1,}\.F{1,2}\s ^g
    • EXPECTED RESULT: There are lines in the file with "ok" on the right side. Strings on these lines should be found. Lines with "not ok" on right side should be skipped.

Test suite: Bookmarks

Purpose:

Setup: Opened any file in editor

  1. Adding bookmarks
    1. Put caret at any line in document
    2. Press Ctrl-Shift-M
    3. use contex menu in gutter -> Bookmarks | Toggle Bookmark
    4. use button in editor toolbar (tooltip: Toggle Bookmark)
    • EXPECTED RESULT: Bookmark is added to current line or is removed if there is one already
  2. Navigating among bookmarks
    1. Place several bookmarks in a file
    2. Press Ctrl-Shift-Comma/Ctrl-Shift-Period
    3. Use gutter context menu - Bookmarks | Next Bookmark / Bookmarks | Previous Bookmark
    4. Use buttons in editor toolbar
    • EXPECTED RESULT: Caret cycle through bookmarked lines
  3. Bookmark persistence
    1. Place several bookmarks in a file
    2. Switch files
    3. Close/Reopen file
    4. Restart IDE
    • EXPECTED RESULT: Bookmark should stay intact
  4. Moving bookmark
    1. Put bookmark in the document
    2. Go to previous line and press enter or delete it
    • EXPECTED RESULT: Bookmark moved to mark the same line of code (e.g. is moved to next line if a new line is added before if and vice versa)
  5. Remove all bookmarks
    1. Put several bookmarks in the document
    2. Go to options dialog - Keymap
    3. Select action Other | Clear Document Bookmarks and assign free shortcut to it
    4. In the editor call assigned shortcut
    • EXPECTED RESULT: All bookmarks in current document are removed

Test suite: Go To Line

  1. Go To Line
    1. Open some Java source file in editor and focus it (move mouse cursor to editor pane and click).
    2. Repeatedly invoke Go to line action (Ctrl+G), to invoked dialog write some line number and press Goto button.
    • EXPECTED RESULT: Editor window should have focus after each Go to line action invocation, negative numbers are not allowed as well as zero, you cannot type non-numerical characters to the line field.

Test suite: Jump List

  1. Basic Jump List functionality
    1. Open several java files and perform several searches.
    2. Try to jump through the jump list by pressing ALT+Left for previous entry and ALT+Right for next entry
    3. Try to jump through the jump list by selecting specific file from a popup window available in the right part of Go forward/Go backward buttons (editor toolbar)
    • EXPECTED RESULT: Editor should navigate through all positions in successful searches. Watch out for performance and for side effects.
  2. Last edited functionality
    1. Open several java files and perform several changes.
    2. Press Last Edit button several times
    • EXPECTED RESULT: Editor should navigate through all positions where code was edited

Test suite: Print to HTML

Purpose:

Setup:

  1. Menu Print to HTML
    1. Check main menu File|Print to HTML.
    • EXPECTED RESULT: Name of menu is "Print to HTML", mnemonic is on 'H'. Enabled only when a file is selected in Explorer window. Verify this.
  2. Default values
    1. Open a java file.
    2. Invoke "Print to HTML" dialog.
    • EXPECTED RESULT: Default file location is in your home directory. ( e.g. /home/pf120623/Test.java )
      Colors used are the same as those in Editor. It is not possible to have different colors for html printing and editor.
      Option "Print only selected text" is enabled only if piece of code is selected in the editor. In this case, it is selected by default.
      Option "Show line numbers" is enabled is line numbers are visible in editor.
      Option "Open generated HTML in browser" is enabled for all time and not selected by default.
  3. Select Location
    1. Open Print to HTML dialog.
    2. Type a path of file to text field. E.g. /tmp/test.html
    3. Click to [...] button -> File chooser dialog
    4. Click Cancel in file chooser dialog
    5. Click to [...] button anyway -> File chooser dialog
    6. Change path. E.g. /var/tmp/test2.html and confirm file chooser dialog by Open.
    7. Confirm Print to HTML dialog by Ok button.
    • EXPECTED RESULT: The path shouldn't be changed after step 4. (must be /tmp/test.html)
      The path should be changed in step 6. There should be created new file /var/tmp/test2.html
  4. Select Only selected text
    1. Select some rows of code in the Editor.
    2. Open Print to HTML dialog and confirm it.
    • EXPECTED RESULT: The checkbox "Print only selected text" should be enabled and selected. There should be a html file created, containing only selected text. Check this in HTML browser.
  5. Select Open generated HTML in browser
    1. Open Print to HTML dialog.
    2. Select option "Open generated HTML in browser"
    3. Confirm the dialog with Ok button
    • EXPECTED RESULT: File should be generated and opened in default HTML browser.
  6. Select show line numbers
    1. Enable Show line numbers in the Editor from Options* dialog or from popup menu over the gutter.
    2. Open "Print to HTML" dialog and confirm it by Ok button.
    • EXPECTED RESULT: Check generated HTML file in web browser. Line numbers must be present.

Test suite: Word Matching

  1. Word matching
    1. Type some words inside an opened file
    2. Use a shortcut for word matching (Ctrl+K, Ctrl+Shift+K)
    3. Type some prefix and press mentioned shortcut
    4. Repeat this for various file types
    • EXPECTED RESULT:
      - It should be possible to use word matching between files of different type (on any place inside file)
      - Word matching provides only words starting with proper prefix

Test suite: Select Document Node in Project,Files,Favorites

  1. Menu "Navigate"
    1. Verify functionality for every Navigate|Select in ... main menu item:
    2. Have a document focused in the IDE
    3. Use Select in Projects command or use shortcut Ctrl+Shift+1
      → the file is selected in Projects
    4. Use Select in Files command or use shortcut Ctrl+Shift+2
      → the file is selected in Files
    5. Use Select in Favorites command or use shortcut Ctrl+Shift+3
      → the file is selected in Favorites
    • EXPECTED RESULT: Node corresponding to opened editor is selected in Project/Files/Favorites view
  2. Same name test - Projects view
    1. Close all projects and create a new project
    2. Create files Main.java and Main.html in one package
    3. Open Main.java and call Select in Project
    4. Open Main.html and call Select in Project
    5. Try to repeat previous steps
    • EXPECTED RESULT: The right node is always selected in Projects view
  3. Same name test - Files view
    1. Close all projects and create a new project
    2. Create files Main.java and Main.html in one package
    3. Open Main.java and call Select in Files
    4. Open Main.html and call Select in Files
    5. Try to repeat previous steps
    • EXPECTED RESULT: The right node is always selected in Files view
  4. Same name test - Favorites view
    1. Close all projects and create a new project
    2. Create files Main.java and Main.html in one package
    3. Open Main.java and call Select in Favorites
    4. Open Main.html and call Select in Favorites
    5. Try to repeat previous steps
    • EXPECTED RESULT: The right node is always selected in Favorites view

Test suite: Change case, insert current date

  1. Selection to upper-case
    1. Open a java file in editor.
    2. Select some text with both lower and upper case
    3. Press Ctrl+U U (Ctrl+U followed by U)
    • EXPECTED RESULT:
      - Selection should be converted to upper-case.
  2. Selection to lower-case
    1. Open a java file in editor.
    2. Select some text with both lower and upper case
    3. Press Ctrl+U L (Ctrl+U followed by L)
    • EXPECTED RESULT:
      - Selection should be converted to lower-case.
  3. Switch case in selection
    1. Open a java file in editor.
    2. Select some text with both lower and upper case
    3. Press Ctrl+U S (Ctrl+U followed by S)
    • EXPECTED RESULT:
      - Selection should be converted so that letters that were originally in capitals are now in lower case and vice versa.
  4. Insert current date and time
    1. Open a java file in editor
    2. Open Tools>Options>Keymap
    3. Select node Other>Insert Current Date and Time
    4. Assign the action a shortcut (Ctrl+Alt+M should be unused)
    5. Confirm Options dialog and try to invoke the action Insert Current Date and Time in editor
    • EXPECTED RESULT: Current date and time should be inserted in the editor.

Test suite: Show white spaces

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo