cornercorner
FeaturesPluginsDocs & SupportCommunityPartners

Editor Test Specification

Author: Roman Strobl & Max Sauer
Version: 5.0
Last update: 12.09.2005
Introduction: This document serves as a test specification for editor module.
Comment:
I have created an archive with all samples used in this document. You can easily unzip it and use it. Please note that some files in this archive cannot be compiled, that is ok, because some tests require special java files.

Links to samples in tables in this document are links to html files, the source files are in the editor_tests.tar.gz.

The sign "->" is used frequently in this document. This means that something is expected, e.g. "-> dialog with title Question" has the same meaning as "Wait for the dialog with the title Question". If this dialog doesn't appeared fill an Issue in Issuezilla.

The testspec uses old Options dialog now. You can go to the old Options dialog by choosing Classic View in new Options dialog. Once the new Options dialog is stabilized I will rewrite the testspec to use it.

If you find some differences between results described in this document and your results then please fill an issue or send me an email.

Table of Contents

Test suite 1: Startup Test

Purpose: Test speed and issues appeared by inicialization.
Setup: IDE should be started with new* userdir (first start) for each test from this suite. Start these tests immediately after main window is opened.

#Test caseDescription
1Open Editor After Startup
  1. Open file OpenFile.java in IDE. Use main menu File|Open (shortcut Ctrl-o).
RESULT:Editor should be opened within a reasonable time. It should be less than 2.5 sec. on usual workstation.
2Open Editing Options After Startup
  1. Start the IDE.
  2. Immediatelly after startup try to open Java editor settings options from Tools|Options|Editing|Editor Settings.
Teardown: Close the IDE.
RESULT:Options should be opened with reasonable speed.
*How to start IDE with a new userdir? Go to netbeans\bin directory and run the IDE with switch -userdir. Increase the number in name of user_directory.
cd ...\netbeans\bin
.\runide.sh -userdir userdir_directory1
(Change all backslash to slash on unix platforms).



Teardown: Close IDE.

Test suite 2: Opening Editor

Purpose: This suite checks if is possible open files in Editor. There are more possibilities how to open file. All possibilities are described below.
Setup: Started IDE with fresh userdir. Use files from editor_tests.tar.gz archive.

#Test caseDescription
1Open External File
Setup:Use the file "OpenFile.java" from samples.
  1. Open external file from main menu action File|Open File....
RESULT:File must be opened in editor.
There are 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 (if JDK sources are available - since promo_e)
- Code Folding (since promo_e)
These features won't work:
- Code Completion (when JDK sources are missing)
- Compile/run the class
2Open File from Project (Not Opened)
Setup:Project is not opened.
  1. Open OpenFileInProject.java with File|Open File... menu. This class can be found in editor_tests.tar.gz archive under project_test/src/ directory.
Teardown: Close the file.
RESULT:File must be open in editor and all java-related stuff must work. (Code Completion, Code Folding, compilation, runing, etc.)
This action does not open the project where the class belongs to.
3File Open and Close Actions from Explorer
Setup:Open project from editor_tests.tar.gz archive. Use menu File|Open project... and choose editor_tests.
  1. Expand default package in Project view and double click on the OpenFileInProject.java source file.
  2. Don't modify this file in editor.
  3. Show popup menu over editor and choose the Close All Documents item.
RESULT:The selected file should be opened in editor window and then closed without any dialogs.
4File Open and Close Actions from Main Menu
  1. Select main menu File|Open File and find the OpenFileInProject.java file used in previous case.
  2. Open it.
  3. Don't modify the opened file.
  4. Show popup menu over Editor and then choose menu item Close All Documents.
RESULT:The selected file should be opened in Editor window and then closed without any dialogs.
5File Open and Close Actions for a Modified File (Save)
  1. Open the same file as in previous cases.
  2. Modify it in source editor window. Add some characters into the comment, because the file will be used in next testcases.
  3. -> Modify flag - Small star must be displayed next to name of file in tab of editor.
  4. Close file with the X on tab of editor -> appears dialog with title "Question".
  5. Choose Save.
RESULT:Modify flag must appeared in the second step. File should be saved and editor closed. Check the file on harddisk.
6File Open and Close Actions for a Modified File (Discard)
  1. Open the sample file.
  2. Modify it in source editor window. Type some characters in comment, because the file will be used in next tests and it should be compilable.
  3. Close the sample file.
  4. Choose Discard.
RESULT:Editor should be closed. All changes will be lost. Check the file on harddisk.
7File Open and Close Actions for a Modified File (Cancel)
  1. Open the sample file.
  2. Modify it in source editor window.
  3. Close the sample file.
  4. Choose Cancel.
Teardown: Close file and discard changes.
RESULT:Nothing happens. File remains opened and it is not saved. A star next to file name must be present in editor tab.
8File Open on Selected Position - Constructor
  1. Expand "OpenFileInProject" file node to see all constructors.
  2. Double click on the "OpenFileInExplorer()" constructor.
Teardown: Close Editor.
RESULT:File must be opened and caret (cursor) must be moved to the beginning of selected constructor (in front of the public keyword). The selected constructor should be cca. in the middle of editor window (only in a large file where it is possible to scroll).
9File Open on Selected Position - Method
  1. Expand Methods node to see all methods.
  2. Double click on the main method.
