Author: ggrekhov
Date: Thu Jun 21 17:42:36 2012
New Revision: 1352633

URL: http://svn.apache.org/viewvc?rev=1352633&view=rev
Log:
NetworkTesting: v0.1

Added:
    
incubator/openmeetings/trunk/singlewebapp/WebContent/openmeetings/networktesting-config.xml
    
incubator/openmeetings/trunk/singlewebapp/WebContent/openmeetings/networktesting-config.xsd
    
incubator/openmeetings/trunk/singlewebapp/WebContent/openmeetings/testingTools/
      - copied from r1351442, 
incubator/openmeetings/trunk/singlewebapp/WebContent/testingTools/
    
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/resources/
    
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/resources/edit-copy.png
   (with props)
    
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/testsView.lzx
Removed:
    incubator/openmeetings/trunk/singlewebapp/WebContent/testingTools/
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/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/build.xml

Added: 
incubator/openmeetings/trunk/singlewebapp/WebContent/openmeetings/networktesting-config.xml
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/openmeetings/networktesting-config.xml?rev=1352633&view=auto
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/WebContent/openmeetings/networktesting-config.xml
 (added)
+++ 
incubator/openmeetings/trunk/singlewebapp/WebContent/openmeetings/networktesting-config.xml
 Thu Jun 21 17:42:36 2012
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+  
+      http://www.apache.org/licenses/LICENSE-2.0
+         
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+  
+-->
+<config 
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
+    xsi:noNamespaceSchemaLocation="networktesting-config.xsd">
+
+    <hostAddress>192.168.56.101</hostAddress>
+    <rtmpPort>1935</rtmpPort>
+    <httpPort>5080</httpPort>
+    <uriContext>/openmeetings</uriContext>
+    <rtmpUriPath>/openmeetings/hibernate</rtmpUriPath>
+
+</config>

Added: 
incubator/openmeetings/trunk/singlewebapp/WebContent/openmeetings/networktesting-config.xsd
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/openmeetings/networktesting-config.xsd?rev=1352633&view=auto
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/WebContent/openmeetings/networktesting-config.xsd
 (added)
+++ 
incubator/openmeetings/trunk/singlewebapp/WebContent/openmeetings/networktesting-config.xsd
 Thu Jun 21 17:42:36 2012
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+  
+      http://www.apache.org/licenses/LICENSE-2.0
+         
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+  
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
elementFormDefault="qualified">
+
+  <xs:element name="config">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="hostAddress"/>
+        <xs:element ref="rtmpPort"/>
+        <xs:element ref="httpPort"/>
+        <xs:element ref="uriContext"/>
+        <xs:element ref="rtmpUriPath"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="hostAddress" type="xs:anyURI"/>
+  <xs:element name="rtmpPort" type="xs:integer"/>
+  <xs:element name="httpPort" type="xs:integer"/>
+  <xs:element name="uriContext" type="xs:string"/>
+  <xs:element name="rtmpUriPath" type="xs:string"/>
+
+</xs:schema>

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=1352633&r1=1352632&r2=1352633&view=diff
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/networktesting.lzx
 (original)
+++ 
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/networktesting.lzx
 Thu Jun 21 17:42:36 2012
@@ -18,42 +18,55 @@
   under the License.
   
 -->
-<canvas debug="true" width="100%" height="100%" title="NetworkTesting">
+<canvas debug="false" width="100%" height="100%" title="NetworkTesting">
 
-    <include href="tests/" />
+    <include href="testsView.lzx" />
 
-    <attribute name="busy" type="boolean" value="false"/>
-    <attribute name="host" type="string" value="localhost" />
+    <!--
+        These attributes are rewritten by values from 
"networktesting-config.xml"
+    -->
+    <attribute name="host" type="string" value="" />
     <attribute name="rtmpPort" type="number" value="1935" />
     <attribute name="httpPort" type="number" value="5080" />
