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:
Purpose: This suite tests XML document.
Setup: Unzip sample.zip into Source Packages of SampleProject-XML
#
Test case
Description
1
Create New XML document
Setup: Have open SampleProject-XML and you have focus in Project TAB.
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
Repeat this TestCase for all 3 document's types and name it with $No suffix 1, 2 or 3
2
XML 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.
3
XML 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.
4
Text 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.
ATTRIBUTES: validation
5
Check 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.
ATTRIBUTES: validation
6
Validate 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.
Purpose: This suite tests DTD document.
Setup: Use original documents from zip archive sample.zip unpacked into Source Packages of SampleProject-XML
#
Test case
Description
1
Create 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.
ATTRIBUTES: validation
2
DTD Coloring Test
1. Open SampleProject-XML|Source Packages|sample|simpleDTD.dtd document in the Text Editor.
RESULT:
The document is properly colored.
3
Check 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.
Purpose: This suite tests CSS Document
Setup: Use original documents from zip archive sample.zip unpacked into Source Packages of SampleProject-XML
#
Test case
Description
1
Create 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.
ATTRIBUTES: validation
2
CSS 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.
3
CSS Coloring Test
1. Open CSSdocument in the text editor.
RESULT:
The document is properly colored.
4
Check 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.
ATTRIBUTES: validation
5
Copy 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" ?>
ATTRIBUTES: validation
6
Copy 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" >
Purpose: This suite tests Tools.
Setup: Use original documents from sample.zip unpacked into Source Packages of SampleProject-XML
#
Test case
Description
1
Generate 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.
ATTRIBUTES: validation
2
Generate 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.
3
Generate 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.
ATTRIBUTES: validation
4
Generate 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.
5
Generate 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.
Purpose: This suite tests XML Schema Support.
Setup: Use original documents from sample.zip unpacked into Source Packages of SampleProject-XML
#
Test case
Description
1
Create 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.
2
Create 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.
ATTRIBUTES: validation
3
Check 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.
4
Validate 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.
5
Validate 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.
Purpose:
Setup: Use original documents from sample.zip unpacked into Source Packages of SampleProject-XML
#
Test case
Description
1
Create 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.
ATTRIBUTES: validation
2
Check 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.
ATTRIBUTES: validation
3
XSL Transformation Action
Setup: It's supposed that IDE Browser's configuration is correct and that on your OS is that defined browser (on linux OS it is Mozilla Browser).
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.
Purpose: This suite tests XML Catalog.
Setup: Use original documents from sample.zip unpacked into Source Packages of SampleProject-XML
#
Test case
Description
1
Mount 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.
ATTRIBUTES: validation
2
Unmount 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]'.
ATTRIBUTES: validation
3
Mount XML Catalog
Setup: Copy the dtd directory from sample.zip into e.g. /tmp if you use another directory e.g. c:\tmp you must modify HRef attribute in xcatalog.xml and catalog URL.
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.
4
Unmount 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]'.
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
Purpose: This test suite contains test cases for accessibility.
Setup: Download a11y.nbm and prepare your environment as this document instructs you.
#
Test case
Description
1
Check 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.