Teardown: Close Editor.
RESULT:File must be opened and caret must be moved to the beginning of selected method. Selected method should be cca. in the middle of editor window (if it is possible).
10File Open on Selected Position - Fields
  1. Expand the Fields node to see all fields.
  2. Double click on the field title.
Teardown: Close Editor.
RESULT:File must be opened and caret must be moved to the beginning of selected field. The selected field should be cca in the middle of editor window (if it is possible).

Test suite 3: Internationalization

Purpose: Checks editor support for national characters.
Setup: National support in OS set up (fonts, keyboard, etc.), a file opened in editor.

#Test caseDescription
1National Keyboards
  1. Create a new java file (File|New File...).
  2. Switch to another national keyboard different from English e.g. to Czech or German. It might depend on your OS.
  3. Type some non-English characters.
Teardown: Close the file and discard all changes.
RESULT:All characters in chosen languages should be displayed properly.
2Default Encoding
Setup:You can use I18n_UTF_8.java. This file is stored in the UTF-8 encoding. You must have properly set Czech fonts and your OS must store files in UTF-8 encondig. If your OS does not store files in UTF-8, then the option "Default encoding" is here for you. Change the default encoding to UTF-8.
  1. Set the default encoding option in Tools|Options -> Editing|Java Sources -> Expert properties -> Default Encoding to other encoding than UTF-8 (e.g. iso-8859-2, iso-8859-1, etc.).
  2. Open a java source file with national characters.
RESULT:All characters in chosen language should be displayed properly.
No Image
3I18N Undo Action
Setup:Use file from previous case.
  1. Select part of the text with national characters and invoke Cut action (Ctrl+X).
  2. Try to invoke the Undo action (Ctrl+Z).
RESULT:All changes should be correctly undone.
4Clipboard with localized characters
Setup:Use file from previous case.
  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.
RESULT:Text should be propertly copied and displayed.
How to determine the encoding on your system?
Steps:
1. You must run the IDE from system console (cmd on windows)
2. Look at the output from IDE, there are a lot of information. The encoding is underlined in the begining of the output. You can see that I use UTF-8. no image

Test suite 4: Keyboard & Shortcuts

Purpose: Tests editor shortcuts (global related to editor and local in editor)
Info:
There are three type of keyboard shortcuts in the IDE:
1. Shortcuts from the Tools|Keyboard shortcuts menu. These are global IDE shortcuts.They should be used in any part of the IDE (explorer, editor, output window, etc.).
2. Shortcuts from editor options Tools|Options -> Editing|Editor Settings -> Global Key Bindings. These are global editor shorcuts. It is possible use they only in editor window.
3. Shortcuts for each type of editable file Tools|Options -> Editing|Editor Settings|Java Editor -> Key Bindings (Settings are in CSS, HTML, Plain, Java, JSP, Properties, XML and DTD editors). It's possible to use these shortcuts only in adequate types of editor.
Setup: Opened the KeyboardSmall.java or KeyboardBig.java file in editor.

#Test caseDescription
1Basic Keyboard Actions
  1. Caret (Cursor) moves - move focus to editor and push these keys:
    - up, down, left, right arrows - while moving the caret right then at EOL the caret jumps to the beginning of next row, it works backwards too. While moving up/down if the previous/next row is shorter then the caret jumps to EOL.
    - move caret to the beginning of a row :
    • before the first char in current line (Home key),
    • to begin of the current line (once more Home key)
    • and again ... The Home key move the caret between these two (above mentioned) possitions
    - end of current line (End),
    - begin of previous/next word Ctrl-Left/Right Arrow
    - to begin/end of file Ctrl-Home and Ctrl-End
  2. Scrolling
    Small files have no scrollbar -> it is not possible to scroll them. Big files with more lines or/and more columns have scrollbar(s).
    - Scroll with Ctrl-Up/Down arrow -> The caret stay on the same row and page is scrolled.
    - Scroll with PgUp/PgDown -> caret is moved to first/last row in editor's visible area and next hit of PgUp/PgDown scroll one page, Ctrl-Home/End -> Caret is moved to the beginning/end of the file and the content is scrolled.
  3. Select text - Shift-Arrows (char by char), Ctrl-Shift-Arrows (words), Shift-PgUp/Down (pages), Ctrl-A entire content of file
  4. Insertion mode - move caret in front of any word and type some charackters. -> characters are inserted (this mode is activated by default).
  5. Rewrite mode - move caret in front of any word, change mode to rewrite (Insert key) and type some characters -> characters are rewritten.
RESULT:Results are clear from steps.
2Undo Redo Actions
Setup:The sample file should be newly opened before the test. 100 actions fit into the undo buffer.
  1. Try to use Undo/Redo Ctrl-Z/Ctrl-Y. It should not be possible to do it because no changes were done previously. Check if these menu items are disabled, too.
  2. Perform any changes in the file.
  3. Use the Undo action once (Ctrl+Z).
  4. Use the Redo action once (use icon in toolbar).
  5. Type another characters.
  6. Use Undo action as long as possible - so that opened file has the same content as previously saved version.
RESULT:Changes file flag (small star next to name of the file in tabs) disappeared and undo properly clear all typed changes (characters).
3General Keyboard Shortcuts
Setup:This case tests only if an action is called. You shold not test the functions of these actions. It means if you press Ctrl-F, you only test if Find dialog appears.
  1. Try clipboard actions Copy Ctrl+C, Cut Ctrl+X, Paste Ctrl+V, Delete Delete.
  2. Try actions Find Ctrl+F , Go to line Ctrl+G, Replace Ctrl+H and Close Ctrl+F4.