-    <attribute name="offset" type="number" value="20" />
+    <attribute name="uriContext" type="string" value="/openmeetings" />
+    <attribute name="rtmpUriPath" type="string" 
value="/openmeetings/hibernate" />
+
+    <method name="getSettings">
+        var settingsPtr = canvas.settings.getPointer();
+
+        canvas.setAttribute("host", 
settingsPtr.xpathQuery("config/hostAddress/text()"));
+        canvas.setAttribute("rtmpPort", 
settingsPtr.xpathQuery("config/rtmpPort/text()"));
+        canvas.setAttribute("httpPort", 
settingsPtr.xpathQuery("config/httpPort/text()"));
+
+        canvas.setAttribute("uriContext", 
settingsPtr.xpathQuery("config/uriContext/text()"));
+        canvas.setAttribute("rtmpUriPath", 
settingsPtr.xpathQuery("config/rtmpUriPath/text()"));
+    </method>
+
+    <method name="showTests">
+        var tests = new lz.TestsView(canvas, {name:"testsView"});
+    </method>
+
+    <dataset type="http" name="settings" request="false" >
+        <handler name="oninit">
+            this.setAttribute("src","networktesting-config.xml");
+            this.doRequest();
+        </handler>
+        <handler name="ondata">
+            if ($debug) Debug.write("Settings are retrieved");
+            canvas.getSettings();
+            canvas.showTests();
+        </handler>
+        <handler name="onerror" args="e">
+            if ($debug) Debug.write("Settings error", e);
+        </handler>
+        <handler name="ontimeout" args="e">
+            if ($debug) Debug.write("Settings timeout error", e);
+        </handler>
+    </dataset>
+
+    <attribute name="busy" type="boolean" value="false"/>
     <attribute name="log" type="string" value="" />
 
-    <PingTest
-        name="pingTest" host="${parent.host}" port="${parent.httpPort}"
-        x="${parent.offset}"
-        y="${parent.offset}"
-    />
-    <PortAvailabilityTest
-        name="portTest" host="${parent.host}" port="${parent.rtmpPort}"
-        x="${parent.pingTest.x + parent.pingTest.width + parent.offset}"
-        y="${parent.offset}"
-     />
-    <JitterTest
-        name="jitterTest" host="${parent.host}" port="${parent.httpPort}"
-        x="${parent.portTest.x + parent.portTest.width + parent.offset}"
-        y="${parent.offset}"
-    />
-    <DownloadSpeedTest
-        name="downloadTest" host="${parent.host}" port="${parent.httpPort}"
-        x="${parent.jitterTest.x + parent.jitterTest.width + parent.offset}"
-        y="${parent.offset}"
-    />
-
-    <UploadSpeedTest
-        name="uploadTest" host="${parent.host}" port="${parent.httpPort}"
-        x="${parent.downloadTest.x + parent.downloadTest.width + 
parent.offset}"
-        y="${parent.offset}"
-    />
+    <attribute name="testsView" value="null"/>
 
 </canvas>

Added: 
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/resources/edit-copy.png
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/resources/edit-copy.png?rev=1352633&view=auto
==============================================================================
Binary file - no diff available.

Propchange: 
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/resources/edit-copy.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

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=1352633&r1=1352632&r2=1352633&view=diff
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/BaseURLLoadTest.lzx
 (original)
+++ 
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/BaseURLLoadTest.lzx
 Thu Jun 21 17:42:36 2012
@@ -49,7 +49,7 @@
     <attribute name="loader" value="null" />
 
     <method name="initLoader">
-        hostUrl = "http://"; + host + ":" + port + 
"/openmeetings/testingTools/" + loadFileName;
+        hostUrl = "http://"; + host + ":" + port + canvas.uriContext + 
"/testingTools/" + loadFileName;
         request = new URLRequest(hostUrl);
 
         loader = new URLLoader();

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=1352633&r1=1352632&r2=1352633&view=diff
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/NetworkTest.lzx
 (original)
+++ 
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/NetworkTest.lzx
 Thu Jun 21 17:42:36 2012
@@ -30,13 +30,13 @@
     <method name="start" />
     <method name="forcedStop" />
 
-    <view name="picture" width="113" height="113">
-        <image name="rsc" resource="notrun"/>
+    <view name="picture">
+        <image name="rsc" resource="notrun" width="113" height="113" />
     </view>
     <text name="nameLabel"
           text="${parent.testName}"
-          x="${(parent.picture.width - this.width)/2}"
-          y="$once{parent.picture.height}"
+          x="${(parent.picture.rsc.width - this.width)/2}"
+          y="$once{parent.picture.rsc.height}"
     />
 
     <handler name="onclick">

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=1352633&r1=1352632&r2=1352633&view=diff
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/PortAvailabilityTest.lzx
 (original)
+++ 
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/PortAvailabilityTest.lzx
 Thu Jun 21 17:42:36 2012
@@ -39,9 +39,9 @@
     </handler>
 
     <method name="start">
