Author: ggrekhov
Date: Tue Jun 26 17:52:05 2012
New Revision: 1354133
URL: http://svn.apache.org/viewvc?rev=1354133&view=rev
Log:
NetworkTesting: gui improvements; automatic run
Added:
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/resources/passed_result.png
(with props)
Modified:
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/networktesting.lzx
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/BaseURLLoadTest.lzx
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/DownloadSpeedTest.lzx
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/JitterTest.lzx
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/NetworkTest.lzx
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/PortAvailabilityTest.lzx
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/UploadSpeedTest.lzx
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/library.lzx
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/testsView.lzx
Modified:
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/networktesting.lzx
URL:
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/networktesting.lzx?rev=1354133&r1=1354132&r2=1354133&view=diff
==============================================================================
---
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/networktesting.lzx
(original)
+++
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/networktesting.lzx
Tue Jun 26 17:52:05 2012
@@ -44,6 +44,7 @@
<method name="showTests">
var tests = new lz.TestsView(canvas, {name:"testsView"});
+ tests.testAll();
</method>
<dataset type="http" name="settings" request="false" >
Modified:
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/BaseURLLoadTest.lzx
URL:
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/BaseURLLoadTest.lzx?rev=1354133&r1=1354132&r2=1354133&view=diff
==============================================================================
---
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/BaseURLLoadTest.lzx
(original)
+++
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/BaseURLLoadTest.lzx
Tue Jun 26 17:52:05 2012
@@ -126,14 +126,17 @@
<method name="report">
var report = "report:";
if (successfulTestsCount > 0) {
- this.setPassed();
report += "\n" + this.generateReport();
} else {
- this.setFailed();
report += " connection error";
}
-
this.log(report);
+
+ if (successfulTestsCount > 0) {
+ this.setPassed();
+ } else {
+ this.setFailed();
+ }
</method>
<method name="generateReport" />
Modified:
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/DownloadSpeedTest.lzx
URL:
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/DownloadSpeedTest.lzx?rev=1354133&r1=1354132&r2=1354133&view=diff
==============================================================================
---
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/DownloadSpeedTest.lzx
(original)
+++
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/DownloadSpeedTest.lzx
Tue Jun 26 17:52:05 2012
@@ -27,6 +27,7 @@
this.setAttribute("testName", "Download speed");
this.setAttribute("loadFileName", "downloadTest");
this.setAttribute("verbose", false);
+ this.setAttribute("resultText", true);
</handler>
<method name="generateReport">
@@ -38,6 +39,9 @@
report += "Download time: " + timeSec + " s\n";
report += "Download speed: " + speed + " Mb/s\n";
+ resultLabel.setAttribute("text", "");
+ resultLabel.addFormat("%.2f\n%s", speed, "Mb/s");
+
return report;
</method>
Modified:
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/JitterTest.lzx
URL:
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/JitterTest.lzx?rev=1354133&r1=1354132&r2=1354133&view=diff
==============================================================================
---
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/JitterTest.lzx
(original)
+++
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/JitterTest.lzx
Tue Jun 26 17:52:05 2012
@@ -27,9 +27,11 @@
this.setAttribute("testName", "Jitter");
this.setAttribute("loadFileName", "jitterTest");
this.setAttribute("verbose", false);
+ this.setAttribute("resultText", true);
</handler>
<method name="generateReport">
+ <![CDATA[
var averageTime = wholeTime / successfulTestsCount;
var jitterMax = maxTime - averageTime;
var jitterMin = minTime - averageTime;
@@ -38,7 +40,16 @@
report += "Max time: " + maxTime + " ms\n";
report += "Jitter: " + jitterMax + " ms and " + jitterMin + " ms \n";
+ var max = -jitterMin;
+ if (jitterMax > max) {
+ max = jitterMax;
+ }
+
+ resultLabel.setAttribute("text", "");
+ resultLabel.addFormat("%.0d\n%s", max, "ms");
+
return report;
+ ]]>
</method>
</class>
Modified:
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/NetworkTest.lzx
URL:
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/NetworkTest.lzx?rev=1354133&r1=1354132&r2=1354133&view=diff
==============================================================================
---
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/NetworkTest.lzx
(original)
+++
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/NetworkTest.lzx
Tue Jun 26 17:52:05 2012
@@ -26,10 +26,17 @@
<attribute name="host" type="string" value="null" />
<attribute name="port" type="number" value="null" />
<attribute name="running" type="boolean" value="false" />
+ <attribute name="allTests" type="boolean" value="false" />
+ <attribute name="resultText" type="boolean" value="false" />
<method name="start" />
<method name="forcedStop" />
+ <method name="startAllTestsMode">
+ allTests = true;
+ this.setRunning();
+ </method>
+
<view name="picture">
<view name="rsc" resource="notrun" width="113" height="113" />
</view>
@@ -38,20 +45,43 @@
x="${(parent.picture.rsc.width - this.width)/2}"
y="$once{parent.picture.rsc.height}"
/>
+ <text name="resultLabel"
+ visible="false"
+ fgcolor="white"
+ align="center"
+ fontsize="16"
+ />
<handler name="onclick">
if (running) {
this.setStopped();
} else {
+ allTests = false;
this.setRunning();
}
</handler>
+
+ <method name="handleAllTestsMode">
+ if (allTests) {
+ canvas.testsView.testAll();
+ }
+ </method>
<method name="setPassed">
if (running) {
running=false;
- picture.rsc.setAttribute("resource", "passed");
+ if (resultText) {
+ picture.rsc.setAttribute("resource", "passed_result");
+ var x = (picture.rsc.width - resultLabel.width)/2;
+ var y = (picture.rsc.height - resultLabel.height)/2;
+ resultLabel.setAttribute("x", x);
+ resultLabel.setAttribute("y", y);
+ resultLabel.setAttribute("visible", true);
+ } else {
+ picture.rsc.setAttribute("resource", "passed");
+ }
canvas.setAttribute("busy", false);
+ this.handleAllTestsMode();
}
</method>
@@ -60,6 +90,7 @@
running=false;
picture.rsc.setAttribute("resource", "failed");
canvas.setAttribute("busy", false);
+ this.handleAllTestsMode();
}
</method>
@@ -70,6 +101,7 @@
canvas.setAttribute("busy", true);
this.start();
running=true;
+ resultLabel.setAttribute("visible", false);
picture.rsc.setAttribute("resource", "running");
picture.rsc.play();
</method>
@@ -79,6 +111,7 @@
running=false;
picture.rsc.setAttribute("resource", "notrun");
canvas.setAttribute("busy", false);
+ this.handleAllTestsMode();
</method>
<method name="log" args="message">
Modified:
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/PortAvailabilityTest.lzx
URL:
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/PortAvailabilityTest.lzx?rev=1354133&r1=1354132&r2=1354133&view=diff
==============================================================================
---
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/PortAvailabilityTest.lzx
(original)
+++
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/PortAvailabilityTest.lzx
Tue Jun 26 17:52:05 2012
@@ -48,19 +48,20 @@
<method name="forcedStop">
this.log("stopped");
+ // TODO: disconnect @rtmp
</method>
<handler name="onconnect" reference="rtmp">
if (running) {
+ this.log("port is available\n");
this.setPassed();
- this.log("port is available");
}
</handler>
<handler name="onerror" args="e" reference="rtmp">
if (running) {
+ this.log("connection error - " + e + "\n");
this.setFailed();
- this.log("connection error - " + e);
}
</handler>
Modified:
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/UploadSpeedTest.lzx
URL:
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/UploadSpeedTest.lzx?rev=1354133&r1=1354132&r2=1354133&view=diff
==============================================================================
---
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/UploadSpeedTest.lzx
(original)
+++
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/UploadSpeedTest.lzx
Tue Jun 26 17:52:05 2012
@@ -41,6 +41,7 @@
<handler name="oninit">
this.setAttribute("testName", "Upload speed");
+ this.setAttribute("resultText", true);
</handler>
<method name="initLoader">
@@ -85,6 +86,8 @@
report += "Upload time: " + loadTimeSec + " s\n";
report += "Upload speed: " + speed + " Mb/s\n";
+ resultLabel.setAttribute("text", "");
+ resultLabel.addFormat("%.2f\n%s", speed, "Mb/s");
this.log(report);
this.setPassed();
}
@@ -92,8 +95,8 @@
<method name="onError" args="e">
if (running) {
- this.setFailed();
this.log("error - " + e);
+ this.setFailed();
}
</method>
Modified:
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/library.lzx
URL:
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/library.lzx?rev=1354133&r1=1354132&r2=1354133&view=diff
==============================================================================
---
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/library.lzx
(original)
+++
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/library.lzx
Tue Jun 26 17:52:05 2012
@@ -23,6 +23,7 @@
<resource name="failed" src="resources/failed.png" />
<resource name="notrun" src="resources/notrun.png" />
<resource name="passed" src="resources/passed.png" />
+ <resource name="passed_result" src="resources/passed_result.png" />
<resource name="running" src="resources/running.swf" />
<include href="BaseURLLoadTest.lzx" />
Added:
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/resources/passed_result.png
URL:
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/resources/passed_result.png?rev=1354133&view=auto
==============================================================================
Binary file - no diff available.
Propchange:
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/resources/passed_result.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Modified:
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/testsView.lzx
URL:
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/testsView.lzx?rev=1354133&r1=1354132&r2=1354133&view=diff
==============================================================================
---
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/testsView.lzx
(original)
+++
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/testsView.lzx
Tue Jun 26 17:52:05 2012
@@ -76,6 +76,29 @@
y="${parent.pingTest.y}"
/>
+ <attribute name="currentTestNumber" type="number" value="0" />
+ <method name="testAll">
+ var nextTest;
+ if (0 == currentTestNumber) {
+ nextTest = pingTest;
+ } else if (1 == currentTestNumber) {
+ nextTest = portTest;
+ } else if (2 == currentTestNumber) {
+ nextTest = jitterTest;
+ } else if (3 == currentTestNumber) {
+ nextTest = downloadTest;
+ } else if (4 == currentTestNumber) {
+ nextTest = uploadTest;
+ } else if (5 == currentTestNumber) {
+ nextTest = null;
+ }
+
+ if (null != nextTest) {
+ currentTestNumber++;
+ nextTest.startAllTestsMode();
+ }
+ </method>
+
</class>
</library>