RESULT:Actions must be performed succesfully.
4Editor's Global Key Bindings
Setup:Check all shortcuts and check the functionality of appropriate actions.
  1. Go to Tools|Options -> Editing|Editor Settings -> Key Bindings -> ... and test all keybinding from this dialog.
RESULT:All key bindings should execute associated actions and do what is expected.
5Changing Editor's Global Keybinding
  1. Open editor's global shortcuts e.g. for java editor from the Tools|Options menu.
  2. In Options window select node Editing|Editor Settings
  3. Choose Key Bindings (...).
  4. Try to add some new keybindings for actions and test them in editor.
  5. Try to remove some keybindings and test them in editor.
  6. Restart the IDE.
  7. Perform the same tests after IDE restart.
RESULT:The keybindings should work if they were added. They should not work if they were removed.
6Editor's Local Key Bindings
Setup:Pay attention to check all shortcuts and check the function of these shorcuts !
  1. Go to Tools|Options -> Editing|Editor Settings|(Plain Text, HTML, Java) Editor -> Key Bindings -> ... and test all keybindings from this dialog.
RESULT:All key bindings should be properly executed and do what is expected.
7Changing Editor's Local Keybinding
Setup:Open Java file in editor for Java editor keybindings.
  1. Open editor's local shortcuts e.g. for Java editor from the Tools|Options menu.
  2. Expand node Editing|Editor Settings.
  3. Choose Java Editor.
  4. Press Key Bindings (...) in the dialog.
  5. Try to add some shortcuts for individual actions and test them in editor.
  6. Try to remove some of the shortcuts and test them in editor.
  7. Restart the IDE.
  8. Perform the same tests after IDE restart.
RESULT:The keybindings should work if they were added. They should not work if they were removed.

Test suite 5: Mouse Test

Purpose: Tests basic mouse functionality.
Setup: Opened file MouseSmall.java or MouseBig.java in editor

#Test caseDescription
1Mouse 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.
RESULT:Focus is changed to editor and cursor should be positioned at the clicked place or at end of line you've clicked.
2Mouse Click after EOF
Setup:Open MouseSmall.java file. This file has 5 lines only, bacause there is empty arrea in lower part of edior.
  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.
RESULT:Caret must move to last line in editor. Caret is placed at EOL or at the column you've clicked (if it exists).
3Mouse 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.
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.
4Mouse Triple Click
  1. Quickly triple click on any line in editor.
RESULT:Whole line you've clicked on should be selected.
5Mouse Wheel (JDK Version >= 1.4.0)
Setup:JDK version 1.4.0 and higher
  1. Try to use the mouse wheel in editor (focus should be in editor window).
RESULT:Document in editor should scroll up or down.

Test suite 6: Java Editor During Actions

Purpose: Checks actions on the source file.
Setup: Opened any java file without errors in source (compilable).

#Test caseDescription
1Compile Source
  1. Make changes in editor - type commands to aprropriate places, e.g. System.out.println("xx") to any method in source.
  2. Compile source by pressing F9 or from menu.
RESULT:Source should be saved and compiled with changes made.
2Compile Source With Error
Setup:After this test case must be cleaned all changes!
  1. Make changes in editor - e.g. write "xx" to any place in the source file.
  2. Compile source by pressing F9 or from menu.
RESULT:Source should be saved and error(s) should be displayed in the output window.
3Execute Action
  1. Make some changes in editor.
  2. Call Execute action by pressing F6 or from menu.
RESULT:Source code should be saved, compiled and then executed.
4Debugging
  1. Make changes in editor - type any commands to appropriate places.
  2. Call debugging action by pressing Alt+F5 or from menu.
Teardown: Stop the debbuging session.
RESULT:Source should be saved, compiled and debbugged.

Test suite 7: Find Test

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

#Test caseDescription
1Find Dialog Open Close
  1. Open find dialog from main menu (Alt+E|F or with mouse).
  2. Press the Esc key.
  3. Open find dialog (Ctrl+F).
  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.
RESULT:Dialog must be opened and then closed. The Help window must by closed, too.
2Find Selection Repeated
Setup:Close whole editor. Open a Java file in the editor.
  1. Select a piece of text, and invoke find dialog (Ctrl+F).
  2. Immediately press "Find" button.
  3. Select another piece of text, invoke find dialog (Ctrl+F).
  4. Immediately press "Find" button.
RESULT:When find dialog is opened, the "Find What" input line should contain selected piece of code. After pressing "Find" button, appropriate text should be found.
3Find Dialog Combo Box
  1. Perform three searches (for three different words/texts).
  2. Invoke the find dialog (Ctrl+F).
  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.
RESULT:The combo box should contain all texts you were searching for. These texts should be fully functional, including searching for these texts.
4Find - Unselected All Options
  1. Open find dialog.
  2. Unselect all checkboxes in the dialog.
  3. Type any word which editor contained.
  4. Press the Find button.
RESULT:First occurrence of the word should be found and highlighted. Status bar should contain target coordinates and cursor should be positioned on the end of found word.
5No Find - Unselected All Options
  1. Open find 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.
RESULT:Status line of editor should have red background and should contain text 'foo' not found.
6Find - Option Match Case
Setup:You must have caret before the word you looking for! Because you doesn't have selected "Wrap Search" option.
  1. Open find 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 serching for "private" modifier in source file) -> message "Private" not found in status bar.
  4. Open the dialog anyway and type precisly the word private.
  5. Press the Find button.
