2002/ws/desc/test-suite/results combine.xslt,NONE,1.1 canonicalize-id-wsdlcm.xslt,NONE,1.1 implementations.xml,NONE,1.1 results.xsl,NONE,1.1 canonicalize-wsdlcm.xslt,NONE,1.1 compare-wsdlcm.xslt,NONE,1.1

Update of /sources/public/2002/ws/desc/test-suite/results
In directory hutz:/tmp/cvs-serv10914/test-suite/results

Added Files:
	combine.xslt canonicalize-id-wsdlcm.xslt implementations.xml 
	results.xsl canonicalize-wsdlcm.xslt compare-wsdlcm.xslt 
Log Message:
Initial check-in of results, canonicalization stylesheets, and results rollup.

--- NEW FILE: compare-wsdlcm.xslt ---
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
	<!--
		Stylesheet to compare two WSDL Component Model serialization format (wsdlxml) documents

		Created: March 27, 2006, Jonathan Marsh, Microsoft.  jmarsh@microsoft.com
	-->
	<xsl:param name="path" />
	<xsl:param name="aspirant" />
	<xsl:param name="archetype" />
	<xsl:template match="/">
		<xsl:processing-instruction name="xml-stylesheet">type="text/xsl" href="../../results.xsl"</xsl:processing-instruction>
		<comparing aspirant="{substring-after(substring-after($aspirant,'/'),'/')}" archetype="../../{$archetype}" source="../../../documents/good/{substring-before(substring-after($aspirant,'/'),'.canonical.wsdlcm')}.wsdl">
			<xsl:call-template name="compare">
				<xsl:with-param name="asp" select="document(concat($path,$aspirant))/*"/>
				<xsl:with-param name="arc" select="document(concat($path,$archetype))/*"/>
			</xsl:call-template>
		</comparing>
	</xsl:template>
	<xsl:template name="compare">
		<xsl:param name="asp"/>
		<xsl:param name="arc"/>
		<xsl:if test="count($asp) + count($arc) != 0">
			<xsl:choose>
				<xsl:when test="count($asp) = 0">
					<failure>
						<xsl:attribute name="xpath"><xsl:apply-templates mode="xpath" select="$arc"/></xsl:attribute>
						<p>Missing element "<xsl:value-of select="local-name($arc)"/>" in namespace "<xsl:value-of select="namespace-uri($arc)"/>".</p>
					</failure>
				</xsl:when>
				<xsl:when test="local-name($asp) != local-name($arc) or namespace-uri($asp) != namespace-uri($arc)">
					<failure>
						<xsl:attribute name="xpath"><xsl:apply-templates mode="xpath" select="$asp"/></xsl:attribute>
						<p>Expected element "<xsl:value-of select="local-name($arc)"/>" in namespace "<xsl:value-of select="namespace-uri($arc)"/>", found element "<xsl:value-of select="local-name($asp)"/>" in namespace "<xsl:value-of select="namespace-uri($asp)"/>".</p>
					</failure>
				</xsl:when>
				<xsl:otherwise>
					<!-- compare attributes -->
					<xsl:if test="count($asp/@*) != count($arc/@*)">
						<failure>
							<xsl:attribute name="xpath"><xsl:apply-templates mode="xpath" select="$asp"/></xsl:attribute>
							<p>Different number of attributes (Expected <xsl:value-of select="count($arc/@*)"/> found <xsl:value-of select="count($asp/@*)"/>).</p>
						</failure>
					</xsl:if>
					<xsl:for-each select="$arc/@*">
						<xsl:variable name="asp-att" select="$asp/@*[local-name(.)=local-name(current()) and namespace-uri(.)=namespace-uri(current())]"/>
						<xsl:if test="not($asp-att)">
							<failure>
								<xsl:attribute name="xpath"><xsl:apply-templates mode="xpath" select="$asp"/></xsl:attribute>
								<p>Attribute "<xsl:value-of select="name(.)"/>" not found.</p>
							</failure>
						</xsl:if>
						<xsl:if test=". != $asp-att">
							<failure>
								<xsl:attribute name="xpath"><xsl:apply-templates mode="xpath" select="$asp"/></xsl:attribute>
								<p>Attribute "<xsl:value-of select="name(.)"/>" value mismatch (found "<xsl:value-of select="$asp-att"/>", expected "<xsl:value-of select="."/>").</p>
							</failure>
						</xsl:if>
					</xsl:for-each>
					<!-- compare values -->
					<xsl:if test="text() and not(*)">
						<xsl:if test="$asp/text() != $arc/text()">
							<failure>
								<xsl:attribute name="xpath"><xsl:apply-templates mode="xpath" select="$asp"/></xsl:attribute>
								<p>Element "<xsl:value-of select="name(.)"/>" value mismatch (found "<xsl:value-of select="$asp/text()"/>", expected "<xsl:value-of select="$arc/text()"/>").</p>
							</failure>
						</xsl:if>
					</xsl:if>
					<!-- compare children -->
					<xsl:if test="count($asp/*) != count($arc/*)">
						<failure>
							<xsl:attribute name="xpath"><xsl:apply-templates mode="xpath" select="$asp"/></xsl:attribute>
							<p>Different number of children (Expected <xsl:value-of select="count($arc/*)"/> found <xsl:value-of select="count($asp/*)"/>).</p>
						</failure>
					</xsl:if>
					<xsl:for-each select="$arc/*">
						<xsl:variable name="p" select="position()"/>
						<xsl:call-template name="compare">
							<xsl:with-param name="asp" select="$asp/*[position()=$p]"/>
							<xsl:with-param name="arc" select="."/>
						</xsl:call-template>
					</xsl:for-each>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
	</xsl:template>
	<xsl:template match="*" mode="xpath">
		<xsl:apply-templates select="parent::*" mode="xpath"/>/<xsl:value-of select="name(.)"/>
	</xsl:template>
	<xsl:template match="@*" mode="xpath">
		<xsl:apply-templates select="parent::*" mode="xpath"/>/@<xsl:value-of select="name(.)"/>
	</xsl:template>
