FeaturesPluginsDocs & SupportCommunityPartners

XML Test Specification

Author: Daniel Mladek
Version: 1.0.0
Last update: 02.06.2004
Introduction: This document contains test specifications for XML modules. You could use this prepared SampleProject-XML or create your one (Web->Web Application project type)
Comment:

Table of Contents

Test suite 1: XML Document

Purpose: This suite tests XML document.
Setup: Unzip sample.zip into Source Packages of SampleProject-XML

#Test caseDescription
1Create New XML document
1. In the Explorer, Projecs TAB, right click the "SampleProject-XML|Source Packages|sample.new" folder and choose "New|File..."
2. In the New File Wizard choose XML as "Categories:" and as "File Types:" select XML Document and click Next > button
3. Name it XML-doc1 and click Next > button
4. Select one of document type:
  • Well-formatted Document
  • DTD-Constrained Document
  • XML Schema-Constrained Document

RESULT: In the Source Editor should be opened newly created XML-doc$No document
2XML Editor Test
1. In the Explorer, right click any XML file node and choose "Edit".
2. Edit the document (change, create and remove elements) and save document after each change.
3. Close the editor.
RESULT: The XML document is opened in the Text Editor.
3XML Coloring Test
1. In the Explorer, double click any XML file node
RESULT: The XML document must open in the Text Editor. And the text is properly colored.
4Text Context Sensitive Completion Test
1. Open SampleProject-XML|Source Packages|sample|Books-II.xml document in the Text Editor.
2. Put cursor somewhere into document and type the first few characters of an XML tag.
3. Press Ctrl-spacebar, or pause after typing a portion of the XML tag. The code completion box is displayed. Choose one of the elements.
4. Write up at least one book per the Completion.
5. Close the editor.
RESULT: Context Sensitive Completion provides a scrolling list of valid tag names, attributes, or attribute values that can complete your XML tag. Attribute values are provided only if there is a finite set of possibilities.
5Check XML document
1. Open SampleProject-XML|Source Packages|sample|Books.xml document in the Text Editor.
2. Right-click the editor window and choose Check XML.
3. Delete '<' char from '<Product>' tag and Check XML again.
4. Put the '<' char back, save document and close the output window.
RESULT: After each check message: 'XML Checking finished' and list of errors (if any) appear in the output window below the editor. Each error message serve as link to line with the error.
6Validate XML document
1. Right-click the editor window and choose Validate XML.
2. Add element <Producer/> before the element Product and save the document.
3. Right-click the editor window and choose Validate XML.
4. Remove the element Producer, save document and close the editor and output windows.
RESULT: After each validation message: 'XML Checking finished' and list of errors (if any) appear in the output window below the editor. Each error message serve as link to line with the error.
Teardown:



Test suite 2: DTD Document

Purpose: This suite tests DTD document.
Setup: Use original documents from zip archive sample.zip unpacked into Source Packages of SampleProject-XML