RESULT:Word "private" should be found.
7Find - Option Match Whole Words Only
  1. Open find dialog.
  2. Unselect all checkboxes.
  3. Select Match Whole Words Only.
  4. Type word which editor contained (this word should be typed 1. from begining 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.
RESULT:First occurance of the word should be found so that it fullfills all three conditions from action 4.
8Find - Option Highlight Search
  1. Open find dialog.
  2. Unselect all checkboxes.
  3. Select only Highlight Search.
  4. Type any word which exists in editor.
  5. Press the Find button.
RESULT:All occurrences of searched word should be highlighted.
9Find - Option Incremental Search
  1. Open find 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.
RESULT:Editor should jump to string which you wrote to the dialog and such strings should be highlighted.
10Find - Option Backward Search
  1. Open find 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.
RESULT:The first occurrence in backward direction should be found.
11Find - Option Wrap Search
  1. Open find 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.
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.".
12Find - Next/Previous
  1. Open the find 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. Try pressing "Find Next" (F3) and "Find Previous" (Shift+F3).
RESULT:The searched word should be found forwards and backwards from current position.
13Find - 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).
RESULT:Each selected word must be searched.(without dialog)
14Find - Search Selected Text
  1. Select several lines of text in which you will perform search.
  2. Open find dialog, check "search in selection" and search for some word which can be found in the selection.
  3. Repeat the search to find all occurences of the word in selected text.
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 successfull search. If the word exists outside selection too, it is not found.
15Find - Search Selected Text Negative
  1. Select several lines of text in which you will perform search.
  2. Open find 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.
RESULT:None of the words outside selection should be found.
16Find - Regular Expressions - Simple
  1. Open file testRegexpSimple.java from samples.
  2. Open find dialog, select regexp search and search for expression: [aA][hH][oO][jJ][0-9]{1,3}
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.
17Find - Regular Expressions - Complex
  1. Open file testRegexpComplex.java from samples.
  2. Open find dialog, select regexp search and search for expression: a?B*c{2}[dD]e{1,}\.F{1,2}\s[^g]
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.
18Find - Text Transfer Between Projects And Editor
  1. Try to search for a string which surely exists in your project in the project tab.
  2. Click on one of the files which were found in results.
  3. Try to perform find in editor.
RESULT:The field "find what" in find dialog should contain the string which was searched during step 1 - among project files. Check that history of search dialogs is shared.

Test suite 8: Replace Test

Purpose: This suite tests the replace dialog.
Setup: Opened any file in editor

#Test caseDescription
1Replace Dialog Open
  1. Open replace dialog (Ctrl+H, Alt+E|E or with mouse).
  2. Click on the Help button and wait till help is opened.
  3. Close help (use small cross on window).
  4. Click on the Close button.
RESULT:Replace dialog and it's help should be opened and closed.
2Replace Selection Repeated
Setup:Close whole editor. Open a Java file in the editor.
  1. Select a piece of text, and invoke replace dialog (Ctrl+H).
  2. Immediately press "Find" or "Replace" button.
  3. Select another piece of text, invoke replace dialog (Ctrl+H).
  4. Immediately press "Find" or "Replace" button.
RESULT:When replace dialog is opened, the "Find What" input line should contain selected piece of code. After pressing "Find" (resp. "Replace") button, approriate text should be found (resp. replaced).
3Replace Dialog Combo Box
  1. Perform three replacements (for three different words/texts).
  2. Invoke the replace dialog (Ctrl+H).
  3. The lines "Find What:" and "Replace With:" are combo boxes. Try to use them.
  4. When you select words from combo boxes, perform "Replace" on it.
RESULT:The combo box in line "Find What:" should contain all texts you were searching for. The combo box in line "Replace With:" should contain all texts by which you were replacing found texts. These texts should be fully functional, including searching for and replacing these texts.
4Replace - Options
  1. Open the replace dialog.
  2. Use the find - options cases (Find suite) to test replace dialog options (Match Case, Section Only, etc.).
RESULT:Results should be the same, in case of Replace action the defined word should be or should not be replaced (depends on selected options).
5Replace All
  1. Select a word in editor. This word should occur in the editor 2-3 times.
  2. Open Replace dialog (Ctrl+H).
  3. Type some word to Replace With line.
  4. Press Replace All button.
  5. Close Replace dialog.
RESULT:All strings equal to selected word should be replaced by word typed in Replace With line (depends on options setting - case sensitivity, etc.) .
6Replace in Selection Only
  1. Select several lines of text in which you will perform replace.
  2. Open replace dialog, check "search in selection" and replace some word which can be found in the selection.
  3. Repeat the action to replace all occurences of the word in selected text.
RESULT:All occurrences of the word are found inside of the selected text. All words which are found are replaced and status bar contains a message about successfull search. If the word exists outside selection too, it is not found and thus it is not replaced.

Test suite 9: Print Test

Purpose: Test printing from the IDE.
Setup: Printing in your OS should work properly. A file is opened in editor.

#Test caseDescription
1Print From Editor
  1. Switch focus to editor (click to editor window).
  2. Print the opened file. Use the keyboard shortcut Ctrl+P.
