Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Descriptive XSD Smoke Test Scenarios"

(Preferences)
(Validation)
 
(28 intermediate revisions by 4 users not shown)
Line 1: Line 1:
== Example Setup ==
+
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.
Examples found via: New -> Example ... -> Editing and validating XML files
+
 
 +
= '''Core Tests''' =
 +
'''Every test in this category should be run in every smoke test.'''
  
 
== Open and Close Editor ==
 
== Open and Close Editor ==
# '''Workspace XSD file''': open an XSD file from the workspace and verify its content
+
# Import the XML Examples: ''New -> Example ... -> Editing and validating XML files''
# '''Non-workspace XSD file''': open an XSD file from outside the workspace and verify its content. In addition, edit this file from an external editor and ensure a File changed dialog appears in Eclipse
+
# 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==  
 
==Selection Tests==  
Line 38: Line 55:
  
 
==Delete Tests==
 
==Delete Tests==
# '''Delete items''': Delete the following in Outline or Design view: Include, Import, Redefine, Element, Attribute, Attribute Group, Complex Type, Simple Type, Group, Attribute ref, Attribute group ref, Any Attribute, Sequence, Choice, All
+
# '''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
 
# '''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==
 
==Drag & Drop Tests==
# '''Sequence''': setup by creating a new Complex Type, adding a sequence, and adding a few elements into the sequence.  In the Design view, re-order the sequence elements by dragging.  The reordering must be reflected in both the Design and Outline view
+
# Import the XML Examples: ''New -> Example ... -> Editing and validating XML files''
# '''Attribute''': setup by creating a new Complex Type and adding a few attributes.  In the Design view, re-order the attributes by dragging.  The reordering must be reflected in both the Design and Outline view
+
# 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==
 
==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
+
# '''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
 
# '''Content Assist''': use CTRL+SPACE in various parts of the Schema to see the possible entries that can be added
# '''Context menus''': right click in the Design, Outline, and Source view to check the context menus
 
# '''Formatting''': in the Source view, right click -> source -> Format.  Now untab some elements by selecting elements and using SHIFT+TAB.  To reformat, right click -> source -> Format.
 
# '''Toggle comment''': in Source view, right click -> source -> Toggle Comment
 
# '''Add block comment''': in Source view, right click -> source -> Add Block Comment
 
# '''Remove block comment''': in Source view, right click while inside a block comment -> source -> Remove block Comment
 
 
# '''Switching between Design and Source view''': make sure changes to the source are reflected in the Design view
 
# '''Switching between Design and Source view''': make sure changes to the source are reflected in the Design view
 
==Navigation History==
 
The Navigation History's back and forward buttons can be found in the toolbar as a left and right arrow respectively.  A shortcut is to use ALT+LEFT and ALT+RIGHT.
 
 
 
In the Design View, go to the Schema Index View (top level view of the Schema).  Create a chain of references by clicking on items that bring the view to a lower level.  Also test external references such as imports and includes by clicking on them.  Use the back and forward arrows to navigate through the chain of references.  Ensure the correct Design View is displayed for the item and the back and forward buttons navigate correctly through the chain of references.
 
  
 
==Hyperlink Navigation==
 
==Hyperlink Navigation==
#'''Referenced components''': in the Source View, press F3 or "CTRL+click" over a referenced component. The source editor should go to the referenced component
+
# Import the XML Examples: ''New -> Example ... -> Editing and validating XML files''
#'''Imports and Includes in the Source View''': in the Source View, press F3 or "CTRL+click" over an import or include and the selection should jump to the referenced component
+
# Open ''XMLExamples/GolfCountryClub/GolfCountryClub.xsd'' and switch to the ''source'' view
#'''Imports and Includes in the Design View''': in the Design View, double click on an include or import, which will automatically open the editor
+
# 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==
 