</xsl:stylesheet>

--- NEW FILE: results.xsl ---
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
	
	<xsl:variable name="implementations" select="document('../desc/test-suite/results/implementations.xml')"/>
	<xsl:variable name="test-suite" select="document('../desc/test-suite/test-suite.xml')"/>

	<xsl:template match="comparing">
		<html>
			<head>
				<title>Test Pass Results</title>
			</head>
			<body>
				<h3>Test Pass Results</h3>
				<p>Comparing <a href="{@aspirant}"><xsl:value-of select="@aspirant"/></a> with <a href="{@archetype}"><xsl:value-of select="@archetype"/></a> for testcase <a href="{@source}"><xsl:value-of select="@source"/></a></p>
				<xsl:for-each select="failure">
					<dl>
						<dt>xpath: <xsl:value-of select="@xpath"/></dt>
						<dd><xsl:copy-of select="node()"/></dd>
					</dl>
				</xsl:for-each>
			</body>
		</html>
	</xsl:template>
</xsl:stylesheet>


--- NEW FILE: canonicalize-wsdlcm.xslt ---
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:wsdlcm="http://www.w3.org/2002/ws/desc/wsdl/component">
	<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
	
	<!--
		Stylesheet to canonicalize the WSDL Component Model serialization format (wsdlxml)
			- canonicalizes xml:id and @ref attributes
		Created: March 27, 2006, Jonathan Marsh, Microsoft.  jmarsh@microsoft.com
	-->

	<!-- identity transform -->
	<xsl:template match="*">
		<xsl:copy>
			<xsl:apply-templates select="@*"/>
			<xsl:apply-templates/>
		</xsl:copy>
	</xsl:template>
	<xsl:template match="*[not(node())]">
		<!-- prevent unwanted whitespace from distracting human readers ;-) -->
		<xsl:copy>
			<xsl:apply-templates select="@*"/>
		</xsl:copy>
	</xsl:template>
	<xsl:template match="@*">
		<xsl:copy-of select="."/>
	</xsl:template>
	<xsl:template match="comment()">
		<xsl:copy-of select="."/>
	</xsl:template>
	
	<!-- rules to order children of particular WSDL elements -->
	
	<!--
	1. Description.{interfaces} - sort by Interface.{name} 
	2. Description.{bindings} - sort by Binding.{name} 
	3. Description.{services} - sort by Service.{name} 
	4. Description.{elementDeclarations} - sort by ElementDeclaration.{name} 
	5. Description.{typeDefinitions} - sort by TypeDefinition.{name} 
	6. Interface.{extendedInterfaces} - sort by Interface.{name} 
	7. Interface.{interfaceFaults} - sort by InterfaceFault.{name} 
	8. Interface.{operations} - sort by InterfaceOperation.{name} 
	15. Service.{endpoints} - sort by Endpoint.{name} 
	-->
	<xsl:template match="wsdlcm:interfaces | wsdlcm:bindings | wsdlcm:services | wsdlcm:elementDeclarations | wsdlcm:typeDefinitions | wsdlcm:extendedInterfaces | wsdlcm:interfaceFaults | wsdlcm:operations | wsdlcm:endpoints">
		<xsl:copy>
			<xsl:apply-templates select="@*"/>
			<xsl:apply-templates select="*">
				<xsl:sort select="wsdlcm:name/wsdlcm:namespaceName"/>
				<xsl:sort select="wsdlcm:name/wsdlcm:localName"/>
			</xsl:apply-templates>
		</xsl:copy>
	</xsl:template>

	<!--
	9. InterfaceOperation.{interfaceMessageReferences} - sort by InterfaceMessageReference.{message label} 
	10. InterfaceOperation.{interfaceFaultReferences} - sort by InterfaceFaultReference.{interface fault}.{name}, then by InterfaceFaultReference.{message label} 
	11. Binding.{bindingFaults} - sorty by BindingFault.{interfaceFault}.{name} 
	12. Binding.{operations} - sort by BindingOperation.{interfaceOperation}.{name} 
	13. BindingOperation.{bindingMessageReferences} - sort by BindingMessageReference.{interface message reference}.{name} 
	14. BindingOperation.{bindingFaultReferences} - sort by BindingFaultReference.{interface fault reference}.{interface fault}.{name}, then by BindingFaultReference.{interface fault reference}.{message label} 
	16. *.{features} - sort by Feature.{ref} 
	17. *.{properties} - sort by Property.{ref} 
	
	-->