RESULT:Printing dialog should be opened. This dialog is system dependent. Confirm the dialog and check that your file is printed properly.
2Print Java File Change Option Fonts And Colors
  1. Change font and color for some java items in options (From main menu Tools|Options - IDE Configurations|System|Print Settings|Java Editor -> in property sheet item "Print Fonts and Colors").
  2. Open any java file in editor.
  3. Invoke print action - use Ctrl+P.
  4. Confirm the print dialog.
RESULT:The page is printed. All changes in options should be visible on printed page.
3Print Java File Change Option Show Line Numbers
  1. Change "Show line numbers" option to false in options window (main menu Tools|Options - IDE Configurations|System|Print Settings|Java Editor -> in property sheet item "Print Line Numbers").
  2. Open any java file in editor.
  3. Invoke print action - use Ctrl+P.
  4. Confirm the print dialog.
RESULT:The page is printed. All changes in options should be visible on printed page.
4Change Property Line Ascent Correction
  1. Open any file in editor.
  2. Change property "Line Ascent Correction" (From main menu Tools|Options - IDE Configurations|System|Print Settings -> in property sheet change item "Line Ascent Correction").
  3. Print edited file by Ctrl+P.
  4. Confirm the print dialog.
RESULT:The page is printed. All changes in options should be visible on printed page.
5Change Property Page Footer Aligment
  1. Open any file in editor.
  2. Change the "Page Footer Aligment" property.
  3. Print edited file by Ctrl+P.
  4. Confirm the print dialog.
RESULT:The page is printed. All changes in options should be visible on printed page.
6Change Property Page Footer Font
  1. Open any file in editor.
  2. Change the "Page Footer Font" property.
  3. Print edited file by Ctrl+P.
  4. Confirm the print dialog.
RESULT:The page is printed. All changes in options should be visible on printed page.
7Change Property Page Footer Format
  1. Open any file in editor
  2. Change property "Page Footer Format"
  3. Print edited file (Ctrl+P)
  4. Confirm print dialog
RESULT:The page is printed. All changes in options should be visible on printed page.
8Change Property Page Header Aligment
  1. Open any file in editor.
  2. Change the "Page Header Aligment" property.
  3. Print edited file by Ctrl+P.
  4. Confirm the print dialog.
RESULT:The page is printed. All changes in options should be visible on printed page.
9Change Property Page Header Font
  1. Open any file in editor.
  2. Change "Page Header Font" property.
  3. Print edited file by Ctrl+P.
  4. Confirm the print dialog.
RESULT:The page is printed. All changes in options should be visible on printed page.
10Change Property Page Header Format
  1. Open any file in editor.
  2. Change the "Page Header Format" property.
  3. Print edited file by Ctrl+P.
  4. Confirm the print dialog.
RESULT:The page is printed. All changes in options should be visible on printed page.
11Change Property Wrap Lines
  1. Open any file in editor.
  2. Change the "Wrap Lines" property.
  3. Print edited file by Ctrl+P.
  4. Confirm the print dialog.
RESULT:The page is printed. All changes in options should be visible on printed page.

Test suite 10: Performance

Purpose: Tests speed of windows redrawing and speed of typing characters in editor.
Setup: Prepared bigger files for each file type (text, html, java 350kB).

#Test caseDescription
1Open Long Java File
  1. Open big java file in editor (e.g. from main menu : File|Open File), file should be without syntax errors.
  2. Wait for the file to open.
  3. Close the file.
  4. Open it again and keep it open.
RESULT:Time of opening/closing file should be less than 10 sec (from action open to last reactions of all IDE components).
2Working With Long Java File - No comments
  1. Use the same file from previous case. Open it.
  2. Try scroll the file with scrollbars sliders.
  3. Add Javadoc comment before the method "newMethod". Type e.g. /** My first javadoc comment */.