==Extensions==
# '''Add extensions''': right click on a Complex Type -> select the Extension vertical tab from the Properties view -> under Extension, click the Add button -> click Add in the ADd Extension Components menu -> fill in a name -> select a schema from the workspace -> Click OK until you return to the Add Extension Components menu -> select a component from the Available components to Add list and press OK
+
# Import the XML Examples: ''New -> Example ... -> Editing and validating XML files''
# '''Add extension attribute''': Note: uses results from previous step. From the instructions above, add an attribute by selecting an Extension from the list -> Fill in a value for any values that show up in the Extension Details list, which is to the right of the Extensions list
+
# Open ''XMLExamples/GolfCountryClub/GolfCountryClub.xsd'' and switch to the ''design'' view
# '''Delete extensions''': Note: uses results from previous step.  Right click on an Extension in the Extensions list -> Remove
+
# 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
  
==Constraints==
+
==XML Catalog==
# '''Initial Setup''': create a new Element, from the Properties view, select Constraints from the vertical tab. Let this view be known as the Constraints property view
+
===Schema resolution using XML Catalog===
# '''Lengths''': modify the Minimum length and Maximum length properties in the Constraints property view
+
# Import the XML Examples: ''New -> Example ... -> Editing and validating XML files''
# '''Enumerations''': in the Constraints property view, use Add, Add..., Edit..., and Delete to test enumeration values
+
# 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''
  
==Refactoring==
+
===Export the custom XML Catalog===
'''Rename''': in the Outline view, right click on the Elements node -> Add Element -> in the Properties view under General properties, change the Type to be referencing an element from another XML Schema in the workspace via Browse... -> go to that Schema in the workspace and highlight the referenced element -> Refactor -> renameright click on a complex type -> Refactor -> Rename... -> press OK after renaming. Now ensure the changes were reflected in the Schema that referenced this element.
+
# 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>
  
==File Creation & Saving==
+
===Import the custom XML Catalog===
# '''Save and Save-As''': Use save and save-as on XML schema files
+
# Go to ''Window -> Preferences -> XML -> XML Catalog'', and delete the custom entry
# '''Close without saving''': changes should not be committed
+
# Import ''XMLExamples/catalog.xml'' using ''File -> Import... -> XML -> Catalog''
# '''Open existing XML schema file'''
+
# Go to ''Window -> Preferences -> XML -> XML Catalog'', and '''verify''' that you see a custom entry named ''http://www.example.org/GolfCountryClub''
# '''Create a new XML schema''': File -> New -> Other... -> XML folder -> XML Schema
+
  
