1 |
<%@ page import="net.jsunit.JsUnitServer" %> |
2 |
<%@ page import="net.jsunit.ServerRegistry" %> |
3 |
<%@ page import="net.jsunit.configuration.Configuration" %> |
4 |
<%@ page import="net.jsunit.configuration.ConfigurationProperty" %> |
5 |
<%@ page import="net.jsunit.model.Browser" %> |
6 |
<%@ page import="net.jsunit.utility.SystemUtility" %> |
7 |
<%@ page import="java.text.SimpleDateFormat" %> |
8 |
<%JsUnitServer server = ServerRegistry.getServer();%> |
9 |
<%Configuration configuration = server.getConfiguration();%> |
10 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
11 |
<html> |
12 |
<head> |
13 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
14 |
<title>JsUnit <%if (server.isFarmServer()) {%> Farm<%}%> Server</title> |
15 |
<script type="text/javascript" src="app/jsUnitCore.js"></script> |
16 |
<script type="text/javascript" src="app/jsUnitVersionCheck.js"></script> |
17 |
<script type="text/javascript"> |
18 |
function selectDiv(selectedDivName) { |
19 |
updateDiv("testRunnerDiv", selectedDivName); |
20 |
updateDiv("configDiv", selectedDivName); |
21 |
updateDiv("runnerDiv", selectedDivName); |
22 |
updateDiv("displayerDiv", selectedDivName); |
23 |
} |
24 |
|
25 |
function updateDiv(divName, selectedDivName) { |
26 |
var isSelected = divName == selectedDivName; |
27 |
var theDiv = document.getElementById(divName); |
28 |
theDiv.style.visibility = isSelected ? "visible" : "hidden"; |
29 |
theDiv.style.height = isSelected ? "" : "0"; |
30 |
|
31 |
var theDivHeader = document.getElementById(divName + "Header"); |
32 |
theDivHeader.className = isSelected ? "selectedTab" : "unselectedTab"; |
33 |
} |
34 |
</script> |
35 |
<link rel="stylesheet" type="text/css" href="./css/jsUnitStyle.css"> |
36 |
</head> |
37 |
|
38 |
<body onload="selectDiv('runnerDiv')"> |
39 |
<table height="90" width="100%" cellpadding="0" cellspacing="0" border="0" summary="jsUnit Information" |
40 |
bgcolor="#DDDDDD"> |
41 |
<tr> |
42 |
<td width="1"> |
43 |
<a href="http://www.jsunit.net" target="_blank"><img src="images/logo_jsunit.gif" alt="JsUnit" border="0"/></a> |
44 |
</td> |
45 |
<td width="50"> </td> |
46 |
<th nowrap align="left"> |
47 |
<h4>JsUnit <%=SystemUtility.jsUnitVersion()%><%if (server.isFarmServer()) {%> Farm<%}%> Server</h4> |
48 |
<font size="-2"><i>Running on <%=SystemUtility.displayString()%> |
49 |
since <%=new SimpleDateFormat().format(server.getStartDate())%></i></font> |
50 |
<%if (!server.isFarmServer()) {%> |
51 |
<br> |
52 |
<font size="-2"><i><%=server.getTestRunCount()%> test run(s) completed</i></font> |
53 |
<br> |
54 |
<%}%> |
55 |
</th> |
56 |
<td nowrap align="right" valign="middle"> |
57 |
<font size="-2"> |
58 |
<b><a href="http://www.jsunit.net/" target="_blank">www.jsunit.net</a></b><br> |
59 |
|
60 |
<div id="versionCheckDiv"><a href="javascript:checkForLatestVersion('latestversion')">Check for newer |
61 |
version</a></div> |
62 |
</font> |
63 |
<a href="http://www.pivotalsf.com/" target="top"> |
64 |
<img border="0" src="images/powerby-transparent.gif" alt="Powered By Pivotal"> |
65 |
</a> |
66 |
</td> |
67 |
|
68 |
</tr> |
69 |
</table> |
70 |
<h4> |
71 |
Server configuration |
72 |
</h4> |
73 |
<table border="0"> |
74 |
<tr> |
75 |
<th nowrap align="right">Server type:</th> |
76 |
<td width="10"> </td> |
77 |
<td><%=server.serverType().getDisplayName()%></td> |
78 |
</tr> |
79 |
<% |
80 |
for (ConfigurationProperty property : configuration.getRequiredAndOptionalConfigurationProperties(server.serverType())) { |
81 |
%> |
82 |
<tr> |
83 |
<th nowrap align="right"><%=property.getDisplayName()%>:</th> |
84 |
<td width="10"> </td> |
85 |
<td> |
86 |
<% |
87 |
for (String valueString : property.getValueStrings(configuration)) { |
88 |
%><div><% |
89 |
if (valueString != null) { |
90 |
if (property.isURL()) { |
91 |
%><a href="<%=valueString%>"><%=valueString%></a><% |
92 |
} else { |
93 |
%><%=valueString%><% |
94 |
} |
95 |
} |
96 |
%></div><% |
97 |
} |
98 |
%> |
99 |
</td></tr> |
100 |
<% |
101 |
} |
102 |
%> |
103 |
</table> |
104 |
<br> |
105 |
<h4> |
106 |
Available services |
107 |
</h4> |
108 |
|
109 |
<table cellpadding="0" cellspacing="0"> |
110 |
<tr> |
111 |
<td class="tabHeaderSeparator"> </td> |
112 |
<td id="runnerDivHeader" class="selectedTab"> |
113 |
<a href="javascript:selectDiv('runnerDiv')">runner</a> |
114 |
</td> |
115 |
<td class="tabHeaderSeparator"> </td> |
116 |
<%if (!server.isFarmServer()) {%> |
117 |
<td id="displayerDivHeader" class="unselectedTab"> |
118 |
<a href="javascript:selectDiv('displayerDiv')">displayer</a> |
119 |
</td> |
120 |
<td class="tabHeaderSeparator"> </td> |
121 |
<%}%> |
122 |
<td id="testRunnerDivHeader" class="unselectedTab"> |
123 |
<a href="javascript:selectDiv('testRunnerDiv')">testRunner.html</a> |
124 |
</td> |
125 |
<td class="tabHeaderSeparator"> </td> |
126 |
<td id="configDivHeader" class="unselectedTab"> |
127 |
<a href="javascript:selectDiv('configDiv')">config</a> |
128 |
</td> |
129 |
<td class="tabHeaderSeparator" width="99%"> </td> |
130 |
</tr> |
131 |
<tr> |
132 |
<td colspan="9" |
133 |
style="border-style: solid;border-bottom-width:1px;border-top-width:0px;border-left-width:1px;border-right-width:1px;"> |
134 |
<div id="runnerDiv" style="width:100%;visibility:visible;background:#DDDDDD"> |
135 |
<br> |
136 |
|
137 |
<form action="/jsunit/runner" method="get" name="runnerForm"> |
138 |
<table> |
139 |
<tr> |
140 |
<td colspan="2"> |
141 |
You can ask the server to run JsUnit tests using the <i>runner</i> servlet. |
142 |
You can run using the server's default URL for tests by going to <a href="/jsunit/runner">runner</a>, |
143 |
or you can specify a custom URL and/or browser ID using this form: |
144 |
</td> |
145 |
</tr> |
146 |
<tr> |
147 |
<td width="1"> |
148 |
URL: |
149 |
</td> |
150 |
<td> |
151 |
<input type="text" name="url" size="100" value=""/> |
152 |
</td> |
153 |
</tr> |
154 |
<tr> |
155 |
<td colspan="2"> |
156 |
<font size="-2"><i>e.g. |
157 |
http://www.jsunit.net/runner/testRunner.html?testPage=http://www.jsunit.net/runner/tests/jsUnitTestSuite.html</i> |
158 |
</font> |
159 |
</td> |
160 |
</tr> |
161 |
<tr> |
162 |
<td width="1"> |
163 |
Browser: |
164 |
</td> |
165 |
<td> |
166 |
<%if (!server.isFarmServer()) {%> |
167 |
|
168 |
<select name="browserId"> |
169 |
<option value="">(All browsers)</option> |
170 |
<% |
171 |
for (Browser browser : configuration.getBrowsers()) { |
172 |
%><option value="<%=browser.getId()%>"><%=browser.getFileName()%></option> |
173 |
<%}%> |
174 |
</select><br> |
175 |
<%}%> |
176 |
</td> |
177 |
</tr> |
178 |
<tr> |
179 |
<td colspan="2"> |
180 |
<input type="submit" value="go"/> |
181 |
</td> |
182 |
</tr> |
183 |
</table> |
184 |
</form> |
185 |
<br> |
186 |
</div> |
187 |
|
188 |
<%if (!server.isFarmServer()) {%> |
189 |
|
190 |
<div id="displayerDiv" style="width:100%;visibility:hidden;background:#DDDDDD"> |
191 |
<br> |
192 |
|
193 |
<form action="/jsunit/displayer" name="displayerForm"> |
194 |
<table> |
195 |
<tr> |
196 |
<td colspan="2"> |
197 |
You can view the logs of past runs using the displayer command. |
198 |
Use this form to specify the ID of the run you want to see: |
199 |
</td> |
200 |
</tr> |
201 |
<tr> |
202 |
<td width="1"> |
203 |
ID: |
204 |
</td> |
205 |
<td> |
206 |
<input type="text" name="id" size="20"/> |
207 |
</td> |
208 |
</tr> |
209 |
<tr> |
210 |
<td width="1"> |
211 |
Browser: |
212 |
</td> |
213 |
<td> |
214 |
<select name="browserId"> |
215 |
<% |
216 |
for (Browser browser : configuration.getBrowsers()) { |
217 |
%><option value="<%=browser.getId()%>"><%=browser.getFileName()%></option> |
218 |
<%}%> |
219 |
</select><br> |
220 |
</td> |
221 |
</tr> |
222 |
<tr> |
223 |
<td colspan="2"> |
224 |
<input type="submit" value="go"/> |
225 |
</td> |
226 |
</tr> |
227 |
</table> |
228 |
</form> |
229 |
<br> |
230 |
</div> |
231 |
<%}%> |
232 |
|
233 |
<div id="testRunnerDiv" style="width:100%;visibility:hidden;background:#DDDDDD"> |
234 |
<br> |
235 |
The manual Test Runner is at <a id="testRunnerHtml" href="./testRunner.html">testRunner.html</a>. |
236 |
<br> |
237 |
</div> |
238 |
|
239 |
|
240 |
<div id="configDiv" style="width:100%;visibility:hidden;background:#DDDDDD"> |
241 |
<br> |
242 |
You can see the configuration of this server as XML by going to <a id="config" |
243 |
href="/jsunit/config">config</a>. |
244 |
The config service is usually only used programmatically. |
245 |
<br> |
246 |
</div> |
247 |
</td> |
248 |
</tr> |
249 |
</table> |
250 |
|
251 |
</body> |
252 |
</html> |