</xsl:stylesheet>

--- NEW FILE: canonicalize-id-wsdlcm.xslt ---
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
	
	<!--
		Stylesheet to canonicalize the WSDL Component Model serialization format (wsdlxml)
			- canonicalizes xml:id and @ref attributes
		Created: March 27, 2006, Jonathan Marsh, Microsoft.  jmarsh@microsoft.com
	-->

	<!-- identity transform -->
	<xsl:template match="*">
		<xsl:copy>
			<xsl:apply-templates select="@*"/>
			<xsl:apply-templates/>
		</xsl:copy>
	</xsl:template>
	<xsl:template match="*[not(node())]">
		<!-- prevent unwanted whitespace from distracting human readers ;-) -->
		<xsl:copy>
			<xsl:apply-templates select="@*"/>
		</xsl:copy>
	</xsl:template>
	<xsl:template match="@*">
		<xsl:copy-of select="."/>
	</xsl:template>
	<xsl:template match="comment()">
		<xsl:copy-of select="."/>
	</xsl:template>
	
	<!-- rules to canonicalize xml:id attribute values and references to them -->
	<xsl:template match="@xml:id">
		<xsl:attribute name="xml:id">c<xsl:value-of select="count(ancestor::*[@xml:id] | preceding::*[@xml:id])"/></xsl:attribute>
	</xsl:template>
	<xsl:template match="@ref">
		<xsl:for-each select="//*/@xml:id[.=current()]">
			<xsl:attribute name="ref">c<xsl:value-of select="count(ancestor::*[@xml:id] | preceding::*[@xml:id])"/></xsl:attribute>
		</xsl:for-each>
	</xsl:template>
	
</xsl:stylesheet>

--- NEW FILE: implementations.xml ---
<?xml-stylesheet type="text/xsl" href="combine.xslt"?>
<implementations>
	<implementation name="Woden" results-folder="Woden"/>
	<implementation name="WSDL XSLT" results-folder="wsdl-xslt"/>
	<implementation name="Canon" results-folder="Canon"/>
</implementations>
--- NEW FILE: combine.xslt ---
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="combine.xslt"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
	
	<xsl:variable name="implementations" select="."/>
	<xsl:variable name="test-suite" select="document('../test-suite.xml')"/>

	<xsl:template match="/">
		<html>
			<head>
				<title>Results</title>
				<style type="text/css">
					body {font-family:sans-serif}
					td {border:1px solid #DDDDDD}
					.passed   {background-color:green}
					.failed   {background-color:orange}
					.disaster {background-color:red}
				</style>
			</head>
			<body>
				<h3>Results</h3>
				<table>
					<tr>
						<td>Testcase</td>
						<td>WSDL</td>
						<xsl:for-each select="$implementations//implementation">
							<td><xsl:value-of select="@name"/> failures</td>
						</xsl:for-each>
					</tr>
					<xsl:for-each select="$test-suite/test-suite/test-case[contains(@id, 'good')]/file">
						<xsl:variable name="testcase" select="."/>
						<tr>
							<td><xsl:value-of select="../@id"/></td>
							<td><xsl:value-of select="."/></td>
							<xsl:for-each select="$implementations//implementation">
								<xsl:variable name="failures" select="count(document(concat(@results-folder,'/',$testcase/../folder,'/',substring-before($testcase,'.wsdl'),'-results.xml'))/comparing/failure)"/>
								<td>
									<xsl:choose>
										<xsl:when test="$failures = 0"><xsl:attribute name="class">passed</xsl:attribute></xsl:when>
										<xsl:when test="$failures &lt; 6"><xsl:attribute name="class">failed</xsl:attribute></xsl:when>
										<xsl:otherwise><xsl:attribute name="class">disaster</xsl:attribute></xsl:otherwise>
									</xsl:choose>
									<xsl:value-of select="$failures"/>
									[<a href="{@results-folder}/{$testcase/../folder}/{substring-before($testcase,'.wsdl')}-results.xml">log</a>]
								</td>
							</xsl:for-each>
						</tr>
					</xsl:for-each>
				</table>
			</body>
		</html>
	</xsl:template>
</xsl:stylesheet>

Received on Thursday, 4 May 2006 03:19:57 UTC