==Export Diagram as Image==
+
==Generators==
From the menubar, XSD -> Export Diagram as Image -> choose filename -> Press OK. Open the image and ensure the proper image is exported (according to what's shown in the Design view) and the image is not cut-off (the Schema Index view is cut-off https://bugs.eclipse.org/bugs/show_bug.cgi?id=250953)
+
# 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:
  
==Validation==
+
<?xml version="1.0" encoding="UTF-8"?>
# '''Schema validation''': introduce invalid elements or attributes to a valid XML schema. Right click on the schema in the Package Explorer -> Validate. A red X should show up because the XML schema is invalid.  Revert the changes and revalidate, the X should dissapear
+
  <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 ">
# '''Disconnected mode''': disconnect your computer from the internet and check that nothing breaks
+
  <ManufacturerName>ManufacturerName</ManufacturerName>
# '''Validation builder''': right click on the project -> Properties -> select Validation from the list of properties -> add a check to the "Add Validation Builder to project" checkbox. Introduce changes to a schema that will invalidate an XML file. The error should show up automatically instead of manually validating the XML file
+
  <Quantity>1</Quantity>
 
+
  <ClubKind>Driver</ClubKind>
'''Note:''' once you enable Add Validation Builder to project, it cannot be disabled through the same menu.  It can be removed by right clicking on the project -> Properties -> select Builder from the list of properties -> uncheck Validation form the resulting list
+
  <Loft>Loft</Loft>
 
+
  <Shaft>Regular</Shaft>
==XML Catalog==
+
  </tns:GolfClub>
# '''Load an XML schema from the jar''': create a new XML Schema or use an existing XML schema -> select Extensions from the vertical tab in the Properties view -> Add -> Add... -> fill in a schema name -> select a Schema from Catalog (these schema documents are from jar files).  Not all schemas will have components, so select schemas like http://schemas.xmlsoap.org/wsdl/ -> a component should show up in the Available components to Add list, select one and press OK.  Check that the imported schema shows up in the Source view and the component added
+
# '''Export XML catalog file''': right click on a project in the Package Explorer view -> Export... -> select the XML Catalog from the XML folder and press the Next button -> select a directory to export file to and add a name which ends in .xml -> press the Finish button.  Open the newly export XML Catalog File and verify that it isn't empty (should contain the element <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"/>)
+
# '''Import XML catalog file''': right click on a project in the Package Explorer view -> Import... select the XML Catalog from the XML folder and press the Next button -> select a directory -> press the Import Files... button -> Use browse to find the location of an XML Catalog file -> select the XML file(s) -> click the Finish button. Verify the files were added into the correct directory and contain the correct information.  A quick way to export files is to use files in the same workspace but export to a different directory within the project
+
 
+
==Generators==
+
'''Generate an XML file from an XSD file''': right click on an XML Schema -> Generate -> XML File... -> Add a new file name or use default and press the Next button -> press the Finish button.  From the example files, GolfCountryClub.xsd will generate a decent number of elements
+
  
 
==Preferences==
 
==Preferences==
Line 107: Line 198:
  
  
'''Qualify XSD constructs'''
+
===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''
  
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.
 
  
 +
===Honour all schema locations===
  
'''Honour all schema locations'''
+
Test a schema that imports two other schemas with the same namespace and different locations.
  
Test a schema that imports two other schemas with the same namespace and different locations. Sample files are provided below or you can download the zip [[/images/4/4f/Honourallschemaloc.zip|here]].  All three files must be in the same project.
+
# Import the XML Examples: ''New -> Example ... -> Editing and validating XML files''
 +
# Download [[Image: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.
  
A.xsd
+
===Modify full schema conformance===
<source lang=xml>
+
<?xml version="1.0" encoding="UTF-8"?>
+
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/A"
+
xmlns:tns="http://www.example.org/A" elementFormDefault="qualified">
+
 
+
<simpleType name="A">
+
<restriction base="string"></restriction>
+
</simpleType>
+
</schema>
+
</source>
+
 
+
''B.xsd''
+
<source lang=xml>
+
<?xml version="1.0" encoding="UTF-8"?>
+
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/A"
+
xmlns:tns="http://www.example.org/A" elementFormDefault="qualified">
+
 
+
    <simpleType name="B">
+
    <restriction base="string"></restriction>
+
    </simpleType>
+
</schema>
+
</source>
+
 
+
''C.xsd''
+
<source lang=xml>
+
<?xml version="1.0" encoding="UTF-8"?>
+
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/C"
+
xmlns:tns="http://www.example.org/C" elementFormDefault="qualified"
+
xmlns:a="http://www.example.org/A">
+
<import namespace="http://www.example.org/A" schemaLocation="A.xsd" />
+
<import namespace="http://www.example.org/A" schemaLocation="B.xsd" />
+
 
+
<simpleType name="C">
+
<restriction base="a:B"></restriction>
+
</simpleType>
+
</schema>
+
</source>
+
 
+
Validate C.xsd.  Expect to see an error src-resolve.  From the XSD Preferences, check "Honour all schema locations" and validate C.xsd again.  The error message should disappear.
+
 
+
 
+
'''Modify full schema conformance'''
+
  
Download the schema overlap.xsd from https://bugs.eclipse.org/bugs/show_bug.cgi?id=162244 or alternatively, use the code below, which simulates the same scenario.
+
# 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''
 
''FullConformance.xsd''
Line 180: Line 241:
 
</source>
 
</source>
  
Validate this file and notice that an error is displayed (prefixed by cos-nonambig).  By default the preference "Check full XML Schema conformance" is enabled, resulting in this error message.  In the XSD schema preference, uncheck the preference "Check full XML Schema conformance" and validate the file.  The error should disappear.
+
# 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)'''
+
===Remove unused imports (New to 3.0.1)===
  
Make sure the Directive "Automatically remove unused XSD imports and XML Namespace entries" is unchecked. Make changes if needed and press OK, otherwise press cancel. Select an XML Schema -> right click on the Directives node in the Outline view -> Add Import -> In the Properties view, select General from the vertical tab -> press the ... button for Schema location -> choose Workbench projects and press Next -> choose an XML schema, which isn't used by the current schema (or isn't the schema itself) -> press the Finish button -> Save the file, nothing should happen.  Now check the Directive "Automatically remove unused XSD imports and XML Namespace entries" and press OK.  If you Save again, the import will disappear.
+
# 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
  
