Author: ggrekhov
Date: Fri May 18 17:24:08 2012
New Revision: 1340177

URL: http://svn.apache.org/viewvc?rev=1340177&view=rev
Log:
Add ping test (currently with hardcoded host address)

Added:
    incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/
    
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/networktesting.lzx
    
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tools/
    
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tools/library.lzx
    
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tools/pingtool.lzx
    incubator/openmeetings/trunk/singlewebapp/WebContent/testingToolsFiles/
    
incubator/openmeetings/trunk/singlewebapp/WebContent/testingToolsFiles/pingTest
    
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/servlet/outputhandler/NetworkTestingServlet.java
Modified:
    incubator/openmeetings/trunk/singlewebapp/WebContent/WEB-INF/web.xml
    incubator/openmeetings/trunk/singlewebapp/build.xml

Modified: incubator/openmeetings/trunk/singlewebapp/WebContent/WEB-INF/web.xml
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/WEB-INF/web.xml?rev=1340177&r1=1340176&r2=1340177&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/WebContent/WEB-INF/web.xml 
(original)
+++ incubator/openmeetings/trunk/singlewebapp/WebContent/WEB-INF/web.xml Fri 
May 18 17:24:08 2012
@@ -30,6 +30,7 @@
                <welcome-file>login.html</welcome-file>
                <welcome-file>index.html</welcome-file>
                <welcome-file>index.htm</welcome-file>
+               <welcome-file>networktesting.swf10.swf</welcome-file>
        </welcome-file-list>
     
     <!-- Custom logging like described in Paul Gregoire Patch: 
@@ -142,6 +143,10 @@
         <servlet-name>BackupExport</servlet-name>
         
<servlet-class>org.openmeetings.servlet.outputhandler.BackupExportFacade</servlet-class>
     </servlet> 
+    <servlet>
+        <servlet-name>NetworkTesting</servlet-name>
+        
<servlet-class>org.openmeetings.servlet.outputhandler.NetworkTestingServlet</servlet-class>
+    </servlet>
        
        <servlet-mapping>
                <servlet-name>spring-mvc</servlet-name>
@@ -200,6 +205,10 @@
         <servlet-name>BackupExport</servlet-name>
         <url-pattern>/BackupExport</url-pattern>
     </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>NetworkTesting</servlet-name>
+        <url-pattern>/NetworkTesting</url-pattern>
+    </servlet-mapping>
     <mime-mapping>
         <extension>inc</extension>
         <mime-type>text/plain</mime-type>

Added: 
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=1340177&view=auto
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/networktesting.lzx
 (added)
+++ 
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/networktesting.lzx
 Fri May 18 17:24:08 2012
@@ -0,0 +1,32 @@
+<?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.
+  
+-->
+<canvas debug="true" width="100%" height="100%" title="NetworkTesting">
+
+    <include href="tools/" />
+
+    <attribute name="pingTool" value="null" />
+
+    <handler name="oninit">
+        canvas.pingTool = new lz.PingTool();
+        
canvas.pingTool.ping("http://192.168.56.101:5080/openmeetings/testingToolsFiles/pingTest";);
+    </handler>
+
+</canvas>

Added: 
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tools/library.lzx
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tools/library.lzx?rev=1340177&view=auto
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tools/library.lzx
 (added)
+++ 
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tools/library.lzx
 Fri May 18 17:24:08 2012
@@ -0,0 +1,25 @@
+<?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="pingtool.lzx" />
+
+</library>

Added: 
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tools/pingtool.lzx
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tools/pingtool.lzx?rev=1340177&view=auto
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tools/pingtool.lzx
 (added)
+++ 
incubator/openmeetings/trunk/singlewebapp/WebContent/swf10/networkTesting/tools/pingtool.lzx
 Fri May 18 17:24:08 2012
