http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-flash/src/main/swf10/networkTesting/tests/BaseURLLoadTest.lzx ---------------------------------------------------------------------- diff --git a/openmeetings-flash/src/main/swf10/networkTesting/tests/BaseURLLoadTest.lzx b/openmeetings-flash/src/main/swf10/networkTesting/tests/BaseURLLoadTest.lzx index 4282969..a0e7eda 100644 --- a/openmeetings-flash/src/main/swf10/networkTesting/tests/BaseURLLoadTest.lzx +++ b/openmeetings-flash/src/main/swf10/networkTesting/tests/BaseURLLoadTest.lzx @@ -1,146 +1,146 @@ -<?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="BaseURLLoadTest" extends="NetworkTest"> - - <switch> - <when property="$as3"> - <passthrough> - import flash.events.*; - import flash.net.*; - import flash.utils.*; - </passthrough> - </when> - </switch> - - <attribute name="testsCount" type="number" value="0" /> - <attribute name="testTypeParameter" type="string" value="null" /> - <attribute name="verbose" type="boolean" value="true" /> - - <attribute name="startTime" type="number" value="0" /> - <attribute name="wholeTime" type="number" value="0" /> - <attribute name="maxTime" type="number" value="0" /> - <attribute name="minTime" type="number" value="999999" /> - <attribute name="finishedTestsCount" type="number" value="0" /> - <attribute name="successfulTestsCount" type="number" value="0" /> - - <attribute name="hostUrl" type="string" value="" /> - <attribute name="loaderInited" type="boolean" value="false" /> - <attribute name="request" value="null" /> - <attribute name="loader" value="null" /> - - <method name="initLoader"> - hostUrl = getBaseUrl() + "services/networktest?type=" + testTypeParameter; - request = new URLRequest(hostUrl); - - loader = new URLLoader(); - loader.addEventListener(Event.COMPLETE, this.onComplete); - loader.addEventListener(IOErrorEvent.IO_ERROR, this.onError); - loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.onError); - - loaderInited = true; - </method> - - <method name="start"> - if (!loaderInited) { - this.initLoader(); - } - finishedTestsCount = 0; - successfulTestsCount = 0; - wholeTime = 0; - maxTime = 0; - minTime = 999999; - - this.log(lbl('report.start') + " " + hostUrl); - startTime = getTimer(); - loader.load(request); - </method> - - <method name="forcedStop"> - loader.close(); - this.log("stopped"); - </method> - - <method name="onComplete" args="e"> - <![CDATA[ - var endTime = getTimer(); - var pingTime = endTime - startTime; - wholeTime += pingTime; - if (pingTime > maxTime) { - maxTime = pingTime; - } - if (pingTime < minTime) { - minTime = pingTime; - } - - if (verbose) { - this.log(lbl('ping.load') + " = " + pingTime + " " + lbl('ms')); - } - - finishedTestsCount++; - successfulTestsCount++; - if (finishedTestsCount < testsCount && running) { - startTime = getTimer(); - loader.load(request); - } else { - this.report(); - } - ]]> - </method> - - <method name="onError" args="e"> - <![CDATA[ - if (verbose) { - this.log("Error - " + e); - } - - finishedTestsCount++; - if (finishedTestsCount < testsCount && running) { - startTime = getTimer(); - loader.load(request); - } else { - this.report(); - } - ]]> - </method> - - <method name="report"> - var report = lbl('report') + ":"; - if (successfulTestsCount > 0) { - report += "\n" + this.generateReport(); - } else { - report += " " + lbl('report.con.err'); - } - this.log(report); - - if (successfulTestsCount > 0) { - this.setPassed(); - } else { - this.setFailed(); - } - </method> - - <method name="generateReport" /> - -</class> - -</library> +<?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="BaseURLLoadTest" extends="NetworkTest"> + + <switch> + <when property="$as3"> + <passthrough> + import flash.events.*; + import flash.net.*; + import flash.utils.*; + </passthrough> + </when> + </switch> + + <attribute name="testsCount" type="number" value="0" /> + <attribute name="testTypeParameter" type="string" value="null" /> + <attribute name="verbose" type="boolean" value="true" /> + + <attribute name="startTime" type="number" value="0" /> + <attribute name="wholeTime" type="number" value="0" /> + <attribute name="maxTime" type="number" value="0" /> + <attribute name="minTime" type="number" value="999999" /> + <attribute name="finishedTestsCount" type="number" value="0" /> + <attribute name="successfulTestsCount" type="number" value="0" /> + + <attribute name="hostUrl" type="string" value="" /> + <attribute name="loaderInited" type="boolean" value="false" /> + <attribute name="request" value="null" /> + <attribute name="loader" value="null" /> + + <method name="initLoader"> + hostUrl = getBaseUrl() + "services/networktest?type=" + testTypeParameter; + request = new URLRequest(hostUrl); + + loader = new URLLoader(); + loader.addEventListener(Event.COMPLETE, this.onComplete); + loader.addEventListener(IOErrorEvent.IO_ERROR, this.onError); + loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.onError); + + loaderInited = true; + </method> + + <method name="start"> + if (!loaderInited) { + this.initLoader(); + } + finishedTestsCount = 0; + successfulTestsCount = 0; + wholeTime = 0; + maxTime = 0; + minTime = 999999; + + this.log(lbl('report.start') + " " + hostUrl); + startTime = getTimer(); + loader.load(request); + </method> + + <method name="forcedStop"> + loader.close(); + this.log("stopped"); + </method> + + <method name="onComplete" args="e"> + <![CDATA[ + var endTime = getTimer(); + var pingTime = endTime - startTime; + wholeTime += pingTime; + if (pingTime > maxTime) { + maxTime = pingTime; + } + if (pingTime < minTime) { + minTime = pingTime; + } + + if (verbose) { + this.log(lbl('ping.load') + " = " + pingTime + " " + lbl('ms')); + } + + finishedTestsCount++; + successfulTestsCount++; + if (finishedTestsCount < testsCount && running) { + startTime = getTimer(); + loader.load(request); + } else { + this.report(); + } + ]]> + </method> + + <method name="onError" args="e"> + <![CDATA[ + if (verbose) { + this.log("Error - " + e); + } + + finishedTestsCount++; + if (finishedTestsCount < testsCount && running) { + startTime = getTimer(); + loader.load(request); + } else { + this.report(); + } + ]]> + </method> + + <method name="report"> + var report = lbl('report') + ":"; + if (successfulTestsCount > 0) { + report += "\n" + this.generateReport(); + } else { + report += " " + lbl('report.con.err'); + } + this.log(report); + + if (successfulTestsCount > 0) { + this.setPassed(); + } else { + this.setFailed(); + } + </method> + + <method name="generateReport" /> + +</class> + +</library>
http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-flash/src/main/swf10/networkTesting/tests/DownloadSpeedTest.lzx ---------------------------------------------------------------------- diff --git a/openmeetings-flash/src/main/swf10/networkTesting/tests/DownloadSpeedTest.lzx b/openmeetings-flash/src/main/swf10/networkTesting/tests/DownloadSpeedTest.lzx index 5b195e7..dd8a083 100644 --- a/openmeetings-flash/src/main/swf10/networkTesting/tests/DownloadSpeedTest.lzx +++ b/openmeetings-flash/src/main/swf10/networkTesting/tests/DownloadSpeedTest.lzx @@ -1,50 +1,50 @@ -<?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="DownloadSpeedTest" extends="BaseURLLoadTest"> - - <handler name="oninit"> - this.setAttribute("testsCount", 1); - this.setAttribute("testName", lbl('dwn')); - this.setAttribute("testTypeParameter", "download"); - this.setAttribute("verbose", false); - this.setAttribute("resultText", true); - </handler> - - <method name="generateReport"> - var mBytes = loader.bytesTotal/(1024*1024); - var timeSec = wholeTime/1000; - var speed = mBytes/timeSec; - - var report = lbl('dwn.bytes') + ": " + mBytes + " " + lbl('mb') + "\n"; - report += lbl('dwn.time') + ": " + timeSec + " " + lbl('sec') + "\n"; - report += lbl('dwn.speed') + ": " + speed + " " + lbl('mb') + "/" + lbl('sec') + "\n"; - - resultLabel.setAttribute("text", ""); - resultLabel.addFormat("%.2f\n%s", speed, lbl('mb') + "/" + lbl('sec')); - - return report; - </method> - -</class> - -</library> +<?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="DownloadSpeedTest" extends="BaseURLLoadTest"> + + <handler name="oninit"> + this.setAttribute("testsCount", 1); + this.setAttribute("testName", lbl('dwn')); + this.setAttribute("testTypeParameter", "download"); + this.setAttribute("verbose", false); + this.setAttribute("resultText", true); + </handler> + + <method name="generateReport"> + var mBytes = loader.bytesTotal/(1024*1024); + var timeSec = wholeTime/1000; + var speed = mBytes/timeSec; + + var report = lbl('dwn.bytes') + ": " + mBytes + " " + lbl('mb') + "\n"; + report += lbl('dwn.time') + ": " + timeSec + " " + lbl('sec') + "\n"; + report += lbl('dwn.speed') + ": " + speed + " " + lbl('mb') + "/" + lbl('sec') + "\n"; + + resultLabel.setAttribute("text", ""); + resultLabel.addFormat("%.2f\n%s", speed, lbl('mb') + "/" + lbl('sec')); + + return report; + </method> + +</class> + +</library> http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-flash/src/main/swf10/networkTesting/tests/JitterTest.lzx ---------------------------------------------------------------------- diff --git a/openmeetings-flash/src/main/swf10/networkTesting/tests/JitterTest.lzx b/openmeetings-flash/src/main/swf10/networkTesting/tests/JitterTest.lzx index e4b2f3d..2bf8d3e 100644 --- a/openmeetings-flash/src/main/swf10/networkTesting/tests/JitterTest.lzx +++ b/openmeetings-flash/src/main/swf10/networkTesting/tests/JitterTest.lzx @@ -1,57 +1,57 @@ -<?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="JitterTest" extends="BaseURLLoadTest"> - - <handler name="oninit"> - this.setAttribute("testsCount", 100); - this.setAttribute("testName", lbl('jitter')); - this.setAttribute("testTypeParameter", "jitter"); - 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; - var report = lbl('jitter.avg') + ": " + averageTime + " " + lbl('ms') + "\n"; - report += lbl('jitter.min') + ": " + minTime + " " + lbl('ms') + "\n"; - report += lbl('jitter.max') + ": " + maxTime + " " + lbl('ms') + "\n"; - report += lbl('jitter') + ": " + jitterMax + " " + lbl('ms') + "; " + jitterMin + " " + lbl('ms') + " \n"; - - var max = -jitterMin; - if (jitterMax > max) { - max = jitterMax; - } - - resultLabel.setAttribute("text", ""); - resultLabel.addFormat("%.0d\n%s", max, lbl('ms')); - - return report; - ]]> - </method> - -</class> - -</library> +<?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="JitterTest" extends="BaseURLLoadTest"> + + <handler name="oninit"> + this.setAttribute("testsCount", 100); + this.setAttribute("testName", lbl('jitter')); + this.setAttribute("testTypeParameter", "jitter"); + 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; + var report = lbl('jitter.avg') + ": " + averageTime + " " + lbl('ms') + "\n"; + report += lbl('jitter.min') + ": " + minTime + " " + lbl('ms') + "\n"; + report += lbl('jitter.max') + ": " + maxTime + " " + lbl('ms') + "\n"; + report += lbl('jitter') + ": " + jitterMax + " " + lbl('ms') + "; " + jitterMin + " " + lbl('ms') + " \n"; + + var max = -jitterMin; + if (jitterMax > max) { + max = jitterMax; + } + + resultLabel.setAttribute("text", ""); + resultLabel.addFormat("%.0d\n%s", max, lbl('ms')); + + return report; + ]]> + </method> + +</class> + +</library> http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-flash/src/main/swf10/networkTesting/tests/NetworkTest.lzx ---------------------------------------------------------------------- diff --git a/openmeetings-flash/src/main/swf10/networkTesting/tests/NetworkTest.lzx b/openmeetings-flash/src/main/swf10/networkTesting/tests/NetworkTest.lzx index 811a3cb..e837748 100644 --- a/openmeetings-flash/src/main/swf10/networkTesting/tests/NetworkTest.lzx +++ b/openmeetings-flash/src/main/swf10/networkTesting/tests/NetworkTest.lzx @@ -1,128 +1,128 @@ -<?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="NetworkTest" extends="view"> - - <attribute name="testName" type="string" value="null" /> - <attribute name="protocol" type="string" value="null" /> - <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> - <text name="nameLabel" text="${parent.testName}" 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; - 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> - - <method name="setFailed"> - if (running) { - running=false; - picture.rsc.setAttribute("resource", "failed"); - canvas.setAttribute("busy", false); - this.handleAllTestsMode(); - } - </method> - - <method name="setRunning"> - if (canvas.busy) { - return; - } - canvas.setAttribute("busy", true); - this.start(); - running=true; - resultLabel.setAttribute("visible", false); - picture.rsc.setAttribute("resource", "running"); - picture.rsc.play(); - </method> - - <method name="setStopped"> - this.forcedStop(); - running=false; - picture.rsc.setAttribute("resource", "notrun"); - canvas.setAttribute("busy", false); - this.handleAllTestsMode(); - </method> - - <method name="log" args="message"> - var str = testName + ": " + message + "\n"; - canvas.log += str; - if ($debug) Debug.write(str); - </method> - - <method name="getBaseUrl"> - var hostUrl = protocol + "://" + host + ":" + port + canvas.uriContext; - return hostUrl + (hostUrl.slice(-1) == '/' ? '' : '/'); - </method> - - <method name="lbl" args="key"> - return canvas.lbl(key); - </method> - -</class> - -</library> +<?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="NetworkTest" extends="view"> + + <attribute name="testName" type="string" value="null" /> + <attribute name="protocol" type="string" value="null" /> + <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> + <text name="nameLabel" text="${parent.testName}" 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; + 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> + + <method name="setFailed"> + if (running) { + running=false; + picture.rsc.setAttribute("resource", "failed"); + canvas.setAttribute("busy", false); + this.handleAllTestsMode(); + } + </method> + + <method name="setRunning"> + if (canvas.busy) { + return; + } + canvas.setAttribute("busy", true); + this.start(); + running=true; + resultLabel.setAttribute("visible", false); + picture.rsc.setAttribute("resource", "running"); + picture.rsc.play(); + </method> + + <method name="setStopped"> + this.forcedStop(); + running=false; + picture.rsc.setAttribute("resource", "notrun"); + canvas.setAttribute("busy", false); + this.handleAllTestsMode(); + </method> + + <method name="log" args="message"> + var str = testName + ": " + message + "\n"; + canvas.log += str; + if ($debug) Debug.write(str); + </method> + + <method name="getBaseUrl"> + var hostUrl = protocol + "://" + host + ":" + port + canvas.uriContext; + return hostUrl + (hostUrl.slice(-1) == '/' ? '' : '/'); + </method> + + <method name="lbl" args="key"> + return canvas.lbl(key); + </method> + +</class> + +</library> http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-flash/src/main/swf10/networkTesting/tests/PingTest.lzx ---------------------------------------------------------------------- diff --git a/openmeetings-flash/src/main/swf10/networkTesting/tests/PingTest.lzx b/openmeetings-flash/src/main/swf10/networkTesting/tests/PingTest.lzx index 6217cc3..61d484b 100644 --- a/openmeetings-flash/src/main/swf10/networkTesting/tests/PingTest.lzx +++ b/openmeetings-flash/src/main/swf10/networkTesting/tests/PingTest.lzx @@ -1,43 +1,43 @@ -<?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="PingTest" extends="BaseURLLoadTest"> - - <handler name="oninit"> - this.setAttribute("testsCount", 10); - this.setAttribute("testName", lbl('ping')); - this.setAttribute("testTypeParameter", "ping"); - </handler> - - <method name="generateReport"> - var averageTime = wholeTime / successfulTestsCount; - var packetsLost = testsCount - successfulTestsCount; - var report = lbl('ping.avg') + ": " + averageTime + " " + lbl('ms') + "\n"; - report += lbl('ping.rcv') + ": " + successfulTestsCount + "\n"; - report += lbl('ping.lost') + ": " + packetsLost + "\n"; - - return report; - </method> - -</class> - -</library> +<?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="PingTest" extends="BaseURLLoadTest"> + + <handler name="oninit"> + this.setAttribute("testsCount", 10); + this.setAttribute("testName", lbl('ping')); + this.setAttribute("testTypeParameter", "ping"); + </handler> + + <method name="generateReport"> + var averageTime = wholeTime / successfulTestsCount; + var packetsLost = testsCount - successfulTestsCount; + var report = lbl('ping.avg') + ": " + averageTime + " " + lbl('ms') + "\n"; + report += lbl('ping.rcv') + ": " + successfulTestsCount + "\n"; + report += lbl('ping.lost') + ": " + packetsLost + "\n"; + + return report; + </method> + +</class> + +</library> http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-flash/src/main/swf10/networkTesting/tests/PortAvailabilityTest.lzx ---------------------------------------------------------------------- diff --git a/openmeetings-flash/src/main/swf10/networkTesting/tests/PortAvailabilityTest.lzx b/openmeetings-flash/src/main/swf10/networkTesting/tests/PortAvailabilityTest.lzx index 65e1d95..ea60c7e 100644 --- a/openmeetings-flash/src/main/swf10/networkTesting/tests/PortAvailabilityTest.lzx +++ b/openmeetings-flash/src/main/swf10/networkTesting/tests/PortAvailabilityTest.lzx @@ -1,90 +1,90 @@ -<?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="PortAvailabilityTest" extends="NetworkTest"> - - <switch> - <when property="$as3"> - <passthrough> - import flash.events.*; - import flash.net.*; - import flash.system.*; - </passthrough> - </when> - </switch> - - <rtmpConnection name="rtmp" debug="true" /> - - <handler name="oninit"> - this.setAttribute("testName", lbl('port')); - </handler> - - <method name="start"> - var hostUrl = protocol + "://" + host + ":" + port + canvas.rtmpUriPath; - rtmp.setAttribute("src", hostUrl); - this.log(": " + lbl('report.start') + " " + hostUrl); - - canvas.publicSID = "networktest"; - rtmp.connect(); - </method> - - <method name="forcedStop"> - this.log(lbl('port.stopped')); - disconnect(); - </method> - - <method name="disconnect"> - rtmp._nc.close(); - rtmp.setAttribute('status', 'disconnected'); - rtmp.setAttribute('stage', 0); - </method> - - <handler name="onconnect" reference="rtmp"> - if (running) { - this.log(lbl('port.avail') + "\n"); - this.setPassed(); - disconnect(); - } - </handler> - - <handler name="onerror" args="e" reference="rtmp"> - if (running) { - this.log(lbl('report.con.err') + " - " + e + "\n"); - this.setFailed(); - } - </handler> - - <handler name="onstatus" args="e" reference="rtmp"> - if (running) { - switch(e) { - case "timed out": - case "connection failed": - this.setFailed(); - break; - } - if($debug) Debug.write(testName + ": RTMP connect status - ", e); - } - </handler> - -</class> - -</library> +<?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="PortAvailabilityTest" extends="NetworkTest"> + + <switch> + <when property="$as3"> + <passthrough> + import flash.events.*; + import flash.net.*; + import flash.system.*; + </passthrough> + </when> + </switch> + + <rtmpConnection name="rtmp" debug="true" /> + + <handler name="oninit"> + this.setAttribute("testName", lbl('port')); + </handler> + + <method name="start"> + var hostUrl = protocol + "://" + host + ":" + port + canvas.rtmpUriPath; + rtmp.setAttribute("src", hostUrl); + this.log(": " + lbl('report.start') + " " + hostUrl); + + canvas.publicSID = "networktest"; + rtmp.connect(); + </method> + + <method name="forcedStop"> + this.log(lbl('port.stopped')); + disconnect(); + </method> + + <method name="disconnect"> + rtmp._nc.close(); + rtmp.setAttribute('status', 'disconnected'); + rtmp.setAttribute('stage', 0); + </method> + + <handler name="onconnect" reference="rtmp"> + if (running) { + this.log(lbl('port.avail') + "\n"); + this.setPassed(); + disconnect(); + } + </handler> + + <handler name="onerror" args="e" reference="rtmp"> + if (running) { + this.log(lbl('report.con.err') + " - " + e + "\n"); + this.setFailed(); + } + </handler> + + <handler name="onstatus" args="e" reference="rtmp"> + if (running) { + switch(e) { + case "timed out": + case "connection failed": + this.setFailed(); + break; + } + if($debug) Debug.write(testName + ": RTMP connect status - ", e); + } + </handler> + +</class> + +</library> http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-flash/src/main/swf10/networkTesting/tests/UploadSpeedTest.lzx ---------------------------------------------------------------------- diff --git a/openmeetings-flash/src/main/swf10/networkTesting/tests/UploadSpeedTest.lzx b/openmeetings-flash/src/main/swf10/networkTesting/tests/UploadSpeedTest.lzx index 5edca71..92ea5bf 100644 --- a/openmeetings-flash/src/main/swf10/networkTesting/tests/UploadSpeedTest.lzx +++ b/openmeetings-flash/src/main/swf10/networkTesting/tests/UploadSpeedTest.lzx @@ -1,124 +1,124 @@ -<?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="UploadSpeedTest" extends="NetworkTest"> - - <switch> - <when property="$as3"> - <passthrough> - import flash.events.*; - import flash.net.*; - import flash.utils.*; - </passthrough> - </when> - </switch> - - <attribute name="startTime" type="number" value="0" /> - - <attribute name="hostUrl" type="string" value="" /> - <attribute name="loaderInited" type="boolean" value="false" /> - <attribute name="vars" value="null" /> - <attribute name="request" value="null" /> - <attribute name="loader" value="null" /> - - <handler name="oninit"> - this.setAttribute("testName", lbl('upl')); - this.setAttribute("resultText", true); - </handler> - - <method name="initLoader"> - hostUrl = getBaseUrl() + "services/networktest"; - loader = new RestCall({ - url: hostUrl - , method: URLRequestMethod.POST - , dataFormat: URLLoaderDataFormat.BINARY - , contentType: "multipart/form-data; charset=utf-8; boundary=" + UploadPostHelper.getBoundary() - , errorCallback: onError - , successCallback: onComplete - }); - vars = UploadPostHelper.getPostData('aaa', getData()); - if ($debug) Debug.write("initLoader:: ");//, vars - loaderInited = true; - </method> - - <method name="start"> - if ($debug) Debug.write("start:: ", request); - if (!loaderInited) { - this.initLoader(); - } - - if ($debug) Debug.write("going to start:: ", loader); - this.log(lbl('report.start') + " " + hostUrl); - startTime = getTimer(); - request = loader.load(vars); - if ($debug) Debug.write("load:: ", request); - </method> - - <method name="forcedStop"> - loader.close(); - this.log("stopped"); - </method> - - <method name="onComplete" args="e"> - if ($debug) Debug.write("onComplete:: ", e); - if (running) { - var endTime = getTimer(); - var loadTime = endTime - startTime; - var loadTimeSec = loadTime/1000; - var mBytes = request.data.length/(1024*1024); - var speed = mBytes / loadTimeSec; - - var report = "report:\n"; - report += lbl('upl.bytes') + ": " + mBytes + " " + lbl('mb') + "\n"; - report += lbl('upl.time') + ": " + loadTimeSec + " " + lbl('sec') + "\n"; - report += lbl('upl.speed') + ": " + speed + " " + lbl('mb') + "/" + lbl('sec') + "\n"; - - resultLabel.setAttribute("text", ""); - resultLabel.addFormat("%.2f\n%s", speed, lbl('mb') + "/" + lbl('sec')); - this.log(report); - this.setPassed(); - } - </method> - - <method name="onError" args="e"> - if ($debug) Debug.write("onError:: ", e); - if (running) { - this.log(lbl('report.error') + " - " + e); - this.setFailed(); - } - </method> - - <!-- returns a 1 Mb string--> - <method name="getData"> - <![CDATA[ - var result:ByteArray = new ByteArray(); - for (var i = 0; i < 64 * 16384; ++i) { - result.writeByte(i % 256); - } - result.position = 0; - return result; - ]]> - </method> - -</class> - -</library> +<?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="UploadSpeedTest" extends="NetworkTest"> + + <switch> + <when property="$as3"> + <passthrough> + import flash.events.*; + import flash.net.*; + import flash.utils.*; + </passthrough> + </when> + </switch> + + <attribute name="startTime" type="number" value="0" /> + + <attribute name="hostUrl" type="string" value="" /> + <attribute name="loaderInited" type="boolean" value="false" /> + <attribute name="vars" value="null" /> + <attribute name="request" value="null" /> + <attribute name="loader" value="null" /> + + <handler name="oninit"> + this.setAttribute("testName", lbl('upl')); + this.setAttribute("resultText", true); + </handler> + + <method name="initLoader"> + hostUrl = getBaseUrl() + "services/networktest"; + loader = new RestCall({ + url: hostUrl + , method: URLRequestMethod.POST + , dataFormat: URLLoaderDataFormat.BINARY + , contentType: "multipart/form-data; charset=utf-8; boundary=" + UploadPostHelper.getBoundary() + , errorCallback: onError + , successCallback: onComplete + }); + vars = UploadPostHelper.getPostData('aaa', getData()); + if ($debug) Debug.write("initLoader:: ");//, vars + loaderInited = true; + </method> + + <method name="start"> + if ($debug) Debug.write("start:: ", request); + if (!loaderInited) { + this.initLoader(); + } + + if ($debug) Debug.write("going to start:: ", loader); + this.log(lbl('report.start') + " " + hostUrl); + startTime = getTimer(); + request = loader.load(vars); + if ($debug) Debug.write("load:: ", request); + </method> + + <method name="forcedStop"> + loader.close(); + this.log("stopped"); + </method> + + <method name="onComplete" args="e"> + if ($debug) Debug.write("onComplete:: ", e); + if (running) { + var endTime = getTimer(); + var loadTime = endTime - startTime; + var loadTimeSec = loadTime/1000; + var mBytes = request.data.length/(1024*1024); + var speed = mBytes / loadTimeSec; + + var report = "report:\n"; + report += lbl('upl.bytes') + ": " + mBytes + " " + lbl('mb') + "\n"; + report += lbl('upl.time') + ": " + loadTimeSec + " " + lbl('sec') + "\n"; + report += lbl('upl.speed') + ": " + speed + " " + lbl('mb') + "/" + lbl('sec') + "\n"; + + resultLabel.setAttribute("text", ""); + resultLabel.addFormat("%.2f\n%s", speed, lbl('mb') + "/" + lbl('sec')); + this.log(report); + this.setPassed(); + } + </method> + + <method name="onError" args="e"> + if ($debug) Debug.write("onError:: ", e); + if (running) { + this.log(lbl('report.error') + " - " + e); + this.setFailed(); + } + </method> + + <!-- returns a 1 Mb string--> + <method name="getData"> + <![CDATA[ + var result:ByteArray = new ByteArray(); + for (var i = 0; i < 64 * 16384; ++i) { + result.writeByte(i % 256); + } + result.position = 0; + return result; + ]]> + </method> + +</class> + +</library> http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-flash/src/main/swf10/networkTesting/tests/library.lzx ---------------------------------------------------------------------- diff --git a/openmeetings-flash/src/main/swf10/networkTesting/tests/library.lzx b/openmeetings-flash/src/main/swf10/networkTesting/tests/library.lzx index 9b8575d..5021b9c 100644 --- a/openmeetings-flash/src/main/swf10/networkTesting/tests/library.lzx +++ b/openmeetings-flash/src/main/swf10/networkTesting/tests/library.lzx @@ -1,37 +1,37 @@ -<?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> - - <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" /> - <include href="DownloadSpeedTest.lzx" /> - <include href="JitterTest.lzx" /> - <include href="NetworkTest.lzx" /> - <include href="PingTest.lzx" /> - <include href="PortAvailabilityTest.lzx" /> - <include href="UploadSpeedTest.lzx" /> - -</library> +<?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> + + <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" /> + <include href="DownloadSpeedTest.lzx" /> + <include href="JitterTest.lzx" /> + <include href="NetworkTest.lzx" /> + <include href="PingTest.lzx" /> + <include href="PortAvailabilityTest.lzx" /> + <include href="UploadSpeedTest.lzx" /> + +</library> http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-flash/src/main/swf10/networkTesting/testsView.lzx ---------------------------------------------------------------------- diff --git a/openmeetings-flash/src/main/swf10/networkTesting/testsView.lzx b/openmeetings-flash/src/main/swf10/networkTesting/testsView.lzx index abe03c0..5e6f6ab 100644 --- a/openmeetings-flash/src/main/swf10/networkTesting/testsView.lzx +++ b/openmeetings-flash/src/main/swf10/networkTesting/testsView.lzx @@ -1,105 +1,105 @@ -<?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="rtmpConnection.lzx" /> -<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="$once{canvas.lbl('click.play')}" - 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="$once{canvas.lbl('copy.log')}" - x="${parent.logButton.x - this.width - parent.smallOffset}" - y="${parent.label.y}" - /> - - <PingTest - name="pingTest" protocol="${canvas.httpProtocol}" host="${canvas.httpHost}" port="${canvas.httpPort}" - x="${parent.offset}" - y="${parent.label.y + parent.label.height + parent.offset/2}" - /> - <PortAvailabilityTest - name="portTest" protocol="${canvas.rtmpProtocol}" host="${canvas.rtmpHost}" port="${canvas.rtmpPort}" - x="${parent.pingTest.x + parent.pingTest.width + parent.offset}" - y="${parent.pingTest.y}" - /> - <JitterTest - name="jitterTest" protocol="${canvas.httpProtocol}" host="${canvas.httpHost}" port="${canvas.httpPort}" - x="${parent.portTest.x + parent.portTest.width + parent.offset}" - y="${parent.pingTest.y}" - /> - <DownloadSpeedTest - name="downloadTest" protocol="${canvas.httpProtocol}" host="${canvas.httpHost}" port="${canvas.httpPort}" - x="${parent.jitterTest.x + parent.jitterTest.width + parent.offset}" - y="${parent.pingTest.y}" - /> - - <UploadSpeedTest - name="uploadTest" protocol="${canvas.httpProtocol}" host="${canvas.httpHost}" port="${canvas.httpPort}" - x="${parent.downloadTest.x + parent.downloadTest.width + parent.offset}" - 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> +<?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="rtmpConnection.lzx" /> +<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="$once{canvas.lbl('click.play')}" + 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="$once{canvas.lbl('copy.log')}" + x="${parent.logButton.x - this.width - parent.smallOffset}" + y="${parent.label.y}" + /> + + <PingTest + name="pingTest" protocol="${canvas.httpProtocol}" host="${canvas.httpHost}" port="${canvas.httpPort}" + x="${parent.offset}" + y="${parent.label.y + parent.label.height + parent.offset/2}" + /> + <PortAvailabilityTest + name="portTest" protocol="${canvas.rtmpProtocol}" host="${canvas.rtmpHost}" port="${canvas.rtmpPort}" + x="${parent.pingTest.x + parent.pingTest.width + parent.offset}" + y="${parent.pingTest.y}" + /> + <JitterTest + name="jitterTest" protocol="${canvas.httpProtocol}" host="${canvas.httpHost}" port="${canvas.httpPort}" + x="${parent.portTest.x + parent.portTest.width + parent.offset}" + y="${parent.pingTest.y}" + /> + <DownloadSpeedTest + name="downloadTest" protocol="${canvas.httpProtocol}" host="${canvas.httpHost}" port="${canvas.httpPort}" + x="${parent.jitterTest.x + parent.jitterTest.width + parent.offset}" + y="${parent.pingTest.y}" + /> + + <UploadSpeedTest + name="uploadTest" protocol="${canvas.httpProtocol}" host="${canvas.httpHost}" port="${canvas.httpPort}" + x="${parent.downloadTest.x + parent.downloadTest.width + parent.offset}" + 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> http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-flash/src/site/site.xml ---------------------------------------------------------------------- diff --git a/openmeetings-flash/src/site/site.xml b/openmeetings-flash/src/site/site.xml index b7a0eae..dd3dc53 100644 --- a/openmeetings-flash/src/site/site.xml +++ b/openmeetings-flash/src/site/site.xml @@ -1,39 +1,39 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - Licensed 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. - --> -<project xmlns="http://maven.apache.org/DECORATION/1.7.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/DECORATION/1.7.0 http://maven.apache.org/xsd/decoration-1.7.0.xsd" - name="Apache OpenMeetings Project"> - - <body> - <menu ref="parent"/> - <menu name="Project"> - <item name="About" href="/index.html" /> - <item name="Info" href="/project-info.html" /> - <item name="Summary" href="/project-summary.html" /> - <item name="License" href="/license.html" /> - <item name="Dependencies" href="/dependencies.html" /> - <item name="Dependency Convergence" href="/dependency-convergence.html" /> - <item name="RAT Report" href="/rat-report.html" /> - </menu> - </body> - <custom> - <reflowSkin> - <bottomNav maxSpan="12"> - <column>Parent Project</column> - <column>Project</column> - </bottomNav> - </reflowSkin> - </custom> -</project> +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed 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. + --> +<project xmlns="http://maven.apache.org/DECORATION/1.7.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/DECORATION/1.7.0 http://maven.apache.org/xsd/decoration-1.7.0.xsd" + name="Apache OpenMeetings Project"> + + <body> + <menu ref="parent"/> + <menu name="Project"> + <item name="About" href="/index.html" /> + <item name="Info" href="/project-info.html" /> + <item name="Summary" href="/project-summary.html" /> + <item name="License" href="/license.html" /> + <item name="Dependencies" href="/dependencies.html" /> + <item name="Dependency Convergence" href="/dependency-convergence.html" /> + <item name="RAT Report" href="/rat-report.html" /> + </menu> + </body> + <custom> + <reflowSkin> + <bottomNav maxSpan="12"> + <column>Parent Project</column> + <column>Project</column> + </bottomNav> + </reflowSkin> + </custom> +</project> http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-install/src/main/java/org/apache/openmeetings/backup/AppointmentConverter.java ---------------------------------------------------------------------- diff --git a/openmeetings-install/src/main/java/org/apache/openmeetings/backup/AppointmentConverter.java b/openmeetings-install/src/main/java/org/apache/openmeetings/backup/AppointmentConverter.java index 71c8ebc..79ee837 100644 --- a/openmeetings-install/src/main/java/org/apache/openmeetings/backup/AppointmentConverter.java +++ b/openmeetings-install/src/main/java/org/apache/openmeetings/backup/AppointmentConverter.java @@ -1,55 +1,55 @@ -/* - * 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. - */ -package org.apache.openmeetings.backup; - -import java.util.Map; - -import org.apache.openmeetings.db.dao.calendar.AppointmentDao; -import org.apache.openmeetings.db.entity.calendar.Appointment; -import org.simpleframework.xml.stream.InputNode; -import org.simpleframework.xml.stream.OutputNode; - -public class AppointmentConverter extends OmConverter<Appointment> { - private AppointmentDao appointmentDao; - private Map<Long, Long> idMap; - - public AppointmentConverter() { - //default constructor is for export - } - - public AppointmentConverter(AppointmentDao appointmentDao, Map<Long, Long> idMap) { - this.appointmentDao = appointmentDao; - this.idMap = idMap; - } - - @Override - public Appointment read(InputNode node) throws Exception { - long oldId = getLong(node); - Long newId = idMap.containsKey(oldId) ? idMap.get(oldId) : oldId; - - Appointment a = appointmentDao.getAny(newId); - return a == null ? new Appointment() : a; - } - - @Override - public void write(OutputNode node, Appointment value) throws Exception { - node.setData(true); - node.setValue(value == null ? "0" : "" + value.getId()); - } +/* + * 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. + */ +package org.apache.openmeetings.backup; + +import java.util.Map; + +import org.apache.openmeetings.db.dao.calendar.AppointmentDao; +import org.apache.openmeetings.db.entity.calendar.Appointment; +import org.simpleframework.xml.stream.InputNode; +import org.simpleframework.xml.stream.OutputNode; + +public class AppointmentConverter extends OmConverter<Appointment> { + private AppointmentDao appointmentDao; + private Map<Long, Long> idMap; + + public AppointmentConverter() { + //default constructor is for export + } + + public AppointmentConverter(AppointmentDao appointmentDao, Map<Long, Long> idMap) { + this.appointmentDao = appointmentDao; + this.idMap = idMap; + } + + @Override + public Appointment read(InputNode node) throws Exception { + long oldId = getLong(node); + Long newId = idMap.containsKey(oldId) ? idMap.get(oldId) : oldId; + + Appointment a = appointmentDao.getAny(newId); + return a == null ? new Appointment() : a; + } + + @Override + public void write(OutputNode node, Appointment value) throws Exception { + node.setData(true); + node.setValue(value == null ? "0" : "" + value.getId()); + } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-install/src/main/java/org/apache/openmeetings/backup/AppointmentReminderTypeConverter.java ---------------------------------------------------------------------- diff --git a/openmeetings-install/src/main/java/org/apache/openmeetings/backup/AppointmentReminderTypeConverter.java b/openmeetings-install/src/main/java/org/apache/openmeetings/backup/AppointmentReminderTypeConverter.java index d0750c5..aec044e 100644 --- a/openmeetings-install/src/main/java/org/apache/openmeetings/backup/AppointmentReminderTypeConverter.java +++ b/openmeetings-install/src/main/java/org/apache/openmeetings/backup/AppointmentReminderTypeConverter.java @@ -1,39 +1,39 @@ -/* - * 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. - */ -package org.apache.openmeetings.backup; - -import org.apache.openmeetings.db.entity.calendar.Appointment.Reminder; -import org.simpleframework.xml.stream.InputNode; -import org.simpleframework.xml.stream.OutputNode; - -public class AppointmentReminderTypeConverter extends OmConverter<Reminder> { - public AppointmentReminderTypeConverter() { - } - - @Override - public Reminder read(InputNode node) throws Exception { - return Reminder.get(getInt(node)); - } - - @Override - public void write(OutputNode node, Reminder value) throws Exception { - node.setData(true); - node.setValue(value == null ? "0" : "" + value.getId()); - } -} +/* + * 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. + */ +package org.apache.openmeetings.backup; + +import org.apache.openmeetings.db.entity.calendar.Appointment.Reminder; +import org.simpleframework.xml.stream.InputNode; +import org.simpleframework.xml.stream.OutputNode; + +public class AppointmentReminderTypeConverter extends OmConverter<Reminder> { + public AppointmentReminderTypeConverter() { + } + + @Override + public Reminder read(InputNode node) throws Exception { + return Reminder.get(getInt(node)); + } + + @Override + public void write(OutputNode node, Reminder value) throws Exception { + node.setData(true); + node.setValue(value == null ? "0" : "" + value.getId()); + } +} http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-install/src/main/java/org/apache/openmeetings/backup/DateConverter.java ---------------------------------------------------------------------- diff --git a/openmeetings-install/src/main/java/org/apache/openmeetings/backup/DateConverter.java b/openmeetings-install/src/main/java/org/apache/openmeetings/backup/DateConverter.java index d44ddbd..7f3967d 100644 --- a/openmeetings-install/src/main/java/org/apache/openmeetings/backup/DateConverter.java +++ b/openmeetings-install/src/main/java/org/apache/openmeetings/backup/DateConverter.java @@ -1,41 +1,41 @@ -/* - * 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. - */ -package org.apache.openmeetings.backup; - -import java.util.Date; - -import org.apache.openmeetings.util.CalendarPatterns; -import org.simpleframework.xml.convert.Converter; -import org.simpleframework.xml.stream.InputNode; -import org.simpleframework.xml.stream.OutputNode; - -public class DateConverter implements Converter<Date> { - @Override - public Date read(InputNode node) throws Exception { - String val = node.getValue(); - return val == null || "null".equals(val) ? new Date() : CalendarPatterns.parseImportDate(val); - } - - @Override - public void write(OutputNode node, Date value) throws Exception { - node.setAttribute("class", "java.util.Date"); - node.setData(true); - node.setValue(value == null ? "0" : CalendarPatterns.getExportDate(value)); - } +/* + * 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. + */ +package org.apache.openmeetings.backup; + +import java.util.Date; + +import org.apache.openmeetings.util.CalendarPatterns; +import org.simpleframework.xml.convert.Converter; +import org.simpleframework.xml.stream.InputNode; +import org.simpleframework.xml.stream.OutputNode; + +public class DateConverter implements Converter<Date> { + @Override + public Date read(InputNode node) throws Exception { + String val = node.getValue(); + return val == null || "null".equals(val) ? new Date() : CalendarPatterns.parseImportDate(val); + } + + @Override + public void write(OutputNode node, Date value) throws Exception { + node.setAttribute("class", "java.util.Date"); + node.setData(true); + node.setValue(value == null ? "0" : CalendarPatterns.getExportDate(value)); + } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-install/src/main/java/org/apache/openmeetings/backup/GroupConverter.java ---------------------------------------------------------------------- diff --git a/openmeetings-install/src/main/java/org/apache/openmeetings/backup/GroupConverter.java b/openmeetings-install/src/main/java/org/apache/openmeetings/backup/GroupConverter.java index 29cee41..67c363b 100644 --- a/openmeetings-install/src/main/java/org/apache/openmeetings/backup/GroupConverter.java +++ b/openmeetings-install/src/main/java/org/apache/openmeetings/backup/GroupConverter.java @@ -1,55 +1,55 @@ -/* - * 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. - */ -package org.apache.openmeetings.backup; - -import java.util.Map; - -import org.apache.openmeetings.db.dao.user.GroupDao; -import org.apache.openmeetings.db.entity.user.Group; -import org.simpleframework.xml.stream.InputNode; -import org.simpleframework.xml.stream.OutputNode; - -public class GroupConverter extends OmConverter<Group> { - private GroupDao groupDao; - private Map<Long, Long> idMap; - - public GroupConverter() { - //default constructor is for export - } - - public GroupConverter(GroupDao groupDao, Map<Long, Long> idMap) { - this.groupDao = groupDao; - this.idMap = idMap; - } - - @Override - public Group read(InputNode node) throws Exception { - long oldId = getLong(node); - long newId = idMap.containsKey(oldId) ? idMap.get(oldId) : oldId; - - Group o = groupDao.get(newId); - return o == null ? new Group() : o; - } - - @Override - public void write(OutputNode node, Group value) throws Exception { - node.setData(true); - node.setValue(value == null ? "0" : "" + value.getId()); - } +/* + * 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. + */ +package org.apache.openmeetings.backup; + +import java.util.Map; + +import org.apache.openmeetings.db.dao.user.GroupDao; +import org.apache.openmeetings.db.entity.user.Group; +import org.simpleframework.xml.stream.InputNode; +import org.simpleframework.xml.stream.OutputNode; + +public class GroupConverter extends OmConverter<Group> { + private GroupDao groupDao; + private Map<Long, Long> idMap; + + public GroupConverter() { + //default constructor is for export + } + + public GroupConverter(GroupDao groupDao, Map<Long, Long> idMap) { + this.groupDao = groupDao; + this.idMap = idMap; + } + + @Override + public Group read(InputNode node) throws Exception { + long oldId = getLong(node); + long newId = idMap.containsKey(oldId) ? idMap.get(oldId) : oldId; + + Group o = groupDao.get(newId); + return o == null ? new Group() : o; + } + + @Override + public void write(OutputNode node, Group value) throws Exception { + node.setData(true); + node.setValue(value == null ? "0" : "" + value.getId()); + } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-install/src/main/java/org/apache/openmeetings/backup/InlineConverter.java ---------------------------------------------------------------------- diff --git a/openmeetings-install/src/main/java/org/apache/openmeetings/backup/InlineConverter.java b/openmeetings-install/src/main/java/org/apache/openmeetings/backup/InlineConverter.java index 4ab9f24..de31d41 100644 --- a/openmeetings-install/src/main/java/org/apache/openmeetings/backup/InlineConverter.java +++ b/openmeetings-install/src/main/java/org/apache/openmeetings/backup/InlineConverter.java @@ -1,29 +1,29 @@ -/* - * 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. - */ -package org.apache.openmeetings.backup; - -import org.simpleframework.xml.stream.InputNode; - -public abstract class InlineConverter<T> extends OmConverter<T> { - - String getNextValue(InputNode parent, String name) throws Exception { - InputNode node = parent.getNext(name); - return node != null ? node.getValue() : null; - } -} +/* + * 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. + */ +package org.apache.openmeetings.backup; + +import org.simpleframework.xml.stream.InputNode; + +public abstract class InlineConverter<T> extends OmConverter<T> { + + String getNextValue(InputNode parent, String name) throws Exception { + InputNode node = parent.getNext(name); + return node != null ? node.getValue() : null; + } +} http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-install/src/main/java/org/apache/openmeetings/backup/IntegerTransform.java ---------------------------------------------------------------------- diff --git a/openmeetings-install/src/main/java/org/apache/openmeetings/backup/IntegerTransform.java b/openmeetings-install/src/main/java/org/apache/openmeetings/backup/IntegerTransform.java index 6f6aa7f..dc7dc7e 100644 --- a/openmeetings-install/src/main/java/org/apache/openmeetings/backup/IntegerTransform.java +++ b/openmeetings-install/src/main/java/org/apache/openmeetings/backup/IntegerTransform.java @@ -1,34 +1,34 @@ -/* - * 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. - */ -package org.apache.openmeetings.backup; - -import org.simpleframework.xml.transform.Transform; - -public class IntegerTransform implements Transform<Integer>{ - @Override - public Integer read(String value) throws Exception { - return OmConverter.getInt(value, 0); - } - - @Override - public String write(Integer value) throws Exception { - return "" + value; - } - -} +/* + * 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. + */ +package org.apache.openmeetings.backup; + +import org.simpleframework.xml.transform.Transform; + +public class IntegerTransform implements Transform<Integer>{ + @Override + public Integer read(String value) throws Exception { + return OmConverter.getInt(value, 0); + } + + @Override + public String write(Integer value) throws Exception { + return "" + value; + } + +} http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-install/src/main/java/org/apache/openmeetings/backup/LongTransform.java ---------------------------------------------------------------------- diff --git a/openmeetings-install/src/main/java/org/apache/openmeetings/backup/LongTransform.java b/openmeetings-install/src/main/java/org/apache/openmeetings/backup/LongTransform.java index d48be83..e171383 100644 --- a/openmeetings-install/src/main/java/org/apache/openmeetings/backup/LongTransform.java +++ b/openmeetings-install/src/main/java/org/apache/openmeetings/backup/LongTransform.java @@ -1,33 +1,33 @@ -/* - * 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. - */ -package org.apache.openmeetings.backup; - -import org.simpleframework.xml.transform.Transform; - -public class LongTransform implements Transform<Long> { - @Override - public Long read(String value) throws Exception { - return OmConverter.getLong(value); - } - - @Override - public String write(Long value) throws Exception { - return "" + value; - } -} +/* + * 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. + */ +package org.apache.openmeetings.backup; + +import org.simpleframework.xml.transform.Transform; + +public class LongTransform implements Transform<Long> { + @Override + public Long read(String value) throws Exception { + return OmConverter.getLong(value); + } + + @Override + public String write(Long value) throws Exception { + return "" + value; + } +} http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-install/src/main/java/org/apache/openmeetings/backup/OmCalendarConverter.java ---------------------------------------------------------------------- diff --git a/openmeetings-install/src/main/java/org/apache/openmeetings/backup/OmCalendarConverter.java b/openmeetings-install/src/main/java/org/apache/openmeetings/backup/OmCalendarConverter.java index 613e6ff..f4c9349 100644 --- a/openmeetings-install/src/main/java/org/apache/openmeetings/backup/OmCalendarConverter.java +++ b/openmeetings-install/src/main/java/org/apache/openmeetings/backup/OmCalendarConverter.java @@ -1,55 +1,55 @@ -/* - * 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. - */ -package org.apache.openmeetings.backup; - -import java.util.Map; - -import org.apache.openmeetings.db.dao.calendar.OmCalendarDao; -import org.apache.openmeetings.db.entity.calendar.OmCalendar; -import org.simpleframework.xml.stream.InputNode; -import org.simpleframework.xml.stream.OutputNode; - -public class OmCalendarConverter extends OmConverter<OmCalendar> { - private OmCalendarDao calendarDao; - private Map<Long, Long> idMap; - - public OmCalendarConverter() { - //default constructor is for export - } - - public OmCalendarConverter(OmCalendarDao calendarDao, Map<Long, Long> idMap) { - this.calendarDao = calendarDao; - this.idMap = idMap; - } - - @Override - public OmCalendar read(InputNode node) throws Exception { - long oldId = getLong(node); - Long newId = idMap.containsKey(oldId) ? idMap.get(oldId) : oldId; - - OmCalendar c = calendarDao.get(newId); - return c == null ? new OmCalendar() : c; - } - - @Override - public void write(OutputNode node, OmCalendar value) throws Exception { - node.setData(true); - node.setValue(value == null ? "0" : "" + value.getId()); - } -} +/* + * 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. + */ +package org.apache.openmeetings.backup; + +import java.util.Map; + +import org.apache.openmeetings.db.dao.calendar.OmCalendarDao; +import org.apache.openmeetings.db.entity.calendar.OmCalendar; +import org.simpleframework.xml.stream.InputNode; +import org.simpleframework.xml.stream.OutputNode; + +public class OmCalendarConverter extends OmConverter<OmCalendar> { + private OmCalendarDao calendarDao; + private Map<Long, Long> idMap; + + public OmCalendarConverter() { + //default constructor is for export + } + + public OmCalendarConverter(OmCalendarDao calendarDao, Map<Long, Long> idMap) { + this.calendarDao = calendarDao; + this.idMap = idMap; + } + + @Override + public OmCalendar read(InputNode node) throws Exception { + long oldId = getLong(node); + Long newId = idMap.containsKey(oldId) ? idMap.get(oldId) : oldId; + + OmCalendar c = calendarDao.get(newId); + return c == null ? new OmCalendar() : c; + } + + @Override + public void write(OutputNode node, OmCalendar value) throws Exception { + node.setData(true); + node.setValue(value == null ? "0" : "" + value.getId()); + } +}