RESULT:All actions should be done in acceptable time.
3Working 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 Interger(" and wait to completion is appeared (type without quotes).
  3. Type "10);" and press enter.
  4. Go to the end of document (Ctrl+End).
  5. Go to the beginning of document (Ctrl+Home).
  6. Scroll the editor window - press Ctrl+down arrow longer then 4 seconds.
RESULT:All actions should be completed in short time (less than 4 sec.)
4Working With Long Java File - Errors
  1. Switch to the java file (should be opened in editor from previous case).
  2. Do some changes, corrupt some fields and methods.
  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+down arrow longer then 4 seconds.
  6. Type new field to body of a class - type "Integer myInt2 = new Integer(10);".
RESULT:All actions should be completed in short time (less than 4 seconds)
5Windows Redrawing
  1. Switch to Html, Java and Text files (they should be opened in editor from previous case) and with each of them:
  2. Iconize editor and wait for iconize.
  3. Deiconize editor window and wait till all componets of NetBeans are corectly redrawed.
  4. Maximize editor window and wait till all componets of NetBeans are corectly redrawn.
  5. Demaximize editor window and wait till all componets of NetBeans are corectly redrawn.
  6. Drag editor title bar with mouse and move the editor window to another place.
RESULT:All actions should be completed in short time (less than 4 seconds). All other windows should be redrawn in very short time (less then 1 second) while the editor is moved. All NetBeans windows should be during all actions on the same position as before without flashing.
6Multiple Cloned Windows
  1. Switch to Html, Java and Text files (should be opened in editor from previous case) and with each of them do:
  2. Show popup menu over editor content and choose "Clone View" item.
  3. Type some characters into original editor window.
  4. Save file (Ctrl+S).
  5. Type some characters into cloned editor window.
  6. Save file (Ctrl+S).
RESULT:All cloned windows should have the same content as the original editor window. When typing the characters should appear in both original and cloned windows.

Test suite 11: Clipboard

Purpose: Tests storing and restoring from clipboard.
Setup: Two files opened in editor.

#Test caseDescription
1Mouse Middle button insertion from IDE (Unix only)
Setup:Unix operation systems only.
  1. Open two files in editor.
  2. Select some text in editor (this automatically add the selected text in clipboard ).
  3. Select another text in this file.
  4. Switch to next opened file.
  5. Press the middle mouse button.
RESULT:Selected text should be inserted to current cursor position for JDK version 1.4.0 and higher. For older JDKs it should paste text from clipboard.
2Mouse Middle button insertion from system (Unix only)
Setup:Unix operation systems only.
  1. Open a file in editor.
  2. Put some text to system clipboard from another application (e.g. Mozzila).
  3. Select another text from another application (e.g. System Terminal).
  4. Go back to IDE and set focus to editor.
  5. Press middle mouse button.
RESULT:Text should be inserted to current cursor position - for JDK version 1.4.0 and higher - selected text (e.g. System Terminal), for older JDKs - text from clipboard (e.g. Mozilla).
3Copy&Cut Data Inside Java File
  1. Open any java file in editor.
  2. Select any area of text in edited file and then copy it to the clipboard (Ctrl+Ins).
  3. Move blinking cusor to another place of editor and paste data from clipboard to the source file (Shift+Ins).
  4. Select another area of text in edited file and then cut it to the clipboard (Shift-Del).
  5. Move blinking cusor to another place of editor and paste data from clipboard to the source file (Shift+Ins).
RESULT:Copied text is duplicated in editor, cut text is removed, texts are placed in cursor position and cursor should re-appear behind added data.
4Copy&Cut Data Between Two Edited Files
  1. Switch to an HTML file.
  2. Select any area of text in edited HTML file and then copy (cut) it to the clipboard (Ctrl+C, resp. Ctrl+X).
  3. Switch to the text file.
  4. Put the data from clipboard to the text file (Ctrl+V).
RESULT:Selected text is copied (cut) from the html file to the text file.
5Copy&Cut Data To Cloned View
  1. Swith to a java file.
  2. Select any area of text in edited file and then copy (cut) it to the clipboard (Ctrl+C, resp. Ctrl+X).
  3. Clone view (display poup menu over editor pane and then choose "clone view" item).
  4. There should be auto focus on the cloned view, if no then get focus to the cloned view (click to cloned view).
  5. Put data from clipboard to source file in cloned view (Ctrl+v).
RESULT:Copied (cut) text is placed in editor in cursor position and both editor windows (cloned and original) contain the same data.
6Copy&Cut Data From OS To Netbeans
  1. Open any file in native editor which use system clipboard
  2. Select any text and put it to the system clipboard (depents of native editor)
  3. Select focus to some netbeans Java editor.
  4. Put text from clipboard to the edited file (Ctrl+V).
RESULT:Selected text is copied from native editor to netbeans editor
7Copy&Cut Data From Netbeans To OS
  1. Switch to focus to text file in IDE editor
  2. Select text in edited file and copy (cut) it to clipboard (Ctrl+C, resp. Ctrl+X)
  3. Open any file in native editor which use system clipboard
  4. Put text from clipboard to the text file in native editor (it's depending to native editor)
RESULT:Selected text is copied from Netbeans to native editor

Test suite 12: Colorizing

Purpose: Tests colors
Setup:

#Test caseDescription
1Default Java Fonts And Colors
  1. Open Colorizing.java file with all keywords, and Colorizing2.java (not in samples xxx) file with some Java elements, method calls, special characters and unicode characters or you can go throught actions mentioned below)
  2. Type all Java keywords to editor, they must be marked by blue by default:
    abstractdefaultintstrinctfp
    assertelseinterfacesuper
    booleanextendslongswitch
    breakfalsenativesynchronized
    bytefinalnewthis
    casefinalynullthrow
    catchfloatpackagethrows
    charforprivatetransient
    classgotoprotectedtrue
    constifpublictry
    continueimplementsreturnvoid
    doimportshortvolatile
    doubleinstanceofstaticwhile
  3. Type any comments (without quotes) : e.g.: "// first comment ", "/* second commnent */" and documentary comment "/** @author aaa */"), comments should by marked by light gray by default
  4. Type string: e.g. type with quotes ! "abcdef01234567890"
  5. Type double, char, int use decimal, octal and hexadecimal numbers: e.g. type without quotes "1234567890","01234567","0x12345678890ABCDEF","0.1234567890"
  6. Type Operators: + - * / etc.
  7. Type class declaration and method call: e.g. "class X { X(){} A(){} }"
  8. Type unicode characters: e.g. "\0124"
RESULT:Check text color for each group of characters when typing Java element to editor. Default colors.
2Changing Fonts And Colors Settings Java
  1. Java file from previous case should be opened in editor.
  2. Open Fonts and colors dialog for Java files (From main window Tools|Options->Editing|Editor Settings|Java Editor->Fonts Colors).
  3. In appeared dialog change for each item font and color.
RESULT:Check if all changes are propagated correctly into editor.

Test suite 13: Focus Test

Purpose:
Setup:

