From: <exo...@us...> - 2003-08-08 11:22:55
|
Update of /cvsroot/ccnet/ccnet/project/web/xsl In directory sc8-pr-cvs1:/tmp/cvs-serv3676/project/web/xsl Modified Files: distributables.xsl timing.xsl Added Files: tests.xsl Log Message: added NetSendPublisher, and test results web page --- NEW FILE: tests.xsl --- <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/TR/html4/strict.dtd" > <xsl:output method="html"/> <xsl:template match="/"> <div id="testdata"> <script> function ToggleVisible(blockId) { var block = document.all.item(blockId); if (block.style.display=='none') { block.style.display='block'; } else { block.style.display='none'; } } </script> <table cellpadding="2" cellspacing="0" border="0" width="98%"> <tr> <td class="unittests-sectionheader" colspan="3">  Acceptance Tests: </td> </tr> <tr> <th>Test Fixture</th> <th>Status</th> <th>Progress</th> </tr> <xsl:apply-templates select="//test-suite[results/test-case/@success='False']"> <xsl:sort select="@name" order="ascending" data-type="text" /> </xsl:apply-templates> <xsl:apply-templates select="//test-suite[results/test-case/@executed='False']"> <xsl:sort select="@name" order="ascending" data-type="text" /> </xsl:apply-templates> <xsl:apply-templates select="//test-suite[results/test-case]" mode="success"> <xsl:sort select="@name" order="ascending" data-type="text" /> </xsl:apply-templates> </table> </div> </xsl:template> <xsl:template match="//test-suite" mode="success"> <xsl:if test="count(results/test-case[@success='False']) + count(results/test-case[@executed='False']) = 0"> <xsl:apply-templates select="."/> </xsl:if> </xsl:template> <xsl:template match="//test-suite"> <xsl:variable name="passedtests.list" select="results/test-case[@success='True']"/> <xsl:variable name="ignoredtests.list" select="results/test-case[@executed='False']"/> <xsl:variable name="failedtests.list" select="results/test-case[@success='False']"/> <xsl:variable name="tests.count" select="count(results/test-case)"/> <xsl:variable name="passedtests.count" select="count($passedtests.list)"/> <xsl:variable name="ignoredtests.count" select="count($ignoredtests.list)"/> <xsl:variable name="failedtests.count" select="count($failedtests.list)"/> <xsl:variable name="storyId" select="generate-id()"/> <tr> <td valign="top"> <xsl:attribute name="onClick">javascript:ToggleVisible('<xsl:value-of select="$storyId"/>');</xsl:attribute> <a> <xsl:attribute name="name"><xsl:value-of select="@name" /></xsl:attribute> <xsl:value-of select="@name" /> </a> </td> <td width="100%"> <table border="1" cellspacing="1" width="100%"> <tr> <xsl:if test="$passedtests.count > 0"> <xsl:variable name="passedtests.countpercent" select="($passedtests.count * 100) div $tests.count"/> <td bgcolor="green"> <xsl:attribute name="width"><xsl:value-of select="$passedtests.countpercent"/>%</xsl:attribute>   </td> </xsl:if> <xsl:if test="$ignoredtests.count > 0"> <xsl:variable name="ignoredtests.countpercent" select="($ignoredtests.count * 100) div $tests.count"/> <td bgcolor="yellow"> <xsl:attribute name="width"><xsl:value-of select="$ignoredtests.countpercent"/>%</xsl:attribute>   </td> </xsl:if> <xsl:if test="$failedtests.count > 0"> <xsl:variable name="failedtests.countpercent" select="($failedtests.count * 100) div $tests.count"/> <td bgcolor="red"> <xsl:attribute name="width"><xsl:value-of select="$failedtests.countpercent"/>%</xsl:attribute>   </td> </xsl:if> </tr> </table> <xsl:if test="$failedtests.count > 0 or $ignoredtests.count > 0"> <div style="display:none"> <xsl:attribute name="id"><xsl:value-of select="$storyId"/></xsl:attribute> <table border="2" cell-padding="6" cell-spacing="0" width="100%"> <xsl:apply-templates select="$failedtests.list"/> <xsl:apply-templates select="$ignoredtests.list"/> </table> </div> </xsl:if> </td> <td valign="top"> (<xsl:value-of select="$passedtests.count"/>/<xsl:value-of select="$tests.count"/>) </td> </tr> </xsl:template> <xsl:template match="test-case[@success='False']"> <tr> <xsl:if test="position() mod 2 = 0"> <xsl:attribute name="class">unittests-oddrow</xsl:attribute> </xsl:if> <td bgcolor="red"><b>Failed</b></td> <td> <xsl:call-template name="getTestName"> <xsl:with-param name="name" select="@name"/> </xsl:call-template> </td> <td> <xsl:value-of select="substring-after(failure/message, '-')"/> </td> </tr> </xsl:template> <xsl:template match="test-case[@executed='False']"> <tr> <xsl:if test="position() mod 2 = 0"> <xsl:attribute name="class">unittests-oddrow</xsl:attribute> </xsl:if> <td bgcolor="yellow"><b>Ignored</b></td> <td> <xsl:call-template name="getTestName"> <xsl:with-param name="name" select="@name"/> </xsl:call-template> </td> <td> <xsl:value-of select="substring-after(reason/message, '-')"/> </td> </tr> </xsl:template> <xsl:template name="getTestName"> <xsl:param name="name"/> <xsl:choose> <xsl:when test="contains($name, '.')"> <xsl:call-template name="getTestName"> <xsl:with-param name="name" select="substring-after($name, '.')"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$name"/> </xsl:otherwise> </xsl:choose> </xsl:template> </xsl:stylesheet> Index: distributables.xsl =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/web/xsl/distributables.xsl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** distributables.xsl 23 Apr 2003 08:53:32 -0000 1.1 --- distributables.xsl 8 Aug 2003 11:22:52 -0000 1.2 *************** *** 1,40 **** <?xml version="1.0"?> - <!--******************************************************************************** - * CruiseControl, a Continuous Integration Toolkit - * Copyright (c) 2001, ThoughtWorks, Inc. - * 651 W Washington Ave. Suite 500 - * Chicago, IL 60661 USA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * + Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * + Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * - * + Neither the name of ThoughtWorks, Inc., CruiseControl, nor the - * names of its contributors may be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ********************************************************************************--> - <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" --- 1,3 ---- Index: timing.xsl =================================================================== RCS file: /cvsroot/ccnet/ccnet/project/web/xsl/timing.xsl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** timing.xsl 23 Apr 2003 08:53:32 -0000 1.1 --- timing.xsl 8 Aug 2003 11:22:52 -0000 1.2 *************** *** 1,10 **** <?xml version="1.0"?> ! <xsl:stylesheet ! xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" ! xmlns:lxslt="http://xml.apache.org/xslt"> <xsl:output method="html"/> <xsl:variable name="testcase.list" select="//test-case"/> <xsl:template match="/"> <table cellpadding="2" cellspacing="0" border="0" width="98%"> --- 1,9 ---- <?xml version="1.0"?> ! <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:lxslt="http://xml.apache.org/xslt"> <xsl:output method="html"/> <xsl:variable name="testcase.list" select="//test-case"/> + <xsl:template match="/"> <table cellpadding="2" cellspacing="0" border="0" width="98%"> *************** *** 17,22 **** </tr> ! <xsl:apply-templates select="$testcase.list"/> ! <tr/> <tr><td colspan="2"> </td></tr> </table> --- 16,23 ---- </tr> ! <xsl:apply-templates select="$testcase.list"> ! <xsl:sort select="@time" order="descending" data-type="number" /> ! </xsl:apply-templates> ! <tr><td colspan="2"> </td></tr> </table> *************** *** 24,33 **** <xsl:template match="test-case"> - <tr> <xsl:if test="position() mod 2 = 0"> <xsl:attribute name="class">unittests-oddrow</xsl:attribute> </xsl:if> - <td class="unittests-data"> <xsl:value-of select="./@name"/> --- 25,32 ---- *************** *** 44,48 **** </td> </tr> - </xsl:template> --- 43,46 ---- |