==Zooming==
+
=Adhoc Tests=
# '''Zoom out''': open a XSD file and go to the Design View.  From the menubar -> XSD -> Zoom Out.  Try several times and make sure the text and the boxes get smaller
+
Please go to [[All_XSD_Smoke_Test_Scenarios|Full XSD Function Test Scenarios]] and randomly pick some tests that are not in neither the core tests nor the secondary rotating tests.
# '''Zoom in''': open a XSD file and go to the Design View.  From the menubar -> XSD -> Zoom In. Try several times and make sure the text and the boxes get larger
+
  
== Links ==
+
= Links =
 +
*[[All_XSD_Smoke_Test_Scenarios|Full XSD Function Test Scenarios]]
 
*[[WTP_Smoke_Test_Scenarios_R30|WTP 3.0 Test Scenarios]]
 
*[[WTP_Smoke_Test_Scenarios_R30|WTP 3.0 Test Scenarios]]
 
*[[XSD_Smoke_Test_Scenarios|Old XSD Test Scenarios]] - the scenarios which this smoke test document was originally based on
 
*[[XSD_Smoke_Test_Scenarios|Old XSD Test Scenarios]] - the scenarios which this smoke test document was originally based on
 
*[[XSD_Test_Plan|XSD Test Plan]]
 
*[[XSD_Test_Plan|XSD Test Plan]]

Latest revision as of 12:12, 26 August 2009

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.

Core Tests

Every test in this category should be run in every smoke test.

Open and Close Editor

  1. Import the XML Examples: New -> Example ... -> Editing and validating XML files
  2. Open XMLExamples/GolfCountryClub/GolfCountryClub.xsd and make sure you're in the design view
  3. 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

  1. Import the XML Examples: New -> Example ... -> Editing and validating XML files
  2. File -> New -> Other... -> XML folder -> XML Schema to create an empty Schema file: NewXMLSchema.xsd
  3. Verify the new file is created and opened in the Schema Editor
  4. Right click in the Element section and add a new element called NewElement and add a NewComplexType in the Types section as well
  5. Save and close the editor
  6. Reopen the editor and verify that the NewElement and NewComplexType are persisted.
  7. File -> Save As..., and use the name NewXMLSchemaSaveAs.xsd
  8. Verify the NewXMLSchemaSaveAs.xsd file appear in the navigator
  9. In NewXMLSchemaSaveAs.xsd, add a new element and a new complex type
  10. Close the editor without saving the changes
  11. 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:

  1. 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
  2. Import: in Outline view, right click on the Directives node -> Add Import. Select a schema from the workbench
  3. Redefine: in Outline view, right click on the Directives node -> Add Redefine. Select a schema from the workbench
  4. Element: in Outline view, right click on the Elements node -> Add Element
  5. Attribute: in Outline view, right click on the Attributes node -> Add Attribute
  6. Attribute Group: in Outline view, right click on the Attributes node -> Add Attribute Group. Right click on the newly created Attribute Group -> Add Attribute
  7. 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.
  8. Complex Type: in Outline view, right click on the Types node -> Add Complex Type
  9. Simple Type: in Outline view, right click on the Types node -> Add Simple Type
  10. Group: in Outline view, right click on the Groups node -> Add Group
  11. Attribute ref: in Outline view, right click on a Complex Type -> Add Attribute Ref
  12. 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.
  13. Attribute group ref: in Outline view, right click on a Complex Type -> Add Attribute Group Ref
  14. Any Attribute: in Outline view, right click on a Complex Type -> Add Any Attribute
  15. Sequence: in Outline view, right click on a Complex Type -> Add Sequence
  16. Choice: in Outline view, right click on a Complex Type -> Add Choice
  17. All: in Outline view, right click on a Complex Type -> Add All
  18. 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

  1. 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
  2. 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

  1. Import the XML Examples: New -> Example ... -> Editing and validating XML files
  2. Create a new Schema file called NewSchema.xsd under the folder GolfCountryClub
  3. Create a new element and right click on it: Set Type -> Browse...
  4. Change the Search scope to Enclosing project and select BoxOfBallsType.
  5. Click OK and save
  6. Open GolfCountryClub.xsd
  7. Right click BoxOfBallsType in the Types section: References -> Project
  8. Verify that there is one reference in NewSchema.xsd and one reference in GolfCountryClub.xsd
  9. Right click BoxOfBallsType in the Types section: Refactor -> Rename...'
  10. Check Update references and change the name to BoxOfBallsTypeChanged and click Preview ->
  11. Verify that there are two changes in GolfCountryClub.xsd and one change in NewSchema.xsd
  12. 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

  1. Use the same XML Examples project imported in the section above and open GolfCountryClub.xsd
  2. In the Outline view, select Elements -> GolfCountryClub -> local type
  3. Right click local type and select Refactor -> Make Anonymous Type Global
  4. Verify that local type becomes GolfCountryClubComplexType and the Types tree has a new element also called GolfCountryClubComplexType