#Test caseDescription
1Open File Focus Test
Setup:Close all opened editors.
  1. Select any class in Filesystems in Explorer.
  2. Open it -> focus is moved to opened Editor window.
  3. Double click the same class (you should click to method node or field node in Explorer) -> focus is moved to opened Editor window
  4. Select more files in Explorer and open them from popup menu.
RESULT:The last opened Editor window should have focus (blinking cursor).
2New From Template Focus Test
  1. Open some Java source file in editor and focus it (move mouse cursor to editor pane and click).
  2. Invoke action New (Ctrl+N).
  3. In displayed wizard select "Java Classes|Java Class".
  4. Press Next, write some class name and press Finish.
RESULT:New opened Editor Window should have focus (blinking cursor).
3Find (Replace) Focus Test
  1. Open some Java source file in editor and focus it (move mouse cursor to editor pane and click).
  2. Repeatedly invoke Find action (Ctrl+F), write some string (existing in opened file) and press Find button.
RESULT:Editor window should have focus after each find action invocation.
4Go To Line Focus Test
  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.
RESULT:Editor window should have focus after each Go to line action invocation.
5Editor Tabs Switching Focus Test
  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 (Alt+left arrow) to switch to next file.
RESULT:After each switch between the editor tabs, focus should stay in the actual editor window.
6Close Tab Focus Test
  1. Open at least two java files in the Editor Window.
  2. Close one of them (Ctrl+F4).
RESULT:Focus should be moved to another opened Editor tab.

Test suite 14: Indentation Engines

Purpose:
Setup:

