XML Editor Test Specification
Author: Jindrich Sedek
Version: 1.1
Last update: 20.07.2006
Introduction:
This document contains procedures for testing XML editor. The xml module provides syntax highlighting, code completion and validation actions in editor.
Comment:
This test specification does not cover other XML module functionality like DTD/CSS support, wizards etc.
Table of Contents
|
Purpose: This test suite checks that syntax highlighting in XML editor is correct.
Setup: No preparation is necessary for this test suite.
| # | Test case | Description |
| 1 | New XML document |
-
Use File | New Project... to create new Web Application project located in your home directory.
- Invoke File | New File... from main menu.
-
Select XML category and XML Document as file type. Push Next >.
-
Type diary into File Name, change Folder field to src\java and press Next >.
- Let Well-formed Document option selected and press Finish.
|
|
| RESULT: |
New diary.xml file is opened in editor containing only <root> and </root> elements. The file is created under Source Packages | <default package> node.
|
|
|
test / NewProjectWizardsTest.java ; testDefaultNewWebModWizard()
|
|
| 2 | Syntax highlighting |
- Copy whole content of this document into clipboard.
-
Press CTRL+A in the editor and then click Edit | Paste from main menu.
-
Editor should replace its content with text from clipboard. Compare the syntax highlighting with this picture.
|
|
| RESULT: |
Proper colors should be used for tags (blue), attributes (green), values (pink), comments (dark green), plain text (black) and metadata (dark blue).
| Invalid data section is highlighted in | red | color. |
|
|
| 3 | Navigator |
- Click [+] in Navigator view to expand week root node.
-
Compare structure displayed in the Navigator with the following picture. Verify that badge shows path to problematic element if XML file contains errors. |  |
- Double click day node.
|
|
| RESULT: |
Editor gets focus and cursor is moved to position 5:5 i.e. start of day element.
|
|
| 4 | Navigator fiters |
-
|
Press | | button in Navigator view. |
- All atributes should be hidden in Navigator view.
-
|
Press | | button in Navigator view. |
|
|
| RESULT: | All Text Contents should be hidden in Navigator view. |
|
|
|
Purpose:
This test suite checks that it is possible to check structure and contents of XML file.
Setup:
No preparation is necessary for this test suite except having a web project open with diary.xml file.
| # | Test case | Description |
| 1 | Check structure |
- Right click editor area and choose Check XML from popup menu.
- One error at line 7 must be reported in Output - XML check window.
-
Click Comment must start with "<!--. [7] link. It should highlight the line 7 in editor and move cursor there.
- Delete line 7 and repeat step 1.
|
|
| RESULT: | XML checking must finish successfully without any error. |
|
| 2 | Create DTD |
- Right click editor area and choose Generate DTD... from popup menu.
- Push OK in follow-up dialog.
|
|
| RESULT: |
New diary.dtd file is opened in editor containing definitions for week and day elements.
|
|
| 3 | Validate contents |
-
Switch to diary.xml editor tab, right click editor area and choose Validate XML from popup menu.
- One error at line 4 must be reported in Output - XML check window.
-
Click cvc-elt.1: Cannot find the declaration of element 'week'. [4] link. It should highlight the line 4 in editor and move cursor there.
-
Type <!DOCTYPE week SYSTEM "diary.dtd"> at line 2 and repeat step 1.
|
|
| RESULT: |
No error shows up in Output - XML check window and XML file validates successfully.
|
|
|
|
Purpose: This test suite checks that code completion in XML editor is working correctly.
Setup:
No preparation is necessary for this test suite except having a web project open with diary.xml and diary.dtd files.
| # | Test case | Description |
| 1 | Tags completion |
-
Switch to diary.dtd editor tab and replace CDATA by (2004|2005) in definition of year attribute at line 23.
-
Type <!ENTITY boolean "true|false"> at last line 32 and Save the diary.dtd file.
-
Switch back to diary.xml editor tab. Add new line at end of the file and type <.
-
Press CTRL+Space. Two suggestions day and week show up.
-
Type w which should leave only week in the list of suggestions. Press Enter.
|
|
| RESULT: |
Now you should have <week written at last line.
|
|
| 2 | Attributes completion |
- Press Space and invoke code completion by CTRL+Space again.
-
Two attributes must show up id and year.
-
Use Arrow Down to select year and press Enter.
|
|
| RESULT: |
Now you should have <week year="" written at last line.
|
|
| 3 | Values completion |
-
While having cursor between the quotation marks press CTRL+Space to invoke code completion.
-
Press Enter, then End and type > to complete the tag.
-
Editor should add value. Now you should have <week year="2004"> and new code completion window with end tag should be shown. Press Enter .
|
|
| RESULT: |
<week year="2004"></week> should be written at last line.
|
|
| 4 | Contex awareness |
-
Delete </week> and press Enter. Type < and press CTRL+Space to invoke code completion.
-
Only two items should show up day and /week.
- Type / character.
|
|
| RESULT: |
Closing tag must be automatically completed so that you have </week> now. Verify that new node showed up in Navigator.
|
|
| 5 | Entities completion |
- Type & and wait for code completion.
-
6 items will be suggested including boolean entity.
-
Type a which should reduce the list to only amp and apos items. Press Enter.
|
|
| RESULT: |
amp; should be automatically completed so that you have </week>& at last line 10 now.
|
|
test testXMLCompletion.xml, testDTDBasedCompletion.xml
|
|
Purpose: This test suite checks that code completion in XML editor is working correctly.
Setup:
No preparation is necessary for this test suite except having a web project open.
| # | Test case | Description |
| 1 | Open big file |
-
Download this file and unzip it into your WebApplication/web directory.
- Deploy WebApplication/Web Pages in Projects view.
- New file mondial.xml should be displayed. Double click it.
-
Question dialog should warn the user that mondial.xml is a big file. Press Yes to agree with opening the file.
|
|
| RESULT: | Mondial.xml should be opened in editor. |
|
| 2 | XML structure |
- Right click into editor view and select Check XML from popup menu.
-
An error message .../mondial-3.0.dtd (No such file or directory) [2] should be writen in Output window.
-
Right click editor view again, but this time choose Generate DTD... from popup menu.
- Don't change the name of DTD file, just press OK button.
- New file mondial.dtd should be generated and open in editor.
-
Right click into editor view and select Check DTD . DTD checking sould finish without any warnings.
- Change the view back to mondial.xml and repeat step 1.
- Right click into editor view and select Validate XML from popup menu.
|
|
| RESULT: |
Document should by valid and not any problem should be shown during check and validation.
|
|
| 3 | Navigation |
- Press Ctrl+7 to show Navigator window.
- Deploy mondial node and doubleclick some country.
-
The country should be deployed in Navigator window and displayed in editor view.
|
|
| RESULT: |
Double click the name node in the Navigator window. Focus should be moved to opening <name> tag in the editor view.
|
|
| 4 | Editing |
-
Press Enter to add new line and type <na.
-
Press Ctrl+Space. Code completion should complete <name tag.
-
Type > to close the tag. The editor should add end tag </name>. Press Enter.
|
|
| RESULT: |
New line should be added and the focus should be indented one more tab to the right. In Navigator window new node should be added.
|  |
|
|
Important!: If you are getting OutOfMemoryException during this test suit, try to run NetBeans with -J-Xmx256m parametr.
|
Generated: 2006 09 13 11:51