Make Local Element Global

  1. Use the same XML Examples project imported in the section above and open GolfCountryClub.xsd
  2. In the Outline view, select Elements -> GolfClubType -> Shaft: ShaftType
  3. Right click Shaft: ShaftType and select Refactor -> Make Local Element Global
  4. 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

  1. Import the XML Examples: New -> Example ... -> Editing and validating XML files
  2. 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.
  3. Open XMLExamples/GolfCountryClub/GolfCountryClub.xsd and switch to source view by clicking the source tab at the bottom of the editor.
  4. Replace <simpleType name="ShaftType"> with <simpleType name="ShaftTypeChanged"> and save
  5. Verify that validation kicks in and marks the file with one error
  6. 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

  1. Import the XML Examples: New -> Example ... -> Editing and validating XML files
  2. Open XMLExamples/GolfCountryClub/GolfCountryClub.xsd and switch to the design view
  3. Right click in the Types section and select Add Complex Type
  4. Double click the newly added complex type to drill down to its details
  5. Right click on the complex type and select Add Sequence
  6. Add four elements in the newly created sequence
  7. Drag & drop in the design view to re-order them
  8. Verify the order is changed correctly in the design view, outline view and source view
  9. Add four attribute in the complex type as well
  10. Drag & drop in the design view to re-order them
  11. Verify the order is changed correctly in the design view, outline view and source view

Source Editing

  1. 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)
  2. Content Assist: use CTRL+SPACE in various parts of the Schema to see the possible entries that can be added
  3. Switching between Design and Source view: make sure changes to the source are reflected in the Design view

Hyperlink Navigation

  1. Import the XML Examples: New -> Example ... -> Editing and validating XML files
  2. Open XMLExamples/GolfCountryClub/GolfCountryClub.xsd and switch to the source view
  3. Go to the line <element name="GolfCourse" type="tns:GolfCourseType" maxOccurs="unbounded" minOccurs="1"></element>
  4. Hold Ctrl and click on tns:GolfCourseType
  5. Verify that the editor "jumps" to this line <complexType name="GolfCourseType">
  6. Add an import like: <import schemaLocation="../PhoneBanking/PhoneBanking.xsd" namespace="http://www.example.com/PhoneBanking"></import>
  7. Hold Ctrl and click on "../PhoneBanking/PhoneBanking.xsd"
  8. Verify that an external editor is opened on PhoneBanking.xsd

Extensions

  1. Import the XML Examples: New -> Example ... -> Editing and validating XML files
  2. Open XMLExamples/GolfCountryClub/GolfCountryClub.xsd and switch to the design view
  3. Right click Types -> BoxOfBallsType and select Show properties
  4. In the properties view, click the Extensions tab
  5. Click Add..., and then Add... in the popup dialog
  6. Click Workspace... and select XMLExamples/PhoneBanking/PhoneBanking.xsd
  7. Select and add AccountSummary
  8. Verify that the AccountSummary is added as an extension
  9. Click Add..., and then Add... in the popup dialog again
  10. Click XML Catalog... and select http://schemas.xmlsoap.org/wsdl/soap/
  11. Select and add binding
  12. Verify; that the binding is added as an extension
  13. Select binding and verify that it has three attributes: required, style and transport
  14. Fill attributes, save and reopen the file
  15. Verify that the two new extensions are persisted and the attributes of the binding extension as well
  16. Delete the two extensions
  17. Save and reopen the file
  18. Verify that the two extensions have been deleted

