Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Descriptive XSD Smoke Test Scenarios
The smoke tests are organized into three categories: core tests, secondary rotating tests and adhoc tests. In every test run, the goal is to devote 60% of the time to core tests from which every test should be run, 30% to secondary rotating tests from which a tester can pick two or three tests making sure to cover each test at least once in a milestone, and 10% to adhoc test which can be picked randomly.
Contents
Core Tests
Every test in this category should be run in every smoke test.
Open and Close Editor
- Import the XML Examples: New -> Example ... -> Editing and validating XML files
- Open XMLExamples/GolfCountryClub/GolfCountryClub.xsd and make sure you're in the design view
- Verify you can find BoxOfBallsType in the Types section of the design view; and there are two elements and 12 types in total
File Creation & Saving
- Import the XML Examples: New -> Example ... -> Editing and validating XML files
- File -> New -> Other... -> XML folder -> XML Schema to create an empty Schema file: NewXMLSchema.xsd
- Verify the new file is created and opened in the Schema Editor
- Right click in the Element section and add a new element called NewElement and add a NewComplexType in the Types section as well
- Save and close the editor
- Reopen the editor and verify that the NewElement and NewComplexType are persisted.
- File -> Save As..., and use the name NewXMLSchemaSaveAs.xsd
- Verify the NewXMLSchemaSaveAs.xsd file appear in the navigator
- In NewXMLSchemaSaveAs.xsd, add a new element and a new complex type
- Close the editor without saving the changes
- Reopen the NewXMLSchemaSaveAs.xsd, and verify that the new changes are discarded
Selection Tests
Synchronization between Properties, Design, Source, and Outline views: while conducting the Add/Modify tests, delete tests, and drag & drop tests, observe that these three views are synchronized
Note: if the nodes are collapsed and you add a new child, the node will not automatically expand. Therefore to test synchronization, expand the nodes whenever necessary to verify the synchronization between the Outline and Design view
Add/Modify Tests
For the tests where a new item is added:
- Verify that the item was successfully added by finding and selecting the item from the Outline view or Design view
- Whenever possible, modify the name of the item by changing the Name property in the Properties view under General properties
Tests:
- Include: create a copy of the XML schema of interest and copy to another workspace directory. In Outline view, right click on the Directives node -> Add Include. In the Properties view, select the copied schema as the Schema location
- Import: in Outline view, right click on the Directives node -> Add Import. Select a schema from the workbench
- Redefine: in Outline view, right click on the Directives node -> Add Redefine. Select a schema from the workbench
- Element: in Outline view, right click on the Elements node -> Add Element
- Attribute: in Outline view, right click on the Attributes node -> Add Attribute
- Attribute Group: in Outline view, right click on the Attributes node -> Add Attribute Group. Right click on the newly created Attribute Group -> Add Attribute
- Attribute default and fixed values: right click on an Attribute -> select the Default radio button from the Properties view under the General vertical tab -> Put a value. Verify changes by going to Source view. Now change the radio button to Fixed and verify the change in the source view.
- Complex Type: in Outline view, right click on the Types node -> Add Complex Type
- Simple Type: in Outline view, right click on the Types node -> Add Simple Type
- Group: in Outline view, right click on the Groups node -> Add Group
- Attribute ref: in Outline view, right click on a Complex Type -> Add Attribute Ref
- Attribute ref default and fixed values: right click on an Attribute ref -> select the Default radio button from the Properties view under the General vertical tab -> Put a value. Verify changes by going to Source view. Now change the radio button to Fixed and verify the change in the source view.
- Attribute group ref: in Outline view, right click on a Complex Type -> Add Attribute Group Ref
- Any Attribute: in Outline view, right click on a Complex Type -> Add Any Attribute
- Sequence: in Outline view, right click on a Complex Type -> Add Sequence
- Choice: in Outline view, right click on a Complex Type -> Add Choice
- All: in Outline view, right click on a Complex Type -> Add All
- Repeat the same steps for Design View. The UI element to mouseover and right click for each test is highlighted when selected in the Outline view
Delete Tests
- Delete items: Delete the following in Outline or Design view: Include, Import, Redefine, Element, Attribute, Attribute Group, Group, Attribute ref, Attribute group ref, Any Attribute, Sequence, Choice, All, Complex Type, Simple Type
- Delete locals and globals: Delete locals by removing a non-root element from the XML schema document and remove globals by removing a root element from the XML schema. Remove by right clicking on the element -> Delete
Search & Refactoring
Search & Rename
- Import the XML Examples: New -> Example ... -> Editing and validating XML files
- Create a new Schema file called NewSchema.xsd under the folder GolfCountryClub
- Create a new element and right click on it: Set Type -> Browse...
- Change the Search scope to Enclosing project and select BoxOfBallsType.
- Click OK and save
- Open GolfCountryClub.xsd
- Right click BoxOfBallsType in the Types section: References -> Project
- Verify that there is one reference in NewSchema.xsd and one reference in GolfCountryClub.xsd
- Right click BoxOfBallsType in the Types section: Refactor -> Rename...'
- Check Update references and change the name to BoxOfBallsTypeChanged and click Preview ->
- Verify that there are two changes in GolfCountryClub.xsd and one change in NewSchema.xsd
- Click OK and verify that the changes in the preview are applied to the two files using the editor. (Hint: can search for BoxOfBallsTypeChanged in the two files.)
Make Anonymous Type Global
- Use the same XML Examples project imported in the section above and open GolfCountryClub.xsd
- In the Outline view, select Elements -> GolfCountryClub -> local type
- Right click local type and select Refactor -> Make Anonymous Type Global
- Verify that local type becomes GolfCountryClubComplexType and the Types tree has a new element also called GolfCountryClubComplexType
Make Local Element Global
- Use the same XML Examples project imported in the section above and open GolfCountryClub.xsd
- In the Outline view, select Elements -> GolfClubType -> Shaft: ShaftType
- Right click Shaft: ShaftType and select Refactor -> Make Local Element Global
- Verify that a new Shaft: ShaftType element appears in the Elements tree at the same level as the GolfClub: GolfClubType, and also that a little arrow icon overlays the original Shaft: ShaftType
Validation
- Import the XML Examples: New -> Example ... -> Editing and validating XML files
- Right click on the project XMLExamples -> Properties -> select Validation from the list of properties -> add a check to the "Add Validation Builder to project" checkbox.
- Open XMLExamples/GolfCountryClub/GolfCountryClub.xsd and switch to source view by clicking the source tab at the bottom of the editor.
- Replace <simpleType name="ShaftType"> with <simpleType name="ShaftTypeChanged"> and save
- Verify that validation kicks in and marks the file with one error
- Go to the Problems view and verify that an error appears like src-resolve: Cannot resolve the name 'tns:ShaftType' to a(n) 'type definition' component.
Secondary Rotating Tests
Two or three tests from this category should be run in every smoke test. Testers should make sure every test should be run at least once in any given milestone.
Drag & Drop Tests
- Import the XML Examples: New -> Example ... -> Editing and validating XML files
- Open XMLExamples/GolfCountryClub/GolfCountryClub.xsd and switch to the design view
- Right click in the Types section and select Add Complex Type
- Double click the newly added complex type to drill down to its details
- Right click on the complex type and select Add Sequence
- Add four elements in the newly created sequence
- Drag & drop in the design view to re-order them
- Verify the order is changed correctly in the design view, outline view and source view
- Add four attribute in the complex type as well
- Drag & drop in the design view to re-order them
- Verify the order is changed correctly in the design view, outline view and source view
Source Editing
- As you type validation: add invalid attributes or elements to the XML Schema. As you type them, the text should be underlined in red and on mouseover, an error message should be displayed (if you already verified as you type validation while you were verifying validation, you can skip this step)
- Content Assist: use CTRL+SPACE in various parts of the Schema to see the possible entries that can be added
- Switching between Design and Source view: make sure changes to the source are reflected in the Design view
- Import the XML Examples: New -> Example ... -> Editing and validating XML files
- Open XMLExamples/GolfCountryClub/GolfCountryClub.xsd and switch to the source view
- Go to the line <element name="GolfCourse" type="tns:GolfCourseType" maxOccurs="unbounded" minOccurs="1"></element>
- Hold Ctrl and click on tns:GolfCourseType
- Verify that the editor "jumps" to this line <complexType name="GolfCourseType">
- Add an import like: <import schemaLocation="../PhoneBanking/PhoneBanking.xsd" namespace="http://www.example.com/PhoneBanking"></import>
- Hold Ctrl and click on "../PhoneBanking/PhoneBanking.xsd"
- Verify that an external editor is opened on PhoneBanking.xsd
Extensions
- Import the XML Examples: New -> Example ... -> Editing and validating XML files
- Open XMLExamples/GolfCountryClub/GolfCountryClub.xsd and switch to the design view
- Right click Types -> BoxOfBallsType and select Show properties
- In the properties view, click the Extensions tab
- Click Add..., and then Add... in the popup dialog
- Click Workspace... and select XMLExamples/PhoneBanking/PhoneBanking.xsd
- Select and add AccountSummary
- Verify that the AccountSummary is added as an extension
- Click Add..., and then Add... in the popup dialog again
- Click XML Catalog... and select http://schemas.xmlsoap.org/wsdl/soap/
- Select and add binding
- Verify; that the binding is added as an extension
- Select binding and verify that it has three attributes: required, style and transport
- Fill attributes, save and reopen the file
- Verify that the two new extensions are persisted and the attributes of the binding extension as well
- Delete the two extensions
- Save and reopen the file
- Verify that the two extensions have been deleted
XML Catalog
Schema resolution using XML Catalog
- Import the XML Examples: New -> Example ... -> Editing and validating XML files
- Open XMLExamples/GolfCountryClub/GolfCountryClub.xml and switch to the source view
- Change <GolfCourse NumberOfHoles="18"> to <GolfCourse NumberOfHoles="19">
- Right click on XMLExamples/GolfCountryClub/GolfCountryClub.xml and select Validate
- Verify there is one error complaining the value of NumberOfHoles
- Add a schema location-based custom entry to XML Catalog:
- Go to Window -> Preferences -> XML -> XML Catalog
- Click Add...
- Click Workspace... and select XMLExamples/GolfCountryClub/GolfCountryClub.xsd
- Set Key Type to Schema Location and Key is http://my.schema.location
- Replace xsi:schemaLocation="http://www.example.org/GolfCountryClub GolfCountryClub.xsd " with xsi:schemaLocation="http://www.example.org/GolfCountryClub http://my.schema.location ", and save
- Right click on XMLExamples/GolfCountryClub/GolfCountryClub.xml and select Validate
- Verify there is one error complaining the value of NumberOfHoles
- Change the XML Catalog to Namespace-based:
- Go to Window -> Preferences -> XML -> XML Catalog
- Edit the entry http://my.schema.location: change Key Type to Namespace Name and set the Key to http://www.example.org/GolfCountryClub
- Go back to the XML file and delete xsi:schemaLocation="http://www.example.org/GolfCountryClub http://my.schema.location ", and save
- Right click on XMLExamples/GolfCountryClub/GolfCountryClub.xml and select Validate
- Verify there is one error complaining the value of NumberOfHoles
Export the custom XML Catalog
- Use the same workspace as the above step
- Click File -> Export... -> XML -> XML Catalog, and export it to XMLExamples/catalog.xml
- Verify that catalog.xml looks like:
<?xml version="1.0" encoding="UTF-8"?><catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"> <uri name="http://www.example.org/GolfCountryClub" uri="platform:/resource/XMLExamples1/GolfCountryClub/GolfCountryClub.xsd"/> </catalog>
Import the custom XML Catalog
- Go to Window -> Preferences -> XML -> XML Catalog, and delete the custom entry
- Import XMLExamples/catalog.xml using File -> Import... -> XML -> Catalog
- Go to Window -> Preferences -> XML -> XML Catalog, and verify that you see a custom entry named http://www.example.org/GolfCountryClub
Generators
- Import the XML Examples: New -> Example ... -> Editing and validating XML files
- Right click on XMLExamples/GolfCountryClub/GolfCountryClub.xsd and select Generate -> XML File...
- Accept the defaults and generate a new XML file
- Verify that the generated file looks like the following:
<?xml version="1.0" encoding="UTF-8"?> <tns:GolfClub xmlns:tns="http://www.example.org/GolfCountryClub" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.org/GolfCountryClub GolfCountryClub.xsd "> <ManufacturerName>ManufacturerName</ManufacturerName> <Quantity>1</Quantity> <ClubKind>Driver</ClubKind> <Loft>Loft</Loft> <Shaft>Regular</Shaft> </tns:GolfClub>
Preferences
XSD preferences are found in the menubar Window -> Preferences -> XML -> XML Schema Files
Qualify XSD constructs
- Go to Window -> Preferences -> XML -> XML Schema Files
- Check the Qualify XSD constructs preference
- Modify the prefix and the target namespace
- Ensure that the prefix and target namespace is used by the new schema wizard: File -> New -> Others... -> XML -> XML Schema
Honour all schema locations
Test a schema that imports two other schemas with the same namespace and different locations.
- Import the XML Examples: New -> Example ... -> Editing and validating XML files
- Download File:Honourallschemaloc.zip and unzip the files to XMLExamples
- Go to Window -> Preferences -> XML -> XML Schema Files -> Validation (Note: In WTP 3.0.5, it's Window -> Preferences -> XML -> XML Schema Files), uncheck "Honour all schema locations"
- Right click C.xsd and select Validate.
- Verify that an error src-resolve.
- Go to Window -> Preferences -> XML -> XML Schema Files -> Validation (Note: In WTP 3.0.5, it's Window -> Preferences -> XML -> XML Schema Files), check "Honour all schema locations"
- Validate C.xsd again. Verify that the error message should disappear.
Modify full schema conformance
- Import the XML Examples: New -> Example ... -> Editing and validating XML files
- Go to Window -> Preferences -> XML -> XML Schema Files, verify by default the preference "Check full XML Schema conformance" is enabled
- Create a new schema file like below:
FullConformance.xsd
<?xml version="1.0" encoding="UTF-8"?> <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/FullConformance" xmlns:tns="http://www.example.org/FullConformance" elementFormDefault="qualified"> <element name="Name"></element> <complexType name="NewComplexType"> <sequence> <element minOccurs="0" maxOccurs="1" ref="tns:Name"></element> <any></any> </sequence> </complexType> </schema>
- Validate this file and verify that an error is displayed (prefixed by cos-nonambig)
- Go back to the preference and uncheck the preference Check full XML Schema conformance
- Validate the file and verify that error disappears.
Remove unused imports (New to 3.0.1)
- Import the XML Examples: New -> Example ... -> Editing and validating XML files
- Go to Window -> Preferences -> XML -> XML Schema Files -> Editor (Note: In WTP 3.0.5, it's Window -> Preferences -> XML -> XML Schema Files), uncheck, if needed, Automatically remove unused XSD imports and XML Namespace entries
- Open XMLExamples/GolfCountryClub/GolfCountryClub.xsd
- Switch to source view, add <import schemaLocation="../PhoneBanking/PhoneBanking.xsd" namespace="http://www.example.com/PhoneBanking"></import> as a child to the top level element <schema>
- Save and verify that the import is persisted
- Go to Window -> Preferences -> XML -> XML Schema Files -> Editor (Note: In WTP 3.0.5, it's Window -> Preferences -> XML -> XML Schema Files, check Automatically remove unused XSD imports and XML Namespace entries
- Add a white space after the </import> tag and save
- Verify that the import is removed
Adhoc Tests
Please go to Full XSD Function Test Scenarios and randomly pick some tests that are not in neither the core tests nor the secondary rotating tests.
Links
- Full XSD Function Test Scenarios
- WTP 3.0 Test Scenarios
- Old XSD Test Scenarios - the scenarios which this smoke test document was originally based on
- XSD Test Plan