blob: 294170a5aae6b18b2a092cba303d805cdf89921a [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>
57 <table border="0" cellpadding="2" cellspacing="5" width="100%">
58 <tr>
59 <td align="left" width="60%">
jeffliu0ca9bfa2005-10-20 05:01:38 +000060 <font style="font-size: x-large;; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold">API Test Coverage Summary</font>
jeffliudb250412005-10-10 21:33:13 +000061 </td>
62 <td width="40%">
63 <img src="Idea.jpg" align="middle" height="86" hspace="50" width="120"/>
64 </td>
65 </tr>
66 </table>
67 <table border="0" cellpadding="2" cellspacing="5" width="100%">
68 <tr>
69 <td ALIGN="LEFT" VALIGN="TOP" COLSPAN="2" BGCOLOR="#0080C0"><b><font color="#FFFFFF" face="Arial,Helvetica">API javadoc summary</font></b></td>
70 </tr>
71 </table>
72 <br/>
jeffliu1521a212006-05-31 02:01:45 +000073 <p>
74 Sort by:
75 <select name="sortby" onchange="javascript:sort(this.selectedIndex)">
76 <option value="1">Name</option>
77 <option value="2">Methods tested</option>
78 <option value="3">% tested</option>
79 <option value="4">Methods not tested</option>
80 <option value="5">% not tested</option>
81 </select>
82 </p>
83 <table id="data" border="1" width="80%">
jeffliudb250412005-10-10 21:33:13 +000084 <tr>
jeffliu1521a212006-05-31 02:01:45 +000085 <th width="50%">Name</th>
jeffliudb250412005-10-10 21:33:13 +000086 <th><img src="OK.gif"/>Methods tested</th>
jeffliu1521a212006-05-31 02:01:45 +000087 <th>&#160;%&#160;</th>
jeffliudb250412005-10-10 21:33:13 +000088 <th><img src="FAIL.gif"/>Methods not tested</th>
jeffliu1521a212006-05-31 02:01:45 +000089 <th>&#160;%&#160;</th>
jeffliudb250412005-10-10 21:33:13 +000090 </tr>
91 <xsl:for-each select="root/api-info">
92 <xsl:sort select="@file"/>
93 <xsl:variable name="report" select="document(@file)"/>
jeffliu1521a212006-05-31 02:01:45 +000094 <xsl:variable name="total" select="count($report/component-api/package-api/class-api/method-api)"/>
jeffliudb250412005-10-10 21:33:13 +000095 <xsl:variable name="tested" select="count($report/component-api/package-api/class-api/method-api/test-coverage)"/>
jeffliu1521a212006-05-31 02:01:45 +000096 <xsl:variable name="untested" select="$total - $tested"/>
jeffliudb250412005-10-10 21:33:13 +000097 <xsl:if test="$untested &gt; 0">
98 <tr>
99 <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>
100 <td><xsl:value-of select="$tested"/></td>
jeffliu1521a212006-05-31 02:01:45 +0000101 <td><xsl:value-of select="round($tested div $total * 100)"/></td>
jeffliudb250412005-10-10 21:33:13 +0000102 <td><xsl:value-of select="$untested"/></td>
jeffliu1521a212006-05-31 02:01:45 +0000103 <td><xsl:value-of select="round($untested div $total * 100)"/></td>
jeffliudb250412005-10-10 21:33:13 +0000104 </tr>
105 </xsl:if>
106 </xsl:for-each>
107 </table>
108 </body>
109 </html>
110 </xsl:template>
111
112</xsl:stylesheet>