-        rtmp.init();
-        rtmp.setAttribute("src", 
"rtmp://"+host+":"+port+"/openmeetings/hibernate");
-        this.log(": start test... " + rtmp.src);
+        var hostUrl = "rtmp://" + host + ":" + port + canvas.rtmpUriPath;
+        rtmp.setAttribute("src", hostUrl);
+        this.log(": start test... " + hostUrl);
 
         rtmp.connect();
     </method>

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=1352633&r1=1352632&r2=1352633&view=diff
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/UploadSpeedTest.lzx
 (original)
+++ 
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tests/UploadSpeedTest.lzx
 Thu Jun 21 17:42:36 2012
@@ -44,7 +44,7 @@
     </handler>
 
     <method name="initLoader">
-        hostUrl = "http://"; + host + ":" + port + 
"/openmeetings/networktest.upload";
+        hostUrl = "http://"; + host + ":" + port + canvas.uriContext + 
"/networktest.upload";
         request = new URLRequest(hostUrl);
         request.method = URLRequestMethod.POST;
         request.data = getDataString();

Added: 
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=1352633&view=auto
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/testsView.lzx
 (added)
+++ 
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/testsView.lzx
 Thu Jun 21 17:42:36 2012
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+
+-->
+<library>
+
+<include href="tests/" />
+<resource name="log" src="resources/edit-copy.png" />
+
+<class name="TestsView" extends="view">
+
+    <attribute name="offset" type="number" value="20" />
+    <attribute name="smallOffset" type="number" value="5" />
+
+    <text name="label"
+        text="Click a play button to run a test"
+        x="${parent.offset}"
+        y="${parent.offset}"
+    />
+    <view name="logButton"
+        x="${parent.width - this.rsc.width - parent.offset}"
+        y="${parent.label.y + (parent.label.height - this.rsc.height)/2}"
+    >
+        <image name="rsc" resource="log" height="16" width="16"/>
+        <handler name="onclick">
+            lz.Browser.setClipboard(canvas.log);
+        </handler>
+    </view>
+
+    <text name="logLabel"
+        text="Copy the log to the clipboard:"
+        x="${parent.logButton.x - this.width - parent.smallOffset}"
+        y="${parent.label.y}"
+    />
+
+    <PingTest
+        name="pingTest" host="${canvas.host}" port="${canvas.httpPort}"
+        x="${parent.offset}"
+        y="${parent.label.y + parent.label.height + parent.offset/2}"
+    />
+    <PortAvailabilityTest
+        name="portTest" host="${canvas.host}" port="${canvas.rtmpPort}"
+        x="${parent.pingTest.x + parent.pingTest.width + parent.offset}"
+        y="${parent.pingTest.y}"
+     />
+    <JitterTest
+        name="jitterTest" host="${canvas.host}" port="${canvas.httpPort}"
+        x="${parent.portTest.x + parent.portTest.width + parent.offset}"
+        y="${parent.pingTest.y}"
+    />
+    <DownloadSpeedTest
+        name="downloadTest" host="${canvas.host}" port="${canvas.httpPort}"
+        x="${parent.jitterTest.x + parent.jitterTest.width + parent.offset}"
+        y="${parent.pingTest.y}"
+    />
+
+    <UploadSpeedTest
+        name="uploadTest" host="${canvas.host}" port="${canvas.httpPort}"
+        x="${parent.downloadTest.x + parent.downloadTest.width + 
parent.offset}"
+        y="${parent.pingTest.y}"
+    />
+
+</class>
+
+</library>

Modified: incubator/openmeetings/trunk/singlewebapp/build.xml
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/build.xml?rev=1352633&r1=1352632&r2=1352633&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/build.xml (original)
+++ incubator/openmeetings/trunk/singlewebapp/build.xml Thu Jun 21 17:42:36 2012
@@ -391,8 +391,11 @@
        </target>
 
        <target name="compile.laszlo.networktesting">
+               <copy todir="${dist.webapps.dir}">
+                       <fileset dir="${webcontent.src.dir}/openmeetings" 
includes="*" />
+               </copy>
                <copy todir="${dist.webapps.dir}/testingTools">
-                       <fileset dir="${webcontent.src.dir}/testingTools" 
includes="*" />
+                       <fileset 
dir="${webcontent.src.dir}/openmeetings/testingTools" includes="*" />
                </copy>
                <java classname="org.openlaszlo.compiler.Main" fork="true" 
newenvironment="true" failonerror="true" 
dir="${laszlo.as3.src.dir}/networkTesting" classpathref="laszlo.lib">
                        <jvmarg value="-DLPS_HOME=${laszlo.home}" />


Reply via email to