blob: 2e8b9c7205abade4b3719303facf085758a0b556 [file] [log] [blame]
jeffliudb250412005-10-10 21:33:13 +00001<?xml version="1.0" encoding="ISO-8859-1"?>
2<xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
4
5 <xsl:template match="/">
6 <html>
jeffliu1521a212006-05-31 02:01:45 +00007 <script language="javascript">
8 function sort(col)
9 {
10 var table = document.getElementById("data");
11 for (var i = 2; i &lt; table.rows.length; i++)
12 {
13 for (var j = i - 1; j &gt; 0; j--)
14 {
15 var x = parseInt(table.rows[i].cells[col].childNodes[0].data);
16 var y = parseInt(table.rows[j].cells[col].childNodes[0].data);
17 if (x &lt; y)
18 {
jeffliu497c0752006-06-28 01:12:48 +000019 move(table, i, j + 1);
jeffliu1521a212006-05-31 02:01:45 +000020 break;
21 }
22 if (j == 1)
23 {
jeffliu497c0752006-06-28 01:12:48 +000024 move(table, i, 1);
jeffliu1521a212006-05-31 02:01:45 +000025 break;
26 }
27 }
28 }
29 }
jeffliu497c0752006-06-28 01:12:48 +000030 function move(table, src, target)
31 {
32 var a = document.createElement("a");
33 var td_name = document.createElement("td");
34 var td_tested = document.createElement("td");
35 var td_tested_per = document.createElement("td");
36 var td_not_tested = document.createElement("td");
37 var td_not_tested_per = document.createElement("td");
38
39 a.href = table.rows[src].cells[0].childNodes[0].href;
40 a.appendChild(document.createTextNode(table.rows[src].cells[0].childNodes[0].childNodes[0].data));
41 td_name.appendChild(a);
42 td_tested.appendChild(document.createTextNode(table.rows[src].cells[1].childNodes[0].data));
43 td_tested_per.appendChild(document.createTextNode(table.rows[src].cells[2].childNodes[0].data));
44 td_not_tested.appendChild(document.createTextNode(table.rows[src].cells[3].childNodes[0].data));
45 td_not_tested_per.appendChild(document.createTextNode(table.rows[src].cells[4].childNodes[0].data));
46
47 table.deleteRow(src);
48 var tr = table.insertRow(target);
49 tr.appendChild(td_name);
50 tr.appendChild(td_tested);
51 tr.appendChild(td_tested_per);
52 tr.appendChild(td_not_tested);
53 tr.appendChild(td_not_tested_per);
54 }
jeffliu1521a212006-05-31 02:01:45 +000055 </script>
jeffliudb250412005-10-10 21:33:13 +000056 <body>
jeffliu909bcf22006-06-28 02:17:18 +000057 <xsl:variable name="title" select="system-property('title')"/>
jeffliudb250412005-10-10 21:33:13 +000058 <table border="0" cellpadding="2" cellspacing="5" width="100%">
59 <tr>
60 <td align="left" width="60%">
jeffliu909bcf22006-06-28 02:17:18 +000061 <font style="font-size: x-large;; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold">
62 <xsl:choose>
63 <xsl:when test="string-length($title) &gt; 0">
64 <xsl:value-of select="$title"/>
65 </xsl:when>
66 <xsl:otherwise>
67 API Test Coverage Summary
68 </xsl:otherwise>
69 </xsl:choose>
70 </font>
jeffliudb250412005-10-10 21:33:13 +000071 </td>
72 <td width="40%">
73 <img src="Idea.jpg" align="middle" height="86" hspace="50" width="120"/>
74 </td>
75 </tr>
76 </table>
77 <table border="0" cellpadding="2" cellspacing="5" width="100%">
78 <tr>
jeffliu909bcf22006-06-28 02:17:18 +000079 <td ALIGN="LEFT" VALIGN="TOP" COLSPAN="2" BGCOLOR="#0080C0"><b><font color="#FFFFFF" face="Arial,Helvetica">
80 <xsl:choose>
81 <xsl:when test="string-length($title) &gt; 0">
82 <xsl:value-of select="$title"/>
83 </xsl:when>
84 <xsl:otherwise>
85 API test coverage summary
86 </xsl:otherwise>
87 </xsl:choose>
88 </font></b></td>
jeffliudb250412005-10-10 21:33:13 +000089 </tr>
90 </table>
91 <br/>
jeffliu1521a212006-05-31 02:01:45 +000092 <p>
93 Sort by:
94 <select name="sortby" onchange="javascript:sort(this.selectedIndex)">
95 <option value="1">Name</option>
96 <option value="2">Methods tested</option>
97 <option value="3">% tested</option>
98 <option value="4">Methods not tested</option>
99 <option value="5">% not tested</option>
100 </select>
101 </p>
102 <table id="data" border="1" width="80%">
jeffliudb250412005-10-10 21:33:13 +0000103 <tr>
jeffliu1521a212006-05-31 02:01:45 +0000104 <th width="50%">Name</th>
jeffliudb250412005-10-10 21:33:13 +0000105 <th><img src="OK.gif"/>Methods tested</th>
jeffliu1521a212006-05-31 02:01:45 +0000106 <th>&#160;%&#160;</th>
jeffliudb250412005-10-10 21:33:13 +0000107 <th><img src="FAIL.gif"/>Methods not tested</th>
jeffliu1521a212006-05-31 02:01:45 +0000108 <th>&#160;%&#160;</th>
jeffliudb250412005-10-10 21:33:13 +0000109 </tr>
110 <xsl:for-each select="root/api-info">
111 <xsl:sort select="@file"/>
112 <xsl:variable name="report" select="document(@file)"/>
jeffliu1521a212006-05-31 02:01:45 +0000113 <xsl:variable name="total" select="count($report/component-api/package-api/class-api/method-api)"/>
jeffliudb250412005-10-10 21:33:13 +0000114 <xsl:variable name="tested" select="count($report/component-api/package-api/class-api/method-api/test-coverage)"/>
jeffliu1521a212006-05-31 02:01:45 +0000115 <xsl:variable name="untested" select="$total - $tested"/>
jeffliu3c0dd152006-06-28 01:55:46 +0000116 <xsl:if test="system-property('includeAllTC') = 'true' or $untested &gt; 0">
jeffliudb250412005-10-10 21:33:13 +0000117 <tr>
118 <td><a href="{concat(substring(@file, 0, string-length(@file) - 11), 'api-tc.html')}"><xsl:value-of select="substring(@file, 0, string-length(@file) - 12)"/></a></td>
119 <td><xsl:value-of select="$tested"/></td>
jeffliu1521a212006-05-31 02:01:45 +0000120 <td><xsl:value-of select="round($tested div $total * 100)"/></td>
jeffliudb250412005-10-10 21:33:13 +0000121 <td><xsl:value-of select="$untested"/></td>
jeffliu1521a212006-05-31 02:01:45 +0000122 <td><xsl:value-of select="round($untested div $total * 100)"/></td>
jeffliudb250412005-10-10 21:33:13 +0000123 </tr>
124 </xsl:if>
125 </xsl:for-each>
126 </table>
127 </body>
128 </html>
129 </xsl:template>
130
131</xsl:stylesheet>