cornercorner
FeaturesPluginsDocs & SupportCommunityPartners

XSD Editor Test Specification

Author: Jiri Kovalsky
Version: 1.20
Last update: 21.4.2006
Introduction: This document contains procedures for testing XML schema editor. The xml module provides syntax highlighting, bracket matching, code folding, navigator and validation/transformation actions in the editor.
Comment:

Table of Contents

Test suite 1: Syntax highlighting

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

#Test caseDescription
1New XSD 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 Schema as file type. Push Next >.
  4. Type addressbook into File Name, change Folder field to src\java\schema and press Finish.
RESULT: New addressbook.xsd file is opened in editor containing default definition and commented out example. The file is created under Source Packages | schema 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 XSD elements (blue), attributes (green), values (pink), comments (dark green) and metadata (dark blue).

Test suite 2: Validation

Purpose: This test suite checks that it is possible to check structure and contents of XSD file.
Setup: No preparation is necessary for this test suite except having a web project open with addressbook XSD file.

#Test caseDescription
1Check structure
  1. The addressbook.xsd file contains 3 structure errors in total.
  2. Right click editor area and choose Check XML from popup menu.
  3. One error at line 1 must be reported in Output - XML check window.
  4. Click The value following "encoding" ... [1] link. It highlights the first line in editor and moves cursor there.
  5. Correct the error and repeat step 2.
  6. Go after each error and fix it according to hints mentioned in the comment below the error line.
RESULT:In the end XML checking finished must show up in the status bar of IDE.
2Validate contents
  1. The addressbook.xsd file contains 4 content errors in total.
  2. Right click editor area and choose Validate XML from popup menu.
  3. Several errors must be reported in Output - XML check window.
  4. Click The content of 'sequence' ... [15] link. It highlights line 15 in editor and moves cursor there.
  5. Correct the error and repeat step 2.
  6. Go after each error and fix it according to hints mentioned in the comment below the error line.
RESULT: In the end XML validation finished must show up in the status bar of IDE.
3XSD constrained XML
  1. Invoke File | New File... from main menu.
  2. Select XML category and XML Document as file type. Push Next >.
  3. Type addressbook into File Name, change Folder to src\java\schema and press Next >.
  4. Select XML Schema-Constrained Document option and push Next >.
  5. Type addressbook.xsd into Schema URI, press Tab key and verify that Root Element is set to addressbook. Push Finish.
  6. Copy the following text and paste it into <addressbook> element:

    <friend nickname="Jirka" birthday="1974-06-24">
    <email>
    jiri.kovalsky*sun.com</email>
    </friend>

  7. Right click Source Packages | schema | addressbook.xml node and invoke Validate XML.
  8. The value 'jiri.kovalsky*sun.com' of element 'email' is not valid. error shows up.
  9. Correct the e-mail address by replacing * char by @ char and repeat step 7.
RESULT: The addressbook.xml file validates successfully and XML validation finished message shows up in Output - XML check window.

Test suite 3: Schema completion

Purpose: This test suite checks that the completion works well in XSD editor
Setup: No preparation is necessary for this test suite except having a web project open with addressbook XSD file.
test / testSchemaCompletion.xsd;

#Test caseDescription
1Completion of tags
  1. Create a new line at the end of addressbook.xsd.
  2. Type <xsd:an. Press Ctrl+Space.
  3. Code completion should offer three possibilities. Choose xsd:anyAttribute and press Enter.
RESULT: Code completion should complete the tag <xsd:anyAttribute.
2Completion of attributes
  1. Presss Space and Ctrl+Space.
  2. Attributes should be offered. Type p to reduce the list and press Enter.
RESULT: Attribute should be completed so you have <xsd:anyAttribute processContents="|" and cursor is set between quotes.
3Completion of values
  1. Press Ctrl+Space to invoke code completion.
  2. Three atributes should be on the list. Press Enter.
  3. Value "lax" should be inserted. Press End key and type >.
RESULT:
Start tag should be complete and end tag should be automatically added.

Test suite 4: Other features

Purpose: This test suite checks that XSL transformation, navigator and code folding work fine on XSD file.
Setup: No preparation is necessary for this test suite except having a web project open with addressbook XSD file.

#Test caseDescription
1Transformation
  1. Save addressbook.xsl stylesheet next to addressbook.xsd schema.
  2. Right click Source Packages | schema | addressbook.xsd node and invoke XSL Transformation....
  3. Type addressbook.xsl into XSLT Script and addressbook.html into Output.
  4. Select Open in Browser as Process Output and push OK.
RESULT: Transformation finished is printed into Output - XSLT Processor window and browser gets opened displaying newly generated addressbook.html file.
2Code folding
  1. Switch to addressbook.xsd file and invoke View|Code Folds|Collapse All from main menu.
  2. Move mouse over the root fold <xsd:schema> which shows content of this element in popup window.
  3. Click icons next to line numbers to expand code folds.
  4. Set cursor at position 6:6 i.e. <xsd:|simpleType name="EmailType"> and press CTRL+Numpad-.
RESULT: Code fold <xsd:simpleType> is created.
3Navigator
  1. Make sure that Navigator view contains tree structure of addressbook.xsd schema displaying two levels by default.
  2. Double click the last node xsd:element name="addressbook".
RESULT: Double click expands/collapses selected node. In this case xsd:complexType node shows up. Besides particular line gets highlighted in editor and cursor moves there.

Generated: 2006 07 20 10:52
Companion
Projects:
MySQL Database Server   GlassFish Community: an Open Source Application Server   Open Solaris  Open JDK: an Open SourceJDK   Mobile & Embedded Community     Sponsored by 
Sponsored by Sun Microsystems