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 "COSMOS SML Test Plan"

(Test Suite)
Line 79: Line 79:
 
|}
 
|}
 
=== Base 64 Tests ===
 
=== Base 64 Tests ===
<font color=blue>NEED DESCRIPTION HERE</font>
+
Tests the base 64 element of the SML-IF spec
  
 
{|{{BMTableStyle}}
 
{|{{BMTableStyle}}

Revision as of 18:23, 4 September 2008

COSMOS SML and SML-IF Validator Test Plan

Version 1.3, 4 September 2008

Authors: David Whiteman, Ali Mehregani, Hubert Leung

Introduction

The goal of this test plan is to document the test coverage for the SML and SML-IF validator found in the Eclipse COSMOS project. Using this document, we will describe the test suite used to achieve compliance with the SML and SML-IF 1.1 specifications.

The source for these tests can be found in the org.eclipse.cosmos.rm.validation.tests plug-in in CVS. The content for the below test plan is generated using the TestPlanGenerator class in that plug-in, using the metadata (i.e. identity data) found in the SML-IF files in test-resources.

Test Suite

Acyclic Tests

Tests that check for valid cycles using sml:acyclic

Test Name Description Status
InvalidCyclesWithAcyclicReferences A model is invalid if an instance of an acyclic type CT references itself. Complete
InvalidCyclesWithAcyclicReferences A model is invalid if instances of an element type CT derived from the abstract acyclic element type CT' form a cycle. Complete
InvalidCyclesWithAcyclicReferences A model is invalid if instances of the acyclic anonymous type CT form a cycle Complete
InvalidCyclesWithAcyclicReferences A model is invalid if instances of an acyclic element type CT (or derived types by restriction) create a cycle Complete
InvalidCyclesWithAcyclicReferences A model is invalid if instances of an acyclic element type CT (or derived types by restriction) create a cycle Complete
InvalidDerivationWithAcyclicAttribute A model is invalid if it has a reference type R1 with sml:acyclic=?true? and another reference type R2 derived from R1 such that sml:acyclic=?false? Complete
ValidateAcyclicDefinition This test returns a warning if the sml:acyclic attribute is defined on an element declaration Complete
ValidCyclesWithAcyclicReference2 Let R1 be a reference type with sml:acyclic=?false?. Then a model is valid if it has inter-document cycles using instances of R1 Complete
InvalidCyclesWithAcyclicReferences A model is valid if an element instance with sml:acyclic="true" forms a cycle but is not declared to be an SML reference (despite having a valid sml:uri scheme) Complete
InvalidCyclesWithAcyclicReferences A model is valid if an element instance with sml:acyclic="true" forms a cycle but is declared as a null SML reference (despite having a valid sml:uri scheme) Complete
ValidCycles3 This test verifies that it is valid to create cycles within documents, as long as instances of acyclic references do not create cycles. Complete
ValidDerivationWithAcyclicAttribute A model is valid if it has a reference type R1 with sml:acyclic=?false? and another reference type R2 derived from R1 such that sml:acyclic=?true? Complete
ValidCyclesWithAcyclicReference1 Let R1 and R2 be two reference types with sml:acyclic=?true?. Then a model is valid if it has inter-document cycles using instances of both R1 and R2 Complete
ValidUnresolvedReference A model is valid if an element instance with sml:acyclic="true" references an unresolved document. Complete

Base 64 Tests

Tests the base 64 element of the SML-IF spec

Test Name Description Status
Base64DTDEntity This test verifies that the code returns success when a document that is a child of the base64Data element is encoded in Base64 format. The encoded document is an XML document with DTD definition. The DTD has entity definitions that are used in the XML. Complete
Base64DTDInvalidXML The encoded document is an XML document with DTD definition. The XML sturcture is invalid according to the DTD, but since DTD validation is not done by the SML/SML-IF validator, the SML validator should report success. Complete
Base64DTDMissingEntities The encoded document is an XML document with DTD definition. The XML uses entities that are not defined in the DTD. The validation should fail because DTD is processed with fatal failure. Complete
Base64EncodedDoc An instance document is base64 encoded. Complete
Base64EncodedDocs Let R1 and R2 be two reference types with sml:acyclic=?true?. Then a model is valid if it has inter-document cycles that using instances of both R1 and R2 Complete
Base64EncodedSchema Taken from acylic test suite. (ValidCycles1.xml) Encoded data in definition section in base64 encoding. Let R1 and R2 be two reference types with sml:acyclic=?true?. Then a model is valid if it has inter-document cycles that using instances of both R1 and R2 Complete
Base64EncodedSchemaAndDoc Taken from acylic test suite. (ValidCycles1.xml) Encoded data in both definition and instance sections. Let R1 and R2 be two reference types with sml:acyclic=?true?. Then a model is valid if it has inter-document cycles that using instances of both R1 and R2 Complete
Base64EncodedSchemaAndDocs Taken from acylic test suite. (ValidCycles1.xml) Encoded data in both definition and instance sections. Let R1 and R2 be two reference types with sml:acyclic=?true?. Then a model is valid if it has inter-document cycles that using instances of both R1 and R2 Complete
Base64InvalidEncoding Taken from acylic test suite. (ValidCycles1.xml) Schema is encoded. Encoded data in both definition and instance sections. Let R1 and R2 be two reference types with sml:acyclic=?true?. Then a model is valid if it has inter-document cycles that using instances of both R1 and R2 Complete
Base64InvalidSML All instance documents in this SML-IF are base64-encoded. The instance documents have a cycle for an acyclic type. The SML-IF should be validated to false. Complete

Deref Tests

Tests that ensure proper operation of the deref() function

Test Name Description Status
SingleRef Verify a schematron test using a deref function to resolve an unrecognized reference scheme will fail Complete
InvalidSchemeDerefUsed A model is invalid if an smlxpath1 scheme contains a deref() in the evaluator. Complete
MultipleDeref Verify that deref() can accept a node set of reference elements, i.e., elements for which sml:ref=?true?, and return a node set that is union of the element nodes targeted by references in the node set such that the reference targets exactly one element in the model. The returned node set must not contain any nodes for references that do not target an element in the model. Complete
MultipleXpointer Verify that deref() can resolve references that target non-root elements using XPointer scheme. Complete
SingleRef Verify that deref() can resolve a single reference. The deref() function must return a single node (i.e. a node set with a single node) that corresponds to the element node of the reference’s target when the reference targets a single element in the model. Complete
SingleRef Verify a schematron test using a deref function to resolve a reference with multiple schemes passes as long as both schemes resolve to the same element Complete

Identity Tests

Tests that validate the resolution of key references to elements

Test Name Description Status
InvalidConstraintSubstitution If two element declarations E1 and E2 have the same {namespace name} and {name} and they are both contained (directly, indirectly, or implicitly) in a content model of a complex type, then E1 and E2 MUST have the same set of {SML identity-constraints definitions}. Complete
InvalidConstraintRefAttributes A model is invalid if an identity constraint includes both the 'ref' and 'name' attribute Complete
InvalidConstraintRefElements A model is invalid if the sml:field or sml:selector child elements are specified for a referenced identity constraint. Complete
InvalidConstraintRefKey A model is invalid if a referenced identity constraint type does not match to what it's resolved to. Complete
InvalidConstraintRefNoKey A model is invalid if a referenced identity constraint cannot be resolved Complete
InvalidConstraintSubstitution Verifies that substitution group elements validate id constraints defined on their group affiliation. If an element declaration S has a {substitution group affiliation} G, then its {SML identity-constraints definitions} also contains members of {SML identity-constraints definitions} of G. Complete
InvalidDuplicateConstraintSubst A model is invalid if two constraint names indirectly declared through substitution group have the same name Complete
InvalidDuplicateConstraintName1 A model is invalid if two constraint names under the same element have the same name Complete
InValidKeyDuplicate Verify that a model with a key constraint is invalid if the field values are not unique. Complete
InValidKeyMissing Verify that a model with a key constraint is invalid if some field values are missing. Complete
InvalidConstraintSubstitution If an element declaration S has a {substitution group affiliation} G, then its {SML identity-constraints definitions} also contains members of {SML identity-constraints definitions} of G. Complete
InValidUnique Verify that a model with a unique constraint is invalid if the field values are not unique. Complete
ValidConstraintRefKeyref A model is valid if a referenced identity constraint is used using the 'ref' attribute Complete
ValidKeyref Verify keyref constraint. Complete
ValidKeyUnique Verify that a model with a key and unique constraint is valid if the field values are unique, though some field values for the unique constraint may be missing. Complete
ValidKeyUniqueInScopeOnly Verify that a model with a key and unique constraint is valid if the constraints are satisfied in scope even though the constraints may not be satisfied globally in the model. Complete
InValidKeyDuplicate It is not an error if SML identity constraint and XML identity constraint share the same name. Complete

Miscellaneous Tests

Tests that check miscellaneous issues to ensure valid SML documents

Test Name Description Status
InValidInCompleteModel This test verifies that an incomplete model is invalid Complete
InValidAliasValue This test verifies that the code returns an error when an alias contains an invalid value. Complete
InValidAliasHasFragmentComp This test verifies that the code returns an error when an alias contains a fragment component. Complete
InValidDuplicateAliases This test verifies that the code returns an error when two aliases resolve to the same URI Complete
InvalidMultipleDocument This test verifies that the code returns an error if the data element contains more than one document. Complete
TestDocumentLocator Tests the correct implementation of the locator element Complete
TestRulesWithMultiplePatterns Tests that rules that have multiple patterns are handled correctly Complete
TestMultipleRulesUnderOnePattern Tests that patterns with multiple rules are handled correctly Complete
TestSchemaValidationFailure Tests that validation against the schema fails. Complete
ValidEmptyDocument This test verifies that it is valid to have an empty document. Complete

Reference Tests

Tests that validate the implementation of sml:ref

Test Name Description Status
UnresolvedRef A valid model can contain unresolved references Complete
IntraDocumentRef It is valid for a reference to target an element in the same document. Complete
InvalidBareNameUnresolved This SML-IF contains an SML reference that is a unresolved reference. Bare name is used in this reference. Complete
InvalidBareNameMultipleSchemes An SML reference in this SML-IF document contains 2 references, one uses bare name and one uses smlxpath1. These two references don't resolve to the same element. It is an error as the SML reference is inconsistent. Complete
InValidBaseURI A model is invalid if base URI is not valid Complete
InValidBaseURIRelative A model is invalid if the base URI is not absolute Complete
InValidBaseURIHasFragmentComp A model is invalid if the base URI contains a fragment Complete
InvalidRefTwoSchemes A model is invalid if it contains a reference with two schemes, one resolving to an element and the other unresolved Complete
InvalidRefOneSchemeResolves A model is invalid if a reference contains multiple schemes resolving to different elements. Complete
InValidMissingBaseURIAttr1 A model is invalid if a reference is relative and the base URI is missing Complete
InvalidRefResolvesToMultipleElements A model is invalid if a reference scheme resolves to multiple elements Complete
InvalidRefResolvesToMultipleElements A model is invalid if a reference element is identified with sml:ref="1" and its scheme resolves to multiple elements Complete
SingleRef The deref() function of a nullified reference should not return a target even if the ref has a valid sml:uri child element. Complete
InvalidSchemeResultContainsNonElements A model is invalid if a reference using smlxpath1 scheme resolves to anything other than an element set. Complete
InvalidSchemeSyntaxError A model is invalid if the content of the smlxpath1 scheme is syntactically incorrect. Complete
InvalidSmlRefValue A model is invalid if the value of sml:ref is not valid Complete
InvalidSchemeNamespaceUnknown A model is invalid if a reference using the smlxpath1 scheme uses a prefix without a bound namespace. Complete
InValidXMLBase A model is invalid if xml:base is not valid Complete
InValidXMLBaseRelative A model is invalid if the xml:base is not absolute Complete
MultipleRefToAnElement It is valid for an element in a document to be targeted by multiple different references from other documents Complete
NullRefElement It is valid for a reference element to be null Complete
RefToNonRootElement It is valid for a reference in a document to target a non-root element in some other document. Complete
RefToRootElement It is valid for a reference in a document to target the root element in some other document. Complete
ValidBareNameAbsURI This SML-IF demonstrates the use of bare names in sml:uri references. Complete
ValidBareNameMultipleSchemes An SML reference in this SML-IF document contains 2 references, one uses bare name and one uses smlxpath1. These two references resolve to the same element. It is a valid document. Complete
ValidBareNameSameDocRef This SML-IF contains an SML URI reference that only contains the fragment component. The fragment component is a bare name. This URI reference will be dereferenced to an element in the same document. Complete
ValidRefTwoSchemesNilSpecified A model is valid if it contains a nullified reference with two schemes, one resolving to an element and another unresolved. Complete
ValidMissingBaseURIAttr2 It is valid for a model to contain a reference with only a fragment. In which case, the reference points to a target element in the same document. Complete
ValidRefNilrefSpecified1 A model is valid if it contains a none reference element (i.e. sml:ref is not specified) with multiple schemes resolving to two different elements Complete
ValidRefNilrefSpecified1 A model is valid if it contains a nullified reference with multiple schemes resolving to two different elements Complete
ValidMissingBaseURIAttr1 A model is valid if there are not references and the base URI is missing Complete
ValidRefTwoSchemes A model is valid if a reference contains two schemes, both resolving to the same element Complete
ValidNilRefDefinition A model is valid if sml:nilref is used in conjunction with sml:ref="true" Complete
ValidNilRefPSVI A model is valid if sml:nilref is used in conjunction with sml:ref="true", even if the sml:nilref value is defaulted from the schema Complete
ValidSchemeNamespaceInherited A model is valid when a reference using the smlxpath1 scheme uses a prefix declared in a containing element Complete
SingleRef The deref() function of a nullified reference should not return a target even if the ref has a valid sml:uri child element. Complete
ValidRefOneSchemeResolvesOtherUnknown A model is valid if a reference contains two schemes, one resolving to an element and the other being unknown. Complete
ValidXmlBase A valid xml:base should not result in an error. Complete
ValidXmlBaseOnDocumentElement A valid xml:base specified on a 'document' element should not result in an error. Incomplete
ValidXmlBaseOnInstance A valid xml:base on an instance document should not result in an error. Incomplete
ValidXmlBaseWinsOverBaseURI When both a baseURI and xml:base are specified, xml:base should be used. Complete

Rule Tests

Tests that ensure that Schematron rules and rule bindings are correctly handled

Test Name Description Status
InValidSchematronRule A model with a Schematron rule defined for an element is invalid if at least one instances of the element does not satisfy the rule. Complete
InValidSchematronRuleEnglish A model with a Schematron rule defined for an element is invalid if at least one instances of the element does not satisfy the rule. Error message will be taken from the English resource bundle. Complete
InValidSchematronRuleGerman A model with a Schematron rule defined for an element is invalid if at least one instances of the element does not satisfy the rule. Error message will be taken from the German resource bundle. Complete
InValidSchematronRuleMissingBundle A model with a Schematron rule defined for an element is invalid if at least one instances of the element does not satisfy the rule. locid indicates the locale of the error message to be French, but since French resource bundle doesn't exist, we expect the error message to be taken from the English resource bundle (the default locale). Complete
InValidSchematronRuleMissingBundlePackage A model with a Schematron rule defined for an element is invalid if at least one instances of the element does not satisfy the rule. locid indicates the locale of the error message to be French, but since French resource bundle doesn't exist, we expect the error message to be taken from the English resource bundle (the default locale). Complete
InValidSchematronRuleMissingKey A model with a Schematron rule defined for an element is invalid if at least one instances of the element does not satisfy the rule. locid is specified in a schematron to get a message from the English resource bundle. However, since the key "abc" does not exist in the resource bundle, the text in the schematron is used. Complete
InValidRuleBinding-MultipleRulesSameDocument-BothFail Two rules are bound to the same document - both fail. Complete
InValidRuleBinding-MultipleRulesSameDocument Two rules are bound to the same document. One passes, one fails. Complete
InValidRuleBinding A model with a Schematron rule that is bound to some instance documents is invalid if the rule is not satisfied by some bound documents. Complete
InValidRuleBindingWithBaseURI A model with a Schematron rule that is bound to some instance documents is invalid if the rule is not satisfied by some bound documents. This example binds an instance document with a rule binding using the base URI. Complete
InValidRuleBindingWithPrefix A model with a Schematron rule that is bound to some instance documents is invalid if the rule is not satisfied by some bound documents. This example binds an instance document based on the prefix of document aliases Complete
InValidRuleType A model with a Schematron rule defined for a type CT is invalid if at least one instance element of CT type doesn't satisfy the rule. Complete
InValidRuleTypeExtension A model with a Schematron rule defined for a type CT is invalid if at least one instance element of CT type or a type derived from CT ( derivation by extension ) doesn't satisfy the rule. Complete
InValidRuleTypeRestriction A model with a Schematron rule defined for a type CT is invalid if at least one instance element of CT type or a type derived from CT ( derivation by restriction ) doesn't satisfy the rule. Complete
ValidSchematronRule A model with a Schematron rule defined for an element is valid if all instances of the element satisfy the rule. Complete
ValidXMLSchema Basic XML Schema file, no SML extensions used. Complete
ValidRuleBinding A model with a Schematron rule that is bound to some instance documents is valid if the rule is satisfied by all bound documents. Complete

Schema Binding Tests

Tests the optional schema binding feature of SML.

Test Name Description Status

Target Element Tests

Tests that ensure correct implementation of targetElement

Test Name Description Status
InvalidTargetElement If targetElement='GTE' for a global element declaration E, then a model is invalid if the target of some instance of E in the model is not an instance of GTE. Complete
InValidDerivationByRestriction If the element declaration ED is contained (directly, indirectly, or implicitly) in a content model of a complex type D, who is a restriction of another complex type B and B contains an element declaration EB with the same name as ED, then{target element} of ED is the same as that of EB. In the example below, the EnrolledCourse element contained by the GraduateStudentType should have the same {targetElement} as the EnrolledCourse element contained by the StudentType. Complete
InValidSameNameElements If two element declarations E1 and E2 have the same {namespace name} and {name} and they are both contained (directly, indirectly, or implicitly) in a content model of a complex type, then E1 and E2 have the same {target required}, {target element}, and {target type}. In the example below, the two EnrolledCourse elements contained by the StudentType through the graduateGroup and basicGroup should have the same {targetElement}. Complete
ValidateTargetElementExists2 This test verifies that the value of the sml:targetElement is a global element. Returns an error if the value does not match any element in the corresponding namespace. The test verifies that the error is displayed even when no model instances are defined for this IF document (ie the validation runs against the xsd file containing the sml:targetElement, regardless of the instances being defined in that model) Complete
InvalidTargetElementWithSubstitutionGroup Let targetElement='GTE' be specified for a GED E. Let SubE be another GED in the substitution group whose head element is E for which the targetElement attribute is not specified. Then a model is invalid if an instance of SubE targets an element that is not an instance of GTE or an instance of some GED in the substitution group hierarchy whose head is GTE. Complete
ValidTargetElement If targetElement='GTE' for a global element declaration E, then a model is valid if the target of each instances of E in the model is an instance of GTE. Complete
ValidDerivationByRestriction If the element declaration ED is contained (directly, indirectly, or implicitly) in a content model of a complex type D, who is a restriction of another complex type B and B contains an element declaration EB with the same name as ED, then{target element} of ED is the same as that of EB. In the example below, the EnrolledCourse element contained by the GraduateStudentType has the same {targetElement} as the EnrolledCourse element contained by the StudentType. Complete
ValidSameNameElements If two element declarations E1 and E2 have the same {namespace name} and {name} and they are both contained (directly, indirectly, or implicitly) in a content model of a complex type, then E1 and E2 have the same {target required}, {target element}, and {target type}. In the example below, the two EnrolledCourse elements contained by the StudentType through the basicGroup and graduateGroup have the same {targetElement}. Complete
ValidTargetElementWithSubstitutionGroup If targetElement='GTE' for a global element declaration E, then a model is valid if the target of each instances of E in the model is an instance of GTE, or an instance of some global element declaration in the substitution group hierarchy whose head is GTE Complete

Target Required Tests

Tests that ensure correct validation of sml:targetRequired attribute

Test Name Description Status
InvalidTargetRequired If targetElement=GTE for a global element declaration E, and targetRequired=true, an instance of the SML reference cannot contain an unresolved reference which does not target any element in the model. Complete
InvalidTargetRequiredMissingReference If targetElement=GTE for a global element declaration E, and targetRequired=true, an instance of the SML reference must exist. Complete
InvalidTargetRequiredNullReference If targetElement=GTE for a global element declaration E, and targetRequired=true, an instance of the SML reference cannot be null. Complete
InValidSameNameElements If two element declarations E1 and E2 have the same {namespace name} and {name} and they are both contained (directly, indirectly, or implicitly) in a content model of a complex type, then E1 and E2 have the same {target required}, {target element}, and {target type}. In the example below, the two EnrolledCourse elements contained by the StudentType through the graduateGroup and basicGroup should have the same {target required}. Complete
ValidTargetRequired Tests for correct usage of targetRequired. Complete
ValidTargetRequiredFalse If targetElement=GTE for a global element declaration E, then a model is valid if the target of each instances of E in the model is an instance of GTE. targetRequired=false. Complete
ValidTargetRequiredSameNameElements If two element declarations E1 and E2 have the same {namespace name} and {name} and they are both contained (directly, indirectly, or implicitly) in a content model of a complex type, then E1 and E2 have the same {target required}, {target element}, and {target type}. In the example below, the two EnrolledCourse elements contained by the StudentType through the basicGroup and graduateGroup have the same {target required}. Complete
ValidTargetRequiredWithTargetType If targetType="T" for a global element declaration E, then a model is valid if the type of the target of each instances of E in the model is T or a derived type of T. Includes targetRequired=true. Complete
ValidTargetRequiredFalseWithTargetType If targetType="T" for a global element declaration E, then a model is valid if the type of the target of each instances of E in the model is T or a derived type of T. Includes targetRequired=false. Complete

Target Type Tests

Tests that ensure correct validation of targetType

Test Name Description Status
InvalidTargetType If targetType='T' for a global element declaration E, then a model is invalid if the target of some instance of E in the model is not an instance of T Complete
InValidDerivationByRestriction If the element declaration ED is contained (directly, indirectly, or implicitly) in a content model of a complex type D, who is a restriction of another complex type B and B contains an element declaration EB with the same name as ED, then {target type} of ED is the same as that of EB. In the example below, the EnrolledCourse element contained by the GraduateStudentType should have the same {targetType} as the EnrolledCourse element contained by the StudentType. Complete
InValidSameNameElements If two element declarations E1 and E2 have the same {namespace name} and {name} and they are both contained (directly, indirectly, or implicitly) in a content model of a complex type, then E1 and E2 have the same {target required}, {target element}, and {target type}. In the example below, the two EnrolledCourse elements contained by the StudentType through the graduateGroup and basicGroup should have the same {target type}. Complete
ValidateTargetTypeExists1 This test verifies that the value of the sml:targetType resolves to a global type definition. Returns an error if the value does not match any type in the corresponding namespace. The test verifies that the error is displayed even when no model instances are defined for this IF document (ie the validation runs against the xsd file containing the sml:targetType, regardless of the instances being defined in that model) Complete
InValidTargetTypeWithSubstitutionGroup Let targetType='T' be specified for a GED E. Let SubE be another GED in the substitution group whose head element is E for which the targetType attribute is not specified. Then a model is invalid if an instance of SubE targets an element that is not an instance of T or an instance of some derived type of T. Complete
ValidTargetType If targetType='T' for a global element declaration E, then a model is valid if the target of each instances of E in the model is an instance of T or a derived type of T Complete
ValidDerivationByRestriction If the element declaration ED is contained (directly, indirectly, or implicitly) in a content model of a complex type D, who is a restriction of another complex type B and B contains an element declaration EB with the same name as ED, then {target type} of ED is the same as that of EB. In the example below, the EnrolledCourse element contained by the GraduateStudentType has the same {targetType} as the EnrolledCourse element contained by the StudentType. Complete
ValidSameNameElements If two element declarations E1 and E2 have the same {namespace name} and {name} and they are both contained (directly, indirectly, or implicitly) in a content model of a complex type, then E1 and E2 have the same {target required}, {target element}, and {target type}. In the example below, the two EnrolledCourse elements contained by the StudentType through the graduateGroup and basicGroup have the same {target type}. Complete
ValidTargetTypeWithSubstitutionGroup Let targetType='T' be specified for a GED E. Let SubE be another GED in the substitution group whose head element is E for which the targetType attribute is not specified. Then a model is valid if all instances of SubE target elements whose type is T. Complete

Back to the top