XML Catalog

Schema resolution using XML Catalog

  1. Import the XML Examples: New -> Example ... -> Editing and validating XML files
  2. Open XMLExamples/GolfCountryClub/GolfCountryClub.xml and switch to the source view
  3. Change <GolfCourse NumberOfHoles="18"> to <GolfCourse NumberOfHoles="19">
  4. Right click on XMLExamples/GolfCountryClub/GolfCountryClub.xml and select Validate
  5. Verify there is one error complaining the value of NumberOfHoles
  6. Add a schema location-based custom entry to XML Catalog:
    1. Go to Window -> Preferences -> XML -> XML Catalog
    2. Click Add...
    3. Click Workspace... and select XMLExamples/GolfCountryClub/GolfCountryClub.xsd
    4. Set Key Type to Schema Location and Key is http://my.schema.location
  7. Replace xsi:schemaLocation="http://www.example.org/GolfCountryClub GolfCountryClub.xsd " with xsi:schemaLocation="http://www.example.org/GolfCountryClub http://my.schema.location ", and save
  8. Right click on XMLExamples/GolfCountryClub/GolfCountryClub.xml and select Validate
  9. Verify there is one error complaining the value of NumberOfHoles
  10. Change the XML Catalog to Namespace-based:
    1. Go to Window -> Preferences -> XML -> XML Catalog
    2. Edit the entry http://my.schema.location: change Key Type to Namespace Name and set the Key to http://www.example.org/GolfCountryClub
  11. Go back to the XML file and delete xsi:schemaLocation="http://www.example.org/GolfCountryClub http://my.schema.location ", and save
  12. Right click on XMLExamples/GolfCountryClub/GolfCountryClub.xml and select Validate
  13. Verify there is one error complaining the value of NumberOfHoles

Export the custom XML Catalog

  1. Use the same workspace as the above step
  2. Click File -> Export... -> XML -> XML Catalog, and export it to XMLExamples/catalog.xml
  3. 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

  1. Go to Window -> Preferences -> XML -> XML Catalog, and delete the custom entry
  2. Import XMLExamples/catalog.xml using File -> Import... -> XML -> Catalog
  3. Go to Window -> Preferences -> XML -> XML Catalog, and verify that you see a custom entry named http://www.example.org/GolfCountryClub

Generators

  1. Import the XML Examples: New -> Example ... -> Editing and validating XML files
  2. Right click on XMLExamples/GolfCountryClub/GolfCountryClub.xsd and select Generate -> XML File...
  3. Accept the defaults and generate a new XML file
  4. 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

  1. Go to Window -> Preferences -> XML -> XML Schema Files
  2. Check the Qualify XSD constructs preference
  3. Modify the prefix and the target namespace
  4. 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.

  1. Import the XML Examples: New -> Example ... -> Editing and validating XML files
  2. Download File:Honourallschemaloc.zip and unzip the files to XMLExamples
  3. 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"
  4. Right click C.xsd and select Validate.
  5. Verify that an error src-resolve.
  6. 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"
  7. Validate C.xsd again. Verify that the error message should disappear.

Modify full schema conformance

  1. Import the XML Examples: New -> Example ... -> Editing and validating XML files
  2. Go to Window -> Preferences -> XML -> XML Schema Files, verify by default the preference "Check full XML Schema conformance" is enabled
  3. 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>
  1. Validate this file and verify that an error is displayed (prefixed by cos-nonambig)
  2. Go back to the preference and uncheck the preference Check full XML Schema conformance
  3. Validate the file and verify that error disappears.

Remove unused imports (New to 3.0.1)

  1. Import the XML Examples: New -> Example ... -> Editing and validating XML files
  2. 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
  3. Open XMLExamples/GolfCountryClub/GolfCountryClub.xsd
  4. 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>
  5. Save and verify that the import is persisted
  6. 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
  7. Add a white space after the </import> tag and save
  8. 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

Back to the top