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
|
Purpose: This test suite checks that syntax highlighting in XSD editor is correct.
Setup: No preparation is necessary for this test suite.
| # | Test case | Description |
| 1 | New XSD 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 Schema as file type. Push Next >.
-
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.
|
|
| 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 XSD elements (blue), attributes (green), values (pink), comments (dark green) and metadata (dark blue).
|
|
|
|
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 case | Description |
| 1 | Check structure |
- The addressbook.xsd file contains 3 structure errors in total.
- Right click editor area and choose Check XML from popup menu.
- One error at line 1 must be reported in Output - XML check window.
-
Click The value following "encoding" ... [1] link. It highlights the first line in editor and moves cursor there.
- Correct the error and repeat step 2.
-
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. |
|
| 2 | Validate contents |
- The addressbook.xsd file contains 4 content errors in total.
- Right click editor area and choose Validate XML from popup menu.
- Several errors must be reported in Output - XML check window.
-
Click The content of 'sequence' ... [15] link. It highlights line 15 in editor and moves cursor there.
- Correct the error and repeat step 2.
-
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.
|
|
| 3 | XSD constrained XML |
- Invoke File | New File... from main menu.
-
Select XML category and XML Document as file type. Push Next >.
-
Type addressbook into File Name, change Folder to src\java\schema and press Next >.
- Select XML Schema-Constrained Document option and push Next >.
-
Type addressbook.xsd into Schema URI, press Tab key and verify that Root Element is set to addressbook. Push Finish.
-
Copy the following text and paste it into <addressbook> element:
<friend nickname="Jirka" birthday="1974-06-24"> <email>jiri.kovalsky*sun.com</email> </friend>
-
Right click Source Packages | schema | addressbook.xml node and invoke Validate XML.
-
The value 'jiri.kovalsky*sun.com' of element 'email' is not valid. error shows up.
-
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.
|
|
|
|
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 case | Description |
| 1 | Completion of tags |
- Create a new line at the end of addressbook.xsd.
- Type <xsd:an. Press Ctrl+Space.
-
Code completion should offer three possibilities. Choose xsd:anyAttribute and press Enter.
|
|
| RESULT: |
Code completion should complete the tag <xsd:anyAttribute.
|
|
| 2 | Completion of attributes |
- Presss Space and Ctrl+Space.
-
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.
|
|
| 3 | Completion of values |
- Press Ctrl+Space to invoke code completion.
- Three atributes should be on the list. Press Enter.
-
Value "lax" should be inserted. Press End key and type >.
|
|
| RESULT: |
|
Start tag should be complete and end tag should be automatically added.
|
|
|
|
|
|
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 case | Description |
| 1 | Transformation |
-
Save addressbook.xsl stylesheet next to addressbook.xsd schema.
-
Right click Source Packages | schema | addressbook.xsd node and invoke XSL Transformation....
-
Type addressbook.xsl into XSLT Script and addressbook.html into Output.
- 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.
|
|
| 2 | Code folding |
-
Switch to addressbook.xsd file and invoke View|Code Folds|Collapse All from main menu.
-
Move mouse over the root fold <xsd:schema> which shows content of this element in popup window.
-
Click
icons next to line numbers to expand code folds.
-
Set cursor at position 6:6 i.e. <xsd:|simpleType name="EmailType"> and press CTRL+Numpad-.
|
|
| RESULT: |
Code fold <xsd:simpleType> is created.
|
|
| 3 | Navigator |
-
Make sure that Navigator view contains tree structure of addressbook.xsd schema displaying two levels by default.
-
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