#Test caseDescription
1Default Engines For All Supported Types
  1. Open settings for HTML file and check its value for item Indentation (From Main Window menu Tools|Options->Editing|Editor Settings|HTML Editor->Indentation Engine)
  2. Open settings for Java file and check its value for item Indentation (From Main Window menu Tools|Options->Editing|Editor Settings|Java Editor->Indentation Engine)
  3. Open settings for Text file and check its value for item Indentation (From Main Window menu Tools|Options->Editing|Editor Settings->Indentation Engine
RESULT:HTML should have "HTML Indentation Engine" selected by default.
Text files (Plain Editor) should have "Simple Indentation Engine" selected by default.
Java files (Java Editor) should have "Java Indentation Engine" selected by default.
2No Indetation Engine
  1. Switch indentation engine for HTML (Java, text) editor off
  2. Open any HTML (Java, text) file in editor
  3. Type some spaces
  4. Type any word
  5. Press Enter
RESULT:No indentation should be used.
3Simple Indentation Engine Default Settings
  1. Open any file with simple indentation engine, e.g. plain text file or html file.
  2. Type any word from the beginnig of a row, e.g. "ABC".
  3. Type some spaces, e.g. 4x.
  4. Move cursor back (use left arrow 2x).
  5. Press Enter
RESULT:Cursor should be visible on the next row's first column.
4Simple Indentation Engine Default Settings - tabs
  1. Type tab key
RESULT:Tab should consist of four separate spaces, check this using backspace of left arrow.
5Simple Indentation Engine Expand Tab
  1. Switch "Expand Tabs to Spaces" setting to false (From main window select Tools|Option->Editing|Editor Settings->Indentation Engine->... ->"Expand Tabs to Spaces")
  2. Focus the editor (use the same file as in previous case).
  3. Press Tab
  4. Switch 'Expand Tabs to Spaces' back to true.
RESULT:Check if tab is added, press left arrow once and check if cursor jumps 4 spaces back.
6Simple Indentation Engine Delete Tab
  1. Use the file from previous case (Expand Tabs to Spaces are disabled).
  2. Press Tab
  3. Press Backspace
RESULT:Tab should be deleted.
7Changed Number of Spaces per Tab
  1. Type any word to the file from previous case.
  2. Change "Space per tab" option for Simple indentation engine, e.g. to 6 (from main menu window select: Tools|Options->Editing|Indentation Engines|Simple Indentaion Engine->... change "Number of Spaces Per Tab" property).
  3. Place the carret in front of the typed word.
  4. Press Tab
RESULT:In front of the typed word, there are six spaces inserted -- check whether the newly created Tab consists of spaces (as in presvious case).
8Java Indentation Engine Add Leading Star in Comment 1
Setup:Select "Java Indentation Engine" for Java Editor indentation engine if you have change it.
  1. Open any java file
  2. Type comment to the beginning of a row. (e.g. "/* comment")
  3. Type Enter
RESULT:There is a leading star added in front of the cursor. The star should be placed right below the star on the row above.
9Java Indentation Engine Add Leading Star in Comment 2
  1. Use the file from previous case
  2. Type a javadoc comment from the beginning of a row, e.g."/** this is a comment"
  3. Type Enter
RESULT:There is a leading star added in front of the cursor. The star should be placed right below the first star on the row above.
10Java Indentation Engine Add Leading Star in Comment 3
  1. Switch 'Add Leading Star in Comment' to false (from main window select Tools|Options->Editing|Indentation Engines|Java Indentation Engine->Add Leading Star in Comment)
  2. Type "/*"
  3. Press Enter
RESULT:No leading star has been added and cursor is placed below the star.
11Java Indentation Engine Add Newline Before Brace 1
  1. Use the same file as in previous case.
  2. Switch 'Add NewlLine Before Brace' to True. (from main window Tools|Options->Editing|Indentation Engines|Java Indentation Engine->Add Newline Before Brace)
  3. Reformat code (from popup over the editor, choose 'Reformat code' item)
RESULT:There is a newline character added before each brace (except of guarded blocks).
12Java Indentation Engine Add NewLine Before Brace 2
  1. Use the same file as in previous case
  2. Switch 'Add NewlLine Before Brace' to Fasle (from main window Tools|Options->Editing|Indentation Engines|Java Indentation Engine->Add Newline Before Brace)
  3. Reformat code (Use shortcut from editor Ctrl+Shift+F)
RESULT:No newline char should be added. If they were present before the command invocation, engine should remove them.
13Java Indentation Engine Add Space Before Parenthesis 1
  1. Use the same file as in previous case
  2. Reformat Code (use shortcut Ctrl+Shift+F)
RESULT:No spaces have been added in front of parentheses.
14Java Indentation Engine Add Space Before Parenthesis 2
  1. Switch 'Add Space Before Parenthesis' to true (from main window select Tools|Options->Editing|Indentation Engines|Java Indentation Engine->Add Space Before Parenthesis)
  2. In the file from previous case, invoke Reformat Code
RESULT:There is one space added before each opening parethisis.

Test suite 15: Java Dynamic Code Completion

Purpose: Testing of Java Code Completion functionality.
The first part of suite describes opening the CC dialog in multiple parts of the editor, the second part describes keyboard shortcuts. Third part can be used to test the Options dialog (the part which covers CC).
Setup:

#Test caseDescription
1Activate - Deactivate
  1. Open CodeCompletion.java file
  2. Open and close CC dialog outside the comment
        |/** Javadoc comment */
         /** Javadoc comment */|
    
  3. Open and close CC dialog inside a comment:
    a) In the beginning of a comment
        /|** Javadoc ...
    
    b) In the middle, before the closing tag
        /*|* Javadoc ...
        /** | Javadoc ...
        ... coment *|/
    
RESULT:Outside of a comment:
CC dialog should always appear.
Inside of a comment:
a) CC dialog appears, because the parser recognise a comment only after "/*" tag.
b) Inside of a comment, it shouldn't be possible to invoke code completion.
2Keyboard Behaviour
  1. Open DCC dialog
  2. Scroll the dialog (use Up-Down Arrow, Page-Up Down, Home or End buttons). Ensure correct behaviour of the dialog.
RESULT:Content of CC dialog is scrolling up (resp. down). Appropriate items are highlighted.
3Enter
  1. Open DCC dialog
  2. Add highlighted item from dialog to the editor (press Enter)
RESULT:Pressing of enter pastes selected item into the code.
4Shift+Enter
  1. Open DCC dialog
  2. Add highlighted item from dialog to the editor (use Shift+Enter)
RESULT:Enter places selected item into the code. The DCC view should stay visible and show appropriate content.
5Empty editor
  1. Open epmty Java editor
  2. Open DCC dialog (press Ctrl+Space)
  3. Close DCC dialog (click outside of this dialog)
RESULT:List of packages should be shown.
6Keyword package
  1. Type "package " in the editor (watch for the space after the package keyword).
  2. Invoke DCC dialog manually (ctrl+space). (In this case, DCC won't be opened automatically).
RESULT:DCC dialog appeared, showing packages of all active parser databases.
7Keyword import
  1. Type "import " in the editor.
  2. Wait for DCC dialog to appear.
RESULT:DCC dialog appeared, showing list of packages.
8Keyword new
  1. Type "new " in the editor
  2. Wait for DCC dialog to appear.
RESULT:DCC dialog appeared, showing all classes and interfaces from all parser databases.
9Show Packages 1
  1. Type "java." somewhere in the editor.
  2. Wait for the CC dialog with listed packages to appear.
RESULT:Code Completion dialog should appear, showing all java packages.
10Show Packages 2
  1. Invoke CC outside class definition.
  2. Wait for completion dialog to appear.
RESULT:List of packages should be aviable in the CC dialog.
11Show Classes 1
  1. Type "java.lang."
  2. Wait for DCC to appear.
RESULT:java.lang. packages and classes are shown in the DCC dialog.
12Show Classes 2
  1. Open DCC dialog (Press Ctrl+Space)
  2. Wait for DCC to appear.
  3. Type "S".
RESULT:All classes and packages beginning with "S" should be displayed.
13Show Methods 1
  1. In any method, type "this."
  2. Wait for DCC dialog to appear.
RESULT:DCC Dialog appeared, showing methods and variables appropriate for selected class.
14Show Methods 2
  1. In any method type "new java.lang.String[] {"aaa"}[0]."
  2. Wait for DCC to appear.
RESULT:The results for "String" instance should be shown.
15Class Search
  1. Create any java file named 'String' (from main window File|New->Classes|Class, press next, fill in 'String' as name and press Finish)
  2. Type to editor "String"
  3. Press Ctrl+Space
RESULT:In appeared dialog, there should be at least two items displayed for 'String' (java.lang.String and just created String).
16Class and arrays
  1. Try to write "int[] a; a." and invoke CC (press Ctrl+Space).
  2. Try to write "String." and invoke CC (press Ctrl+Space).
RESULT:For the array variable, CC should contain item "int length", for classes CC should contain item "Class class".
17Parameter Tooltip - Show
  1. Write String.valueOf(|) into source code.
  2. Press Alt-P.
RESULT:The parameter tooltip should appear.
18Parameter Tooltip - Hide