blob: 449a5867f06c568fccd8b057346f40881f91ef19 [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 <xsl:template match="/">
5 <html>
6 <script language="javascript">
7 function twist(img)
8 {
9 var div = document.getElementById(img.id.substring(0, img.id.length - 4));
10 if (div.style.display == "")
11 {
12 div.style.display = "none";
13 img.src = "../twistclosed.gif";
14 }
15 else
16 {
17 div.style.display = "";
18 img.src = "../twistopened.gif";
19 }
20 }
21 var show = false;
22 function allTwist()
23 {
24 var divs = document.getElementsByTagName("div");
25 for (var i = 0; i &lt; divs.length; i++)
26 {
27 if (divs[i].id != null &amp;&amp; divs[i].id.length &gt; 0 &amp;&amp; divs[i].id.indexOf("::ok::") == -1 &amp;&amp; divs[i].id.indexOf("::fail::") == -1)
28 {
29 var img = document.getElementById(divs[i].id + '.img');
30 if (!show)
31 {
32 divs[i].style.display = "none";
33 img.src = "../twistclosed.gif";
34 }
35 else
36 {
37 divs[i].style.display = "";
38 img.src = "../twistopened.gif";
39 }
40 }
41 }
42 var a = document.getElementById("allTwistId");
43 if (!show)
44 a.childNodes[0].data = "Expand classes";
45 else
46 a.childNodes[0].data = "Collapse classes";
47 show = !show;
48 }
49 function twistOKAndFail(id, prefix)
50 {
51 var input = document.getElementById(id);
52 var divs = document.getElementsByTagName("div");
53 for (var i = 0; i &lt; divs.length; i++)
54 {
55 if (divs[i].id != null &amp;&amp; divs[i].id.length &gt; 0 &amp;&amp; divs[i].id.indexOf(prefix) != -1)
56 {
57 if (input.checked)
58 {
59 divs[i].style.display = "none";
60 }
61 else
62 {
63 divs[i].style.display = "";
64 }
65 }
66 }
67 }
68 </script>
69 <body>
70 <font face="Arial,Helvetica">
71 <xsl:apply-templates select="component-api"/>
72 </font>
73 </body>
74 </html>
75 </xsl:template>
76
77 <xsl:template match="component-api">
78 <table border="0" cellpadding="2" cellspacing="5" width="100%">
79 <tr>
80 <td align="left" width="60%">
81 <font style="font-size: x-large;; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold">API Test Coverage Report for <xsl:value-of select="@name"/></font>
82 </td>
83 <td width="40%">
84 <img src="../Idea.jpg" align="middle" height="86" hspace="50" width="120"/>
85 </td>
86 </tr>
87 </table>
88 <table border="0" cellpadding="2" cellspacing="5" width="100%">
89 <tr>
90 <td ALIGN="LEFT" VALIGN="TOP" COLSPAN="2" BGCOLOR="#0080C0"><b><font color="#FFFFFF" face="Arial,Helvetica">Test Coverage (methods tested: <xsl:value-of select="count(package-api/class-api/method-api/test-coverage)"/>, methods not tested: <xsl:value-of select="count(package-api/class-api/method-api) - count(package-api/class-api/method-api/test-coverage)"/>)</font></b></td>
91 </tr>
92 </table>
93 <br/>
94 <table border="0" cellpadding="2" cellspacing="5" width="75%">
95 <tr>
96 <td align="left">
97 <input id="okId" type="checkbox" onclick="javascript:twistOKAndFail('okId', '::ok::')"/>Hide tested methods
98 </td>
99 <td align="left">
100 <input id="failId" type="checkbox" onclick="javascript:twistOKAndFail('failId', '::fail::')"/>Hide untested methods
101 </td>
102 <td align="left">
103 <a id="allTwistId" href="javascript:allTwist()">Collapse classes</a>
104 </td>
105 </tr>
106 </table>
107 <br/>
108 <table border="0" cellpadding="2" cellspacing="5" width="100%">
109 <xsl:for-each select="package-api/class-api">
110 <xsl:sort select="@name"/>
111 <xsl:choose>
112 <xsl:when test="(count(method-api/test-coverage) = count(method-api)) or (count(method-api/test-coverage) = 0)">
113 <xsl:choose>
114 <xsl:when test="method-api/test-coverage/test">
115 <tr>
116 <td>
117 <div id="::ok::class::{@name}">
118 <xsl:apply-templates select="."/>
119 </div>
120 </td>
121 </tr>
122 </xsl:when>
123 <xsl:otherwise>
124 <tr>
125 <td>
126 <div id="::fail::class::{@name}">
127 <xsl:apply-templates select="."/>
128 </div>
129 </td>
130 </tr>
131 </xsl:otherwise>
132 </xsl:choose>
133 </xsl:when>
134 <xsl:otherwise>
135 <tr>
136 <td>
137 <xsl:apply-templates select="."/>
138 </td>
139 </tr>
140 </xsl:otherwise>
141 </xsl:choose>
142 </xsl:for-each>
143 </table>
144 </xsl:template>
145
146 <xsl:template match="class-api">
147 <xsl:if test="method-api">
148 <xsl:variable name="fullname" select="concat(../@name, '.', @name)"/>
149 <img id="source::{@name}.img" src="../twistopened.gif" onclick="javascript:twist(this)"/>
150 <xsl:value-of select="$fullname"/>
151 <p>
152 <div id="source::{@name}">
153 <xsl:for-each select="method-api">
154 <xsl:sort select="@name"/>
155 <xsl:choose>
156 <xsl:when test="test-coverage/test">
157 <div id="::ok::source::{@name}">
158 <xsl:apply-templates select="."/>
159 </div>
160 </xsl:when>
161 <xsl:otherwise>
162 <div id="::fail::source::{@name}">
163 <xsl:apply-templates select="."/>
164 </div>
165 </xsl:otherwise>
166 </xsl:choose>
167 </xsl:for-each>
168 </div>
169 </p>
170 </xsl:if>
171 </xsl:template>
172
173 <xsl:template match="method-api">
174 <img src="../space.gif"/>
175 <xsl:choose>
176 <xsl:when test="test-coverage/test">
177 <img src="../OK.gif"/>
178 </xsl:when>
179 <xsl:otherwise>
180 <img src="../FAIL.gif"/>
181 </xsl:otherwise>
182 </xsl:choose>
183 &#160;<xsl:value-of select="@name"/>&#160;&#160;<i><xsl:value-of select="@descriptor"/></i>
184 <xsl:if test="test-coverage/test">
185 <ol>
186 <xsl:for-each select="test-coverage/test">
187 <li>
188 <xsl:value-of select="@name"/>
189 </li>
190 </xsl:for-each>
191 </ol>
192 </xsl:if>
193 <br/>
194 </xsl:template>
195
196</xsl:stylesheet>