FeaturesPluginsDocs & SupportCommunityPartners

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

Test suite 1: Syntax highlighting

Purpose: This test suite checks that syntax highlighting in XML editor is correct.
Setup: No preparation is necessary for this test suite.

#Test caseDescription
1New XML document
  1. Use File | New Project... to create new Web Application project located in your home directory.
  2. Invoke File | New File... from main menu.
  3. Select XML category and XML Document as file type. Push Next >.
  4. Type diary into File Name, change Folder field to src\java and press Next >.
  5. 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.
2Syntax highlighting
  1. Copy whole content of this document into clipboard.
  2. Press CTRL+A in the editor and then click Edit | Paste from main menu.
  3. 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 redcolor.
3Navigator
  1. Click [+] in Navigator view to expand week root node.
  2. Compare structure displayed in the Navigator with the following picture. Verify that badge shows path to problematic element if XML file contains errors.
  3. Double click day node.
RESULT: Editor gets focus and cursor is moved to position 5:5 i.e. start of day element.
4Navigator fiters
  1. Press button in Navigator view.
  2. All atributes should be hidden in Navigator view.
  3. Press button in Navigator view.
RESULT:All Text Contents should be hidden in Navigator view.

Test suite 2: Validation

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 caseDescription
1Check structure
  1. Right click editor area and choose Check XML from popup menu.
  2. One error at line 7 must be reported in Output - XML check window.
  3. Click Comment must start with "<!--. [7] link. It should highlight the line 7 in editor and move cursor there.
  4. Delete line 7 and repeat step 1.
RESULT:XML checking must finish successfully without any error.
2Create DTD
  1. Right click editor area and choose Generate DTD... from popup menu.
  2. Push OK in follow-up dialog.
RESULT: New diary.dtd file is opened in editor containing definitions for week and day elements.
3Validate contents
  1. Switch to diary.xml editor tab, right click editor area and choose Validate XML from popup menu.
  2. One error at line 4 must be reported in Output - XML check window.
  3. 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.
  4. 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.

Test suite 3: Code completion

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 caseDescription
1Tags completion
  1. Switch to diary.dtd editor tab and replace CDATA by (2004|2005) in definition of year attribute at line 23.
  2. Type <!ENTITY boolean "true|false"> at last line 32 and Save the diary.dtd file.
  3. Switch back to diary.xml editor tab. Add new line at end of the file and type <.
  4. Press CTRL+Space. Two suggestions day and week show up.
  5. Type w which should leave only week in the list of suggestions. Press Enter.
RESULT: Now you should have <week written at last line.
2Attributes completion
  1. Press Space and invoke code completion by CTRL+Space again.
  2. Two attributes must show up id and year.
  3. Use Arrow Down to select year and press Enter.
RESULT: Now you should have <week year="" written at last line.
3Values completion
  1. While having cursor between the quotation marks press CTRL+Space to invoke code completion.
  2. Press Enter, then End and type > to complete the tag.
  3. 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.
4Contex awareness
  1. Delete </week> and press Enter. Type < and press CTRL+Space to invoke code completion.
  2. Only two items should show up day and /week.
  3. Type / character.
RESULT: Closing tag must be automatically completed so that you have </week> now. Verify that new node showed up in Navigator.
5Entities completion
  1. Type & and wait for code completion.
  2. 6 items will be suggested including boolean entity.
  3. 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>&amp; at last line 10 now.
test testXMLCompletion.xml, testDTDBasedCompletion.xml

Test suite 4: Big files

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 caseDescription
1Open big file
  1. Download this file and unzip it into your WebApplication/web directory.
  2. Deploy WebApplication/Web Pages in Projects view.
  3. New file mondial.xml should be displayed. Double click it.
  4. 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.
2XML structure
  1. Right click into editor view and select Check XML from popup menu.
  2. An error message .../mondial-3.0.dtd (No such file or directory) [2] should be writen in Output window.
  3. Right click editor view again, but this time choose Generate DTD... from popup menu.
  4. Don't change the name of DTD file, just press OK button.
  5. New file mondial.dtd should be generated and open in editor.
  6. Right click into editor view and select Check DTD . DTD checking sould finish without any warnings.
  7. Change the view back to mondial.xml and repeat step 1.
  8. 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.
3Navigation
  1. Press Ctrl+7 to show Navigator window.
  2. Deploy mondial node and doubleclick some country.
  3. 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.
4Editing
  1. Press Enter to add new line and type <na.
  2. Press Ctrl+Space. Code completion should complete <name tag.
  3. 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
Companion
Projects:
MySQL Database Server   Open JDK: an Open SourceJDK   GlassFish Community: an Open Source Application Server    Mobile & Embedded Community    Open Solaris   java.net - The Source for Java Technology Collaboration   Virtual Box - full virtualizer  Open ESB - The Open Enterprise Service Bus Powered by