[Laszlo-checkins] r8594 - openlaszlo/trunk/lps/components/lztest
max@openlaszlo.org
max at openlaszlo.org
Tue Apr 8 17:46:08 PDT 2008
Author: max
Date: 2008-04-08 17:46:03 -0700 (Tue, 08 Apr 2008)
New Revision: 8594
Modified:
openlaszlo/trunk/lps/components/lztest/lztestmanager.lzx
Log:
Change 20080408-maxcarlson-W by maxcarlson at Roboto.lan on 2008-04-08 12:16:53 PDT
in /Users/maxcarlson/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: First pass at fixing lztestmanager.lzx
New Features:
Bugs Fixed: LPP-5719 - lztestmanager fails to run in swf9 (partial)
Technical Reviewer: promanik
QA Reviewer: ptw
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: Changed LzTestManager to be a class and initialize .name in the constructor. Renamed LzTestManager to LzTestManagerClass so it can be declared as a singleton (LzTestManager) below. Add missing class properties. Temporarily disable setupServerLogging() pending LzBrowser.getLoadURLAsLzURL() working.
Tests: http://localhost:8080/trunk/test/lztest/lztest-animator.lzx?lzbacktrace=false&lzr=swf9 now compiles, except for a bug with script when="immediate" - see LPP-5725
Modified: openlaszlo/trunk/lps/components/lztest/lztestmanager.lzx
===================================================================
--- openlaszlo/trunk/lps/components/lztest/lztestmanager.lzx 2008-04-08 19:43:51 UTC (rev 8593)
+++ openlaszlo/trunk/lps/components/lztest/lztestmanager.lzx 2008-04-09 00:46:03 UTC (rev 8594)
@@ -8,22 +8,25 @@
<script when="immediate"><![CDATA[
-var LzTestSuite = function ( nm ) {
- this.name = nm;
- this.curtest = 0;
- this.totaltests = 0;
- this.passedtests = 0;
- this.failedtests = 0;
- this.tests = [];
- this.results = [];
+class LzTestSuite {
+public var name = "Default Name";
+public var curtest = 0;
+public var totaltests = 0;
+public var passedtests = 0;
+public var failedtests = 0;
+public var tests = [];
+public var results = [];
+
+public function LzTestSuite ( nm:String? = ""){
+ this.name = nm;
}
-LzTestSuite.prototype.addTest = function( t ) {
+function addTest( t ) {
this.tests.push( t );
this.totaltests = this.totaltests + 1;
}
-LzTestSuite.prototype.printResults = function() {
+function printResults() {
var countedfailedtests = 0;
var countedpassedtests = 0;
for (var tc in this.tests) {
@@ -38,8 +41,9 @@
Debug.error("oh nooooo countedpassedtests != this.passedtests OR countedfailedtests != this.failedtests don't match");
}
}
+}
-class LzTestManager {
+class LzTestManagerClass {
public var totalsuites = 0;
public var passedsuites = 0;
public var failedsuites = 0;
@@ -48,6 +52,8 @@
public var results = [];
public var global = this;
public var logfile = "lztest.log";
+public var loggingEnabled = true;
+public var testpath = "";
public var resultstring = "";
function findTestSuites() {
@@ -62,8 +68,10 @@
}
}
+// TODO: enable this once LzBrowser is working in swf9
function setupServerLogging() {
- var lzurl = LzBrowser.getLoadURLAsLzURL();
+ return;
+ //var lzurl = LzBrowser.getLoadURLAsLzURL();
// strip initial "/legals/" from path, to make it relative to LPS servlet base
if (lzurl.path) {
this.testpath = lzurl.path.substring(lzurl.path.substring(1).indexOf("/")+2) + lzurl.file;
@@ -88,7 +96,7 @@
var query = "logfile="+escape(logfile)+"&msg="+escape(msg);
var reqstr = LzBrowser.toAbsoluteURL( base+"/test/lzunit/Logger.jsp?"+query, false );
//Debug.write("sendServerLogCommand", reqobj, reqstr);
- var tloader = new LzHTTPLoader(this, false, null);
+ var tloader = new LzHTTPLoader(this, false);
tloader.open ("GET" , reqstr, /* username */ null, /* password */ null);
tloader.send (/* content */ null)
}
@@ -260,7 +268,7 @@
}
}
}
-var LzTestManager:LzTestManager = new LzTestManager();
+var LzTestManager:LzTestManagerClass = new LzTestManagerClass();
var startTestsDelegate = new LzDelegate(canvas, "startTests");
startTestsDelegate.register(canvas, "oninit");
More information about the Laszlo-checkins
mailing list