c6b896b4387a804258290fc3d63537db17a1e11bgary.williams<?xml version="1.0" encoding="UTF-8"?>
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams<!--
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams ! CDDL HEADER START
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams !
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams ! The contents of this file are subject to the terms of the
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams ! Common Development and Distribution License, Version 1.0 only
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams ! (the "License"). You may not use this file except in compliance
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams ! with the License.
3437829f938dbb44527d91fbbc5f430a1243c5a5JnRouvignac !
3437829f938dbb44527d91fbbc5f430a1243c5a5JnRouvignac ! You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams ! or http://forgerock.org/license/CDDLv1.0.html.
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams ! See the License for the specific language governing permissions
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams ! and limitations under the License.
3437829f938dbb44527d91fbbc5f430a1243c5a5JnRouvignac !
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams ! When distributing Covered Code, include this CDDL HEADER in each
3437829f938dbb44527d91fbbc5f430a1243c5a5JnRouvignac ! file and include the License file at legal-notices/CDDLv1_0.txt.
3437829f938dbb44527d91fbbc5f430a1243c5a5JnRouvignac ! If applicable, add the following below this CDDL HEADER, with the
3437829f938dbb44527d91fbbc5f430a1243c5a5JnRouvignac ! fields enclosed by brackets "[]" replaced with your own identifying
3437829f938dbb44527d91fbbc5f430a1243c5a5JnRouvignac ! information:
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams ! Portions Copyright [yyyy] [name of copyright owner]
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams !
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams ! CDDL HEADER END
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams !
ca5f476ebacf0684605124c0410d08604231adddcsovant ! Copyright 2011-2013 ForgeRock AS.
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams ! -->
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams<xsl:output method="xml" indent="yes" />
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams<xsl:template match="/">
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams<testsuites>
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams <xsl:variable name="ftpath" select="/qa/functional-tests"/>
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams <xsl:variable name="id" select="$ftpath/identification"/>
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams <xsl:variable name="results" select="$ftpath/results"/>
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams <xsl:variable name="testgroup" select="$results/testgroup"/>
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams <xsl:variable name="testsuite" select="$testgroup/testsuite"/>
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams <xsl:variable name="testcase" select="$testsuite/testcase"/>
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams <xsl:variable name="total-tests" select="count($testcase)"/>
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams <xsl:variable name="pass-tests" select="count($testcase[@result='pass'])"/>
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams <xsl:variable name="kfail-tests" select="count($testcase/issues)"/>
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams <xsl:variable name="inconc-tests" select="count($testcase[@result='unknown'])"/>
ca5f476ebacf0684605124c0410d08604231adddcsovant <xsl:variable name="fail-tests" select="count($testcase[@result='fail']) - $kfail-tests"/>
d94934450555a29e7cdebfc1b7ab60e8827e904bgary.williams <testsuite name="opendj.tests.functional"
ca5f476ebacf0684605124c0410d08604231adddcsovant time="0"
ca5f476ebacf0684605124c0410d08604231adddcsovant tests="{$total-tests}"
ca5f476ebacf0684605124c0410d08604231adddcsovant errors="{$inconc-tests}"
ca5f476ebacf0684605124c0410d08604231adddcsovant failures="{$fail-tests}"
ca5f476ebacf0684605124c0410d08604231adddcsovant skipped="{$kfail-tests}">
ca5f476ebacf0684605124c0410d08604231adddcsovant
d94934450555a29e7cdebfc1b7ab60e8827e904bgary.williams <xsl:for-each select="$testcase">
ca5f476ebacf0684605124c0410d08604231adddcsovant <xsl:variable name="issue">
ca5f476ebacf0684605124c0410d08604231adddcsovant <xsl:value-of select="issues/issue/@id"/>
ca5f476ebacf0684605124c0410d08604231adddcsovant </xsl:variable>
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams <xsl:variable name="message" select="'no message'"/>
ca5f476ebacf0684605124c0410d08604231adddcsovant <testcase classname="{ancestor::testgroup[1]/@name}.{ancestor::testsuite[1]/@shortname}"
ca5f476ebacf0684605124c0410d08604231adddcsovant name="{@shortname}"
ca5f476ebacf0684605124c0410d08604231adddcsovant time="{@duration}">
ca5f476ebacf0684605124c0410d08604231adddcsovant <xsl:if test="contains(@result, 'unknown')">
ca5f476ebacf0684605124c0410d08604231adddcsovant <error>
ca5f476ebacf0684605124c0410d08604231adddcsovant <xsl:value-of select="'log inconclusive'"/>
ca5f476ebacf0684605124c0410d08604231adddcsovant </error>
ca5f476ebacf0684605124c0410d08604231adddcsovant </xsl:if>
ca5f476ebacf0684605124c0410d08604231adddcsovant <xsl:if test="contains(@result, 'fail') and string-length($issue) = 0">
ca5f476ebacf0684605124c0410d08604231adddcsovant <failure>
ca5f476ebacf0684605124c0410d08604231adddcsovant <xsl:value-of select="'log fail'"/>
ca5f476ebacf0684605124c0410d08604231adddcsovant </failure>
ca5f476ebacf0684605124c0410d08604231adddcsovant </xsl:if>
ca5f476ebacf0684605124c0410d08604231adddcsovant <xsl:if test="contains(@result, 'fail') and string-length($issue) &gt; 0">
ca5f476ebacf0684605124c0410d08604231adddcsovant <skipped>
ca5f476ebacf0684605124c0410d08604231adddcsovant <xsl:value-of select="$issue"/>
ca5f476ebacf0684605124c0410d08604231adddcsovant </skipped>
ca5f476ebacf0684605124c0410d08604231adddcsovant </xsl:if>
ca5f476ebacf0684605124c0410d08604231adddcsovant </testcase>
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams </xsl:for-each>
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams </testsuite>
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams</testsuites>
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams</xsl:template>
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams</xsl:stylesheet>
c6b896b4387a804258290fc3d63537db17a1e11bgary.williams