@@ -0,0 +1,96 @@
+<?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>
+
+<class name="PingTool">
+
+    <switch>
+        <when property="$as3">
+            <passthrough>
+                import flash.display.*;
+                import flash.events.*;
+                import flash.net.*;
+                import flash.utils.*;
+            </passthrough>
+        </when>
+    </switch>
+
+    <attribute name="startTime" type="number" value="0" />
+    <attribute name="wholeTime" type="number" value="0" />
+    <attribute name="testsFinished" type="number" value="0" />
+    <attribute name="testsCount" type="number" value="10" />
+    <attribute name="successfulTestsCount" type="number" value="10" />
+
+    <attribute name="request" value="null" />
+    <attribute name="loader" value="null" />
+
+
+    <method name="ping" args="hostUrl">
+        this.request = new URLRequest(hostUrl);
+        this.loader = new URLLoader();
+        this.loader.addEventListener(Event.COMPLETE, this.onComplete);
+        this.loader.addEventListener(IOErrorEvent.IO_ERROR, this.onError);
+        this.testsFinished = 0;
+        this.wholeTime = 0;
+        this.successfulTestsCount = 0;
+
+        if($debug) Debug.write("Start pinging...");
+        this.startTime = getTimer();
+        this.loader.load(this.request);
+    </method>
+
+    <method name="onComplete" args="e">
+        <![CDATA[
+        var endTime = getTimer();
+        var pingTime = endTime - this.startTime;
+        this.wholeTime += pingTime;
+        if($debug) Debug.write("Ping time: ", pingTime, " ms");
+
+        this.testsFinished++;
+        this.successfulTestsCount++;
+        if (this.testsFinished < this.testsCount) {
+            this.startTime = getTimer();
+            this.loader.load(this.request);
+        } else {
+            var averageTime = wholeTime / this.successfulTestsCount;
+            if($debug) Debug.write("Average ping time: ", averageTime, " ms");
+        }
+        ]]>
+    </method>
+
+    <method name="onError" args="e">
+        <![CDATA[
+        if($debug) Debug.write("Error: ", e);
+
+        this.testsFinished++;
+        if (this.testsFinished < this.testsCount) {
+            this.startTime = getTimer();
+            this.loader.load(this.request);
+        } else {
+            var averageTime = wholeTime / this.successfulTestsCount;
+            if($debug) Debug.write("Average ping time: ", averageTime, " ms");
+        }
+        ]]>
+    </method>
+
+</class>
+
+</library>

Added: 
incubator/openmeetings/trunk/singlewebapp/WebContent/testingToolsFiles/pingTest
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/testingToolsFiles/pingTest?rev=1340177&view=auto
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/WebContent/testingToolsFiles/pingTest 
(added)
+++ 
incubator/openmeetings/trunk/singlewebapp/WebContent/testingToolsFiles/pingTest 
Fri May 18 17:24:08 2012
@@ -0,0 +1 @@
+0000000000000000000000000000000000000000000000000000000000000000
\ No newline at end of file

Modified: incubator/openmeetings/trunk/singlewebapp/build.xml
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/build.xml?rev=1340177&r1=1340176&r2=1340177&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/build.xml (original)
+++ incubator/openmeetings/trunk/singlewebapp/build.xml Fri May 18 17:24:08 2012
@@ -375,6 +375,27 @@
                </java>
        </target>
 
+        <target name="compile.laszlo.networktesting">
+            <copy todir="${dist.webapps.dir}/testingToolsFiles">
+                <fileset dir="${webcontent.src.dir}/testingToolsFiles" 
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}" />
+                <jvmarg value="-Dlzdebug=${laszlo.debug}" />
+                <jvmarg value="-Dlzproxied=${laszlo.proxied}" />
+                <jvmarg value="-Xms512M" />
+                <jvmarg value="-Xmx512M" />
+                <arg line="--runtime=swf10 --dir ${out.dir.swf} --onerror warn 
networktesting.lzx" />
+            </java>
+        </target>
+
        <target name="compile.laszlo.main.debug.as3" 
depends="-retrieve-openlaszlo">
                <java classname="org.openlaszlo.compiler.Main" fork="true" 
newenvironment="true" failonerror="true" dir="${laszlo.as3.src.dir}" 
classpathref="laszlo.lib">
                        <jvmarg value="-DLPS_HOME=${laszlo.home}" />

Added: 
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/servlet/outputhandler/NetworkTestingServlet.java
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/servlet/outputhandler/NetworkTestingServlet.java?rev=1340177&view=auto
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/servlet/outputhandler/NetworkTestingServlet.java
 (added)
+++ 
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/servlet/outputhandler/NetworkTestingServlet.java
 Fri May 18 17:24:08 2012
@@ -0,0 +1,7 @@
+package org.openmeetings.networkTestingTool;
+
+import javax.servlet.http.HttpServlet;
+
+public class NetworkTestingServlet extends HttpServlet {
+
+}


Reply via email to