When nested inside a case or attribute element, allows that test to reference another test.
Each ref element identifies a test (via its id
attribute) that
is included into this test. That is, the referenced test case is activated when
this test case is the current test. Test case referencing is not recursive.
Reference multiple tests using nested ref elements.
<field xmlns:test="http://www.powerware.com/nz/XMLSchemaUnitTest"> <tree> <leaf colour="green"> <test:attribute id="yellow" name="colour" value="yellow" /> </leaf> <test:case id="multiple" test="with" result="pass" desc="tree can have some yellow and some green leaves"> <leaf colour="yellow"> <test:attribute name="colour" value="red" result="pass" desc="Leaves can turn red once a leaf has fallen"> <test:ref>yellow</test:ref> <test:ref>fallen</test:ref> </test:attribute> </leaf> </test:case> </tree> <test:case id="fallen" test="with" result="pass" desc="Leaves may fall in autumn when all leaves are yellow"> <test:ref>yellow</test:ref> <test:ref>multiple</test:ref> <leaf colour="yellow"/> </test:case> </field>
This creates three test cases:
<field xmlns:test="http://www.powerware.com/nz/XMLSchemaUnitTest"> <tree> <leaf colour="green"/> <leaf colour="yellow"/> </tree> </field>
<field xmlns:test="http://www.powerware.com/nz/XMLSchemaUnitTest"> <tree> <leaf colour="yellow"/> <leaf colour="red"/> </tree> <leaf colour="yellow"/> </field>
<field xmlns:test="http://www.powerware.com/nz/XMLSchemaUnitTest"> <tree> <leaf colour="yellow"/> <leaf colour="yellow"/> </tree> <leaf colour="yellow"/> </field>