STS 68 Editor

Test Specification: Editor Sanity Test Specification

Author: Petr Dvorak
Version: 6.5
Introduction: This document serves as a sanity test specification for editor module - it should cover all important features of editor.

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
    • EXPECTED RESULT:
      - Text you typed is correctly displayed in editor, caret's position is synchronized with typed text, typing is fast enough not to cause troubles/slowdown for a developer.
      - Insert/overwrite modes work as expected - when in overwrite mode, old characters are overwritten by the new ones while typing.
  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.
  1. Home/End key
    1. Open some Java file and focus the editor, place caret to some line with indented text
    2. Press Home/End key several times (on Mac use Fn+Left/Right)
    • EXPECTED RESULT:
      - Caret position changes from the position before first letter to the position on column 0 and the other way around as you are pressing a Home key.
      - Caret position changes to the EOL position (after the last character on the line). If you now press Up/Down keys, caret is still in the EOL position on previous/next line.
  1. Scrolling
    1. Press Ctrl-Up/Down several times
    2. Press PageUp/PageDown for a few times
    3. Press Ctrl+Home/End a few times
    • EXPECTED RESULT:
      - The caret stay on the same row and page is scrolled when you press Ctrl+Up/Down
      - Caret moves one page up/down when you press PageUp/PageDown, the editor's content is scrolled too (if possible)
      - Ctrl+Home/End moves caret to the beginning/end of the file, editor's content is scrolled to the right position
      Note: Small files have no scrollbar(s) and it is not possible to scroll them (but caret should still move as described). Big files with more lines or/and more columns have scrollbar(s).
  1. 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 (Alt+Fn+Backspace on Mac)
    4. Press Ctrl+Backspace to delete previous word (Alt+Backspace on Mac)
    • EXPECTED RESULT: Ctrl+Delete deletes the word just behind caret, Ctrl+Backspace deletes word just in front of caret.


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.
  1. Formatted vs. non-formatted paste
    1. Open some java class in IDE
    2. Copy following code to the clipboard: for(int 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: Smart Brackets

Note: Settings in Tools>Options>Editor>General must be enabled - run IDE with a fresh userdir.

  1. Smart pairs
    1. Type private String[[ in body of class
    2. Push Backspace key
    3. Type private String S = new String( in body of class
    4. Push Backspace key
    • EXPECTED RESULT:
      - Closing bracket is inserted when opening bracket is inserted
      - Closing bracket should be deleted when opening bracket is deleted.
  1. Enter after opening curly bracket
    1. Move caret inside a method.
    2. Type if (true) {
    3. Push Enter key
    • EXPECTED RESULT: The closing bracket should be added automatically and indented properly
  1. Brackets highlighting
    1. Type in editor:
       
      

if(true) {

}

    1. Put caret just behind the some of the closing bracket - '}', ')' or ']'
    2. Press Ctrl+'[['
    3. Repeat with other types of brackets
    • {{result|EXPECTED RESULT: The matching bracket is highlighted, shortcut Ctrl-'[[' moves caret to matching bracket. }}




Test suite: Commenting code

  1. Toggle line comment
    1. Open any java file
    2. Try to comment and uncomment several lines by pressing CTRL+'/'
    • EXPECTED RESULT:
      - The selected lines should be commented by //.
      - If only commented lines are selected the action will uncomment them.
  1. Comment/Uncomment line
    1. Try to comment/uncomment lines using comment and uncomment buttons in editor toolbar
    • EXPECTED RESULT: Comment button should add '//' at the beginning of line, the uncomment button will remove it.




Test suite: Start New Line and Split Line

Setup: Type String str = "abcde 123456"; inside a method's body

  1. Smart Enter inside strings
    1. Move caret behind the "abcde"
    2. Press Enter
    • EXPECTED RESULT: If Enter is pressed inside of a string, the string is smartly divided using '+' operator above strings so that there are no errors in code
      Other info:
      - indentation works normally
      - all white characters are preserved
      - caret is moved behind the opening quote
  1. Start new line
    1. Move the caret behind "abcde"
    2. Press Shift+Enter.
  1. Split line
    1. Move caret behind "abcde"
    2. Press Ctrl+Enter




Test suite: Line tools

Purpose: This suite tests tool for manipulating with whole line or several lines.
Setup: Opened any file in editor

  1. Move one line
    1. Put caret in document
    2. Press Alt+Shift+Up / Alt+Shift+Down
    • EXPECTED RESULT: Actual line is moved one line up/down
  1. Move selection
    1. Put caret in document
    2. Select several lines
    3. Press Alt-Shift-Up / Alt-Shift-Down
    • EXPECTED RESULT: Whole selected block (including the lines which are not selected whole but at least partially) is moved
  1. Copy line
    1. Put caret in document
    2. Press Ctrl-Shift-Up / Ctrl-Shift-Down
    • EXPECTED RESULT: The actual line is duplicated below/above current line
  1. Copy block
    1. Put caret in document
    2. Select several lines
    3. Press Ctrl-Shift-Up / Ctrl-Shift-Down
    • EXPECTED RESULT: The whole selection (including whole partly selected lines) is duplicated below/above current selected block


Test suite: Generate Code

  1. Generate constructor
    1. Open java file
    2. Add several fields with various modifiers
    3. In editor press Alt-insert
    4. From popup menu select "Constructor ..."
    5. Select some fields from dialog and confirm
  1. Generate constructor - context
    1. Open java file and add inner class and one top-level class
    2. Put caret in inner class (resp. top-level class)
    3. Generate constructor using "Generate Code | Constructor ..."
    • EXPECTED RESULT: Constructor is generated in right class
  1. Generate setter
    1. Open java class
    2. Add several fields
    3. From context menu select "Generate Code| Setter"
    4. Select some of the listed fields and confirm
    • EXPECTED RESULT: The setters for selected fields are added
  1. Generate getter
    1. Use class from previous test case
    2. Generate getter for some fields using "Generate Code" menu
    • EXPECTED RESULT: Getters are properly added
  1. Generate getter&setter
    1. Open java files with several fields
    2. Generate Getters and Setters for some fields using "Generate Code | Getter and Setter"
    • EXPECTED RESULT: Both getter and setter is added for each selected item
  1. Equals & HashCode methods
    1. Open java class with several fields
    2. Open Generate Code menu (Alt-Insert) and select Equals and hashCode
    3. Select several fields to be included in equals() method
    4. Select several fields to be included in hashCode() method and confirm
    • EXPECTED RESULT: The equals() function and hashCode() function are generated properly.
  1. Delegate Method
    1. Open class with non-primitive members
    2. Call "Generate Code|Delegate Method"
    3. In left panel select field whose method you want to delegate
    4. From right panel select required method
    • EXPECTED RESULT: In step 3 verify that all fields are listed in left panel. After selecting any item the right panel is updated, it show the hierarchical view of super-classes of selected type. When method is selected from right panel and whole dialog is confirmed the method is created in the code. In the body, there is call of selected method.
  1. Override method
    1. Open class extending other class
    2. Open popup by pressing Alt-Insert and select Override Methods
    3. Select several methods and confirm
    • EXPECTED RESULT: Check that in step 3 all super classes are listed. After closing dialog selected methods are created in the code. In the body of each method there is super call.


Test suite: Code Templates

Purpose: Tests the code templates functionality inside NetBeans editor.
Setup: Opened any file in editor and focus should be in editor window.

  1. Code Template Invocation from Abbreviation
    1. Type "fori" in editor
    2. Press TAB
    • {{result|EXPECTED RESULT: Code template for the for() {...</pre> cycle with iteration variable {{i should appear. }}
  1. Code Template Invocation from Code Completion
    1. Type "for" in editor
    2. Press Ctrl-Space to invoke code completion
    • EXPECTED RESULT: Several variants of for cycle should appear (over array and over collection). It is possible to choose one of them and cycle using tab through the editable fields.
  1. Traversing through Code Templates
    1. Invoke the "fori" code template
    2. Cycle through the editable fields by pressing Tab
    3. Cycle back through editable fields by pressing Shift-Tab
    4. Try to edit various fields from code template
    5. Once outside code template try to edit the code inside the for cycle
    • EXPECTED RESULT: It should be possible to cycle through the template in both directions. Editing should work properly and shared variable should be changed in all appropriate places.
  1. Defining Custom Code Templates
    1. Open Options dialog and go to Editor|Code Templates.
    2. Add a code template called forx with code:
for (int ${x index} = 1; ${x}<1000; ${x}++) { System.out.println("${cursor}"); }
    1. Try to invoke the new code template
    • EXPECTED RESULT: Template should be filled in and should work properly.




Test suite: Java Macros

  1. Create Macro
    1. Start macro recording (Ctrl+J S or from editor toolbar)
    2. Write some text in editor, move cursor and try to invoke some formatting actions (Shift Line, Comment etc.)
    3. Finish recording macro (Ctrl+J E or in editor toolbar)
    4. Inside appeared dialog, type new macro's name and choose some keybindings for it.
    5. Open java source file into editor and try using new macro's keybinding.
    • EXPECTED RESULT: Macro should be added to the list and properly works.
  1. Create Macro in Options
    1. Open Tools|Options|Editor|Macros
    2. Click to Add button and create new macro
    3. Set shortcut for the new macro
    • EXPECTED RESULT: The new macro is created and works in the editor. In the list of macros there are some default macros and macros created in previous testcases.
  1. Change macro shortcut
    1. Open Tools|Options|Editor|Macros
    2. Change the shortcut of macro created in previous testcase to Alt-P
    3. Change the shortcut of macro created in previous testcase to Alt-M (or other free shortcut)
    • EXPECTED RESULT: User is warned if trying to set already used shortcut. The shortcut is changed after 3. step and macro can be invoked by new shortcut in editor (the old one is not working any more)




Test suite: Bookmarks

Setup: Opened any file in editor

  1. Toggle bookmark
    1. Put caret at any line in document
    2. Press Ctrl+Shift+M
    3. Use button in editor toolbar (Toggle Bookmark)
    • EXPECTED RESULT: Bookmark is added to current line or is removed if there is one already
  1. Navigating among bookmarks
    1. Place several bookmarks in a file
    2. Press Ctrl+Shift+Comma/Ctrl+Shift+Period
    3. Use buttons in editor toolbar (Next/Previous Bookmark)
    • EXPECTED RESULT: Caret cycle through bookmarked lines
  1. Moving bookmark
    1. Put bookmark in the document
    2. Go to previous line and press enter or delete it
    • EXPECTED RESULT: Bookmarks move so that they remain by the same line




Test suite: Basic Code Folding

  1. Code folding after opening a file
    1. Open File:CodeFolding.java CodeFolding.java file
    • EXPECTED RESULT:
      - All folds are identified and expanded by default, so that user can see the whole source code.
      - Fold marks must be presented by initial comments, import statemets, javadoc comments, inner class and methods
      - Folds must be painted similarly to this:

      File:Code folding java.png image

  1. Adding/Removing code
    1. Create a new Java class
    2. Add this code into class body:
public void myMethodX() { System.out.println(); } public void myMethodY() { }
    1. Add javadoc comment before the method myMethodY:
   /** My javadoc for myMethodY */
    1. Add import statement in adequate place in source file:

import java.lang.String;

    1. Add inner class inside class body:
   class MyInnerClass {
   }
    1. Add method into inner class:
       
      
  class MyInnerClass {
      void myInnerClassMehod() {
      }
   }
    1. Add this code into class body:

@SuppressWarnings(value={"st","nd"}) @Deprecated public void method() {

}

    1. Remove source code you typed in previous steps (select it and press Delete, for example)
    • EXPECTED RESULT:
      - Code folds must be added immediately after a code is added
      - When code is removed, fold must be removed as well.
  1. Add custom code fold
    1. Open some Java file
    2. Add custom opening mark //<editor-fold> to the beginning of a file
    3. Add ending mark //</editor-fold> to the bottom of the same file
    4. Close and re-open the file
    • EXPECTED RESULT: The user defined fold must be correctly recognized when added. When file is re-opened, user defined code fold is in expanded state (source code is visible).
  1. Options - Collapse by Default
    1. Open Tools|Options|Editor|General
      http://wiki.netbeans.org/attach/TS_60_JavaEditor/code_folding_options_dialog.png
    2. Change settings for code folding - pick randomly some options (perform this test case a few times with various settings...)
    3. Leave the option "Use Code Folding" enabled
    4. Confirm the dialog with OK button
    5. Open any java file
    • EXPECTED RESULT: Check the state of all types of code folds in opened file. Code folds are currently updated only for newly opened files (thus you need to close and reopen a file in order to see the effect of changed settings immediately).
  1. Options - Disable/Enable CF
    1. Open options for Code Folding dialog in Tools|Options|Editor|General
    2. Uncheck Use Code Folding checkbox
    • EXPECTED RESULT:
      - All fold marks must be removed from editor when you disable code folding and all previously collapsed portions of code must be expanded.
      - Fold marks must be shown in the way that reflects Code Folding settings under Tools





Test suite: Code Folding Actions

  1. CF Mouse Actions
    1. Code folds are indicated by the [[[+ | [+]] or [[[- | [-]] mark, depending on the state of the fold, as depicted here (colors are just for demonstration):
      http://wiki.netbeans.org/attach/TS_60_JavaEditor/code_folding_mouse_actions.png
    2. To collapse a code fold, click the [[[- | [-]] mark of that fold
    3. To expand a code fold, click the [[[+ | [+]] mark of that fold
    4. Doble click on any collapsed code (indicated with border with "..." or description) in order to to expand the code fold
    • EXPECTED RESULT: Folds are collapsed/expanded as expected.


  1. CF Shortcut Actions
    1. Use shortcut to collapse single code fold (Ctrl+'-')
    2. Use shortcut to expand single code fold (Ctrl+'+')
    3. Use shortcuts for "Collapse All" (Ctrl+Shift+'-') and "Expand All" (Ctrl+Shift+'+') actions
    • EXPECTED RESULT: Keyboard shortcuts work as expected, performing the same actions as corresponding actions invoked from the main menu
  1. Show Collapsed Code in Tooltip
    1. Move the mouse cursor above the collapsed code (border with "..." or description)
    • EXPECTED RESULT: Collapsed code is showed in tooltip, it is colored and indented.




Test suite: Code Folding - Miscellaneous

  1. Deleting when CF is collapsed
    1. Have a collapsed code fold
    2. Move the caret in front of the collapsed fold and hit Delete key
    3. Undo the last change and collapse the code fold again
    4. Move the caret behind the collapsed fold and hit Backspace key
    • EXPECTED RESULT: Code fold must be expanded when you press Delete/Backspace and the first/last character of the code inside the code fold must be removed
  1. Interactions with Surrounding Features - Bookmarks
    1. Place a bookmark in a method
    2. Collapse the method
    3. Reach the bookmark by "Next Bookmark" action
    • EXPECTED RESULT: Fold must be expanded and caret placed on the bookmark
  1. Interactions with Surrounding Features - Find & Replace
    1. Search for a text that is inside some folded code
    2. Try to replace some text that is inside collapsed fold
    • EXPECTED RESULT: If search finds the string inside collapsed fold, that fold is expanded




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.
  1. 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.
  1. Mouse triple click
    1. Quickly triple click on any line in editor.
    • EXPECTED RESULT: Whole line you have clicked on should be selected.




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.
  1. 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.
  1. Interaction with guarded blocks
    1. Create a new form
    2. Try to invoke drag&drop action on guarded blocks
    • EXPECTED RESULT: The code is copied.




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
  1. 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
  1. 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.
  1. 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.
  1. 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: 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.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.zip sample project in following test cases.

  1. 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.
  1. Open a file and close it
    1. Open a File:SampleEditorFiles.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
    5. Try to perform these steps again, but use Files view and main menu File>Open File instead of Projects view
    • EXPECTED RESULT: The selected file should be opened in editor and then closed without any dialogs.
  1. 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
  1. 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: Find/Replace Test

Purpose: This suite tests the find dialog.
Setup: Opened any file in editor and focus should be on editor window.

  1. Find
    1. Open some file and focus the editor
    2. Press Ctrl+F to invoke a search bar
    3. Type some string that is contained in the editor
    4. Press Enter/Shift+Enter to find next/previous occurence
    5. Try to check/uncheck checkboxes modifying search options (highlight results, match case, ...) and repeat search
    • EXPECTED RESULT: Searching works as expected, changes in search options are respected
  1. Find with Replace Dialog
    1. Open some file and focus the editor
    2. Press Ctrl+H to invoke Replace dialog
    3. Type some string that is contained in the editor in the "Find What" field
    4. Press Find button several times
    5. Try to check/uncheck checkboxes modifying search options (highlight results, match case, ...) and repeat search
    • EXPECTED RESULT: Searching works as expected, changes in search options are respected
  1. Replace/Replace All
    1. Open some file and focus the editor
    2. Press Ctrl+H to invoke Replace dialog
    3. Type some string that is contained in the editor in the "Find What" field
    4. Type some other string in the "Replace With" field
    5. Click Replace button a few times
    6. Click Replace All button
    7. Try to check/uncheck checkboxes modifying search options (highlight results, match case, ...) and repeat search
    • EXPECTED RESULT: Replacing works as expected, changes in search options are respected, Replace All replaces all occurences of "Find what" by "Replace with"





Test suite: Closing Modified Files

  1. Close a modified file (Save)
    1. Open OpenFile.java and modify it
    2. Modify flag (a small star) must be displayed next to the name of the file in editor's 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.
  1. 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)
  1. 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




Test suite: Navigation in/between files

  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.
  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.
  1. 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
  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.
  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






Test suite: Print Test

  1. Print From Editor
    1. Switch focus to editor (click to editor window).
    2. Print the opened file. Use main menu File -> Print.
    • EXPECTED RESULT: Printing dialog should be opened. This dialog is system dependent. Confirm the dialog and check that your file is printed properly.
  1. Print Java File Change Option Show Line Numbers
    1. Turn on line numbers in editor
    2. Open any java file in editor.
    3. Invoke print action
    4. Confirm the print dialog.
    • EXPECTED RESULT: The page is printed. All changes in options should be visible on printed page.
  1. Change Property Wrap Lines
    1. Open any file in editor.
    2. Change the "Wrap Lines" property.
    3. Print edited file.
    4. Confirm the print dialog.
    • EXPECTED RESULT: The page is printed. All changes in options should be visible on printed page.




Test suite: Print to HTML

  1. 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 for all time.
      Option "Open generated HTML in browser" is enabled for all time and not selected by default.
  1. Select Location
    1. Open Print to HTML dialog.
    2. Click to "
      [...]
      " button → File chooser dialog
    3. Change path. E.g. /var/tmp/test2.html and confirm file chooser dialog by Open
    4. 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
  1. 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.
  1. 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.
  1. 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: Options dialog

  1. Quick sanity test for options - Editor tab
    1. Invoke Tools>Options
    2. Select Editor tab
    3. Try to set some options in some tabs to non-default values
    4. Confirm Options dialog by clicking OK
    5. Verify changes you made in Options dialog were propagated
    • EXPECTED RESULT: Everything works as expected, your changes are applied.
  1. Quick sanity test for options - Fonts&Colors tab
    1. Invoke Tools>Options
    2. Select Fonts&Color tab
    3. Try to set some non-default schemes and colors
    4. Confirm Options dialog by clicking OK
    5. Verify changes you made in Options dialog were propagated
    • EXPECTED RESULT: Everything works as expected, your changes are applied.
  1. Quick sanity test for options - Keymap tab
    1. Invoke Tools>Options
    2. Select Keymap tab
    3. Try to set some new keybindings, unset some keybindings, etc.
    4. Confirm Options dialog by clicking OK
    5. Verify changes you made in Options dialog were propagated
    • EXPECTED RESULT: Everything works as expected, your changes are applied.


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