#Test caseDescription
1Create New DTD document
1. In the Explorer, Projecs TAB, right click the "SampleProject-XML|Source Packages|sample.new" folder and choose "New|File..."
2. In the New File Wizard choose XML as "Categories:" and as "File Types:" select DTD Entity and click Next > button
3. Name it DTD-Entity
RESULT: The new document DTD-Entity is opened in the Text Editor.
2DTD Coloring Test
1. Open SampleProject-XML|Source Packages|sample|simpleDTD.dtd document in the Text Editor.
RESULT: The document is properly colored.
3Check DTD document
1. In the Explorer, right click the SampleProject-XML|Source Packages|sample|simpleDTD.dtd document node and choose Edit. The simpleDTD.dtd is opened in the Text Editor.
2. Right-click the editor window and choose Check DTD.
3. Add element-declaration <!ELEMENT x (#PCDATA|ANY)+> before the element-declaration Books and save the document. Right-click the editor's window and choose Check DTD.
4. Remove the element-declaration x, save document and close the editor and output windows.
RESULT: After each check message: 'XML Checking finished' and list of errors (if any) appear in the output window below the editor. Each error message serve as link to line with the error.
Teardown:



Test suite 3: CSS Document

Purpose: This suite tests CSS Document
Setup: Use original documents from zip archive sample.zip unpacked into Source Packages of SampleProject-XML

#Test caseDescription
1Create New CSS document
1. In the Explorer, Projecs TAB, right click the "SampleProject-XML|Source Packages|sample.new" folder and choose "New|File..."
2. In the New File Wizard choose XML as "Categories:" and as "File Types:" select Cascading Style Sheet and click Next > button
3. Name it CSSdocument and click Finish button
RESULT: The new CSSdocument CascadingStyleSheet is opened in the Text Editor.
2CSS Text Editor Test
1. Edit the document (change, creates and remove elements) and save document after each change.
2. Close the editor
RESULT: The editor and Editor Coloring behave as expected.
3CSS Coloring Test
1. Open CSSdocument in the text editor.
RESULT: The document is properly colored.
4Check CSS document
1. Open SampleProject-XML|Source Packages|sample|netbeans.css document in the Text Editor.
2. Right-click the netbeans.css node in the Explorer and choose Check CSS.
3. Duplicate 1st appearance of '{' char and Check CSS again.
4. Remove the '{' char back, save document and close the output window.
RESULT: After each check message: 'CSS Checking finished' and list of errors (if any) appear in the output window below the editor. Each error message serve as link to line with the error.
5Copy XML Style
1. Right click the CSSdocument node in the Explorer and choose Copy XML Style
2. Paste the style in a XML document
RESULT: Processing instruction like this is pasted in the XML document:
<?xml-stylesheet type="text/css" href="http://.../CascadeStyleSheet.css" ?>
6Copy HTML Style
1. Right click the CSSdocument node in the Explorer and choose Copy HTML Style
2. Paste the style in a HTML document.
RESULT: Processing instruction like this is pasted in the HTML document:
< link rel="StyleSheet" type="text/css" href="http://.../CascadeStyleSheet.css" media="screen" >
Teardown:



Test suite 4: Tools

Purpose: This suite tests Tools.
Setup: Use original documents from sample.zip unpacked into Source Packages of SampleProject-XML

#Test caseDescription
1Generate DTD from XML
1. In the Explorer, right click the SampleProject-XML|Source Packages|ssample|PhoneBook.xml node and choose Generate DTD.
2. Supply a name for the DTD (e.g. phones) to the dialog that appears and click on OK.
RESULT: A node for the phones.dtd file appears in the Explorer, and the file is opened in the Text Editor.
2Generate SAX Handler
1. In the Explorer, right click the the SampleProject-XML|Source Packages|ssample|phones.dtd node and choose SAX Document Handler Wizard... The SAX Generator Wizard appears. Click on Next, Next, Next and Finish.
2. Nodes for the PhonesHandler.java, PhonesParser.java, PhonesHandlerImpl.java and PhonesHandlerImpl.java file is opened in the Source Editor.
3. In the PhonesHandlerImpl.java enable debugging DEBUG = true; and add main() method like this:
/** Dumps document into Output Window */
public static void main(String[] args) throws Exception {
    final String DOCUMENT = "PhoneBook.xml";
    Class self = PhonesHandlerImpl.class;

    java.io.InputStream is = self.getResourceAsStream(DOCUMENT);
    InputSource source = new org.xml.sax.InputSource(is);
    source.setSystemId(self.getResource(DOCUMENT).toExternalForm());

    PhonesParser parser = new PhonesParser(new PhonesHandlerImpl(), null);
    parser.parse(source);
}

RESULT: Commented content of PhoneBook.xml appears into Output Window.
3Generate documentation
1. In the Explorer, right click the the SampleProject-XML|Source Packages|ssample|simple.DTD node and choose Generate Documentation.... Supply a name for the HTML file in the dialog that appears and click on OK.
RESULT: A node for the HTML file appears in the Explorer, and the file is opened in the HTML Browser. The DTDDoc comments (a normal comment tag with three minus characters '-' instead of two) appear in the documentation.
4Generate DOM Tree Scanener
1. In the Explorer, right click the the SampleProject-XML|Source Packages|ssample|simpleDTD.dtd node and choose Generate DOM Tree Scanner... Supply a name for the DOM file in the dialog that appears and click on OK.
RESULT: In the Explorer, right click the simpleDTD node and choose Generate DOM Tree Scanner. Supply a name for the DOM file in the dialog that appears and click on OK.
5Generate CSS
1. n the Explorer, right click the the SampleProject-XML|Source Packages|ssample|simpleDTD.dtd node and choose Generate CSS... Supply a name for the CSS file in the dialog that appears and click on OK.
RESULT: A node for the CSS file appears in the Explorer, and the file is opened in the Text Editor.
Teardown:



Test suite 5: XML Schema Support

Purpose: This suite tests XML Schema Support.
Setup: Use original documents from sample.zip unpacked into Source Packages of SampleProject-XML

#Test caseDescription
1Create new XML Schema Document
1. n the Explorer, select the the SampleProject-XML|Source Packages|sample.new node and press Ctrl+N
2. In the New File Wizard choose XML as "Categories:" and as "File Types:" select XML Schema and click Next > button
3. Specify a name and click Finish button
4. Right click the new schema and choose Validate from popup menu.
RESULT: Text Editor with valid XML Schema document appears.
2Create XML Schema Constrained Document
1. In the Explorer, select the the SampleProject-XML|Source Packages|sample.new node and press Ctrl+N
2. In the New File Wizard choose XML as "Categories:" and as "File Types:" select XML Document and click Next > button
3. Name it as XML-Constrain-Schema and click Next button
4. On the third panel of the Wizard, select XML Schema-Constrained Document and click Next button
5. Click Browse button and find $Project_Location/src/sample/schema/employee-schema.xsd
6. As "Root Element:" select employee and click Finish.
RESULT: Text Editor with new XML document appears.
3Check XML Schema
1. Open employee-schema.xsd document, new Source Editor pane appears.
2. Right-Click the document's node and choose Check XML Schema, Output Window without any error message should appeare.
3. Remove root's element start tag.
4. Right click the document's node and choose Check XML Schema.
5. Give the start tag back and close the document.
RESULT: Check operation detects missing tag.
4Validate XML Schema
1. Open employee-schema.xsd document, new Source Editor pane appears.
2. Right click the document's node and choose Validate XML Schema, Output Window without any error message should appeare.
3. Rename xsd:attrribute element on xsd:attrib.
4. Right click the document's node and choose Validate XML Schema.
5. Rollback the previous change and close the document.
RESULT: Check operation detects invalid element name.
5Validate XML Schema Constrained Document
1. Open employee-sample.xml document, new Source Editor pane appears.
2. Right click the document's node and choose Validate XML. Output Window without any error message should appeare.
3. Rename salary element on fee.
4. Right-Click the document's node and choose Validate XML.
5. Rollback the previous change and close the document.
RESULT: Check operation detects invalid element name.
Teardown:



Test suite 6: XSL Transformation

Purpose:
Setup: Use original documents from sample.zip unpacked into Source Packages of SampleProject-XML

#Test caseDescription
1Create XSL Stylesheet Document
1. In the Explorer, select the the SampleProject-XML|Source Packages|sample.new node and press Ctrl+N
2. In the New File Wizard choose XML as "Categories:" and as "File Types:" select XSL Stylesheet.
3. Specify a name and click Finish button.
RESULT: Text Editor with new XSL Stylesheet document appears.
2Check XSL Stylesheet
1. Open SampleProject-XML|Source Packages|sample.xslt|doc2html.xsl document in the Text Editor.
2. Right click the document's node and choose Check XML.Output Window without any error message should appeare.
3. Remove root's element start tag.
4. Right click the document's node and choose Check XML.
5. Rollback the previous change and close the document.
RESULT: Check operation detects missing tag.
3XSL Transformation Action
1. Right click SampleProject-XML|Source Packages|sample.xslt|doc2html.xsl node in the Explorer and choose XSL Transformation, XSL Transformation dialog should appeare.
2. Browse xsl/document.xml as XML Source .
3. Change the "Output:" to value "document_output.html"
4. Set "Process Output:" to value "Open in Browser"
5. and click OK button.
RESULT: Source Editor with new document_output.html document should appeare which is also displayed in your defined Browser.
Teardown:



Test suite 7: XML Catalog

Purpose: This suite tests XML Catalog.
Setup: Use original documents from sample.zip unpacked into Source Packages of SampleProject-XML

#Test caseDescription
1Mount NetBeans Catalog
1. Press Ctrl+5 to open and switch to RunTime TAB in the Explorer Window.
2. Expand the XML Entity Catalog node.
3. If the node doesn't contain Netbeans Catalog then right click on the XML Entity Catalog node and select from popup-menu "Mount Catalog...".
4. In the Mount Catalog dialog choose as "Catalog Type:" the "Netbeans Catalog" and click OK button.
5. Click the Project Tab and right click the "SampleProject-XML|Source Packages|sample|Standard.xml" node and choose Validate XML.
RESULT: Validation finished without any errors.
2Unmount NetBeans Catalog
1. Click the Runtime Tab then right click on the XML Entity Catalogs|Netbeans Catalog node and choose Unmount Catalog.
2. Click the Filesystems Tab then right click "SampleProject-XML|Source Packages|sample|Standard.xml" node and choose Validate XML.
RESULT: Validation finished with error: 'File "" not found. [0]'.
3Mount XML Catalog
1. Click the Runtime Tab, right click on the XML Entity Catalog node and choose Mount Catalog....
2. From the "Catalog Type:" choice select "XML Catalog" and as "XML Catalog URL:" fill /tmp/dtd/xcatalog.xml or c:\tmp\dtd\xcatalog.xml and click on OK.
3. Click the Project Tab and right click the "SampleProject-XML|Source Packages|sample|Addresses.xml" node and choose Validate XML.
RESULT: Validation finished without any errors.
4Unmount XML Catlaog
1. Click the Runtime Tab then right click on the XML Entity Catalogs|Netbeans Catalog node and choose Unmount Catalog.
2. Click the Filesystems Tab then right click "SampleProject-XML|Source Packages|sample|Addresses.xml" node and choose Validate XML.
RESULT: Validation finished with error: 'File "" not found. [0]'.
Teardown:



Test suite 8: Settings

Purpose: This suite tests Settings.
Setup:

#Test caseDescription
1Check Settings nodes
1. Choose the Main Menu -> Tools -> Options, the Options dialog should appeare.
2. Check exist nodes: Editing, Editor Settings, DTD Editor, XML Editor, CSS Editor , Indentation Engines, XML Indentation Engine.
3. XML, General Settings
RESULT: Options Tree contains following nodes:

Editing| Editor Settings|DTD Editor, XML Editor, CSS Editor;
Editing|Indentation Engines|XML Indentation Engine;
Editing|XML|General Settings

2Import settings from previous version
1. Run new IDE and import settings from previous version and watch IDE for possible errors thrown during this time.
RESULT: All old settings are restored.
Teardown:



Test suite 9: Accessibility

Purpose: This test suite contains test cases for accessibility.
Setup: Download a11y.nbm and prepare your environment as this document instructs you.

#Test caseDescription
1Check accessibility
1. Invoke all XML dialogs which are accessible from various places, eg. Popup-menu on a file/package, via Main-menu, etc.
2. Check dialog for accessibility.
3. Check all dialogs using previous actions.
RESULT: There should be no A11Y bugs. See: A11Y homepage, JUnit module dialogs list.
Teardown:




Generated: Mon Jun 21 10:42:09 CEST 2004
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