You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shindig.apache.org by li...@apache.org on 2010/03/16 22:56:23 UTC

svn commit: r924013 - /shindig/trunk/java/server/src/test/resources/endtoend/testframework.js

Author: lindner
Date: Tue Mar 16 21:56:23 2010
New Revision: 924013

URL: http://svn.apache.org/viewvc?rev=924013&view=rev
Log:
Add serial execution of javascript tests

Modified:
    shindig/trunk/java/server/src/test/resources/endtoend/testframework.js

Modified: shindig/trunk/java/server/src/test/resources/endtoend/testframework.js
URL: http://svn.apache.org/viewvc/shindig/trunk/java/server/src/test/resources/endtoend/testframework.js?rev=924013&r1=924012&r2=924013&view=diff
==============================================================================
--- shindig/trunk/java/server/src/test/resources/endtoend/testframework.js (original)
+++ shindig/trunk/java/server/src/test/resources/endtoend/testframework.js Tue Mar 16 21:56:23 2010
@@ -43,8 +43,11 @@ function assertEquals(msg, a, b) {
  * method must be called to verify that a test completed successfully,
  * instead of simply failing to load.
  */
+
 function finished() {
   alert("FINISHED");
+  // After finishing run the next test..
+  runOneTest();
 }
 
 /** Executes the test identifed by the testMethod URL parameter */
@@ -72,11 +75,21 @@ function executeTest() {
   }
 }
 
+var testFunctions = [];
+
+function runOneTest() {
+  var t = testFunctions.pop();
+  if (t) {
+    alert(t);
+    tests[t]();
+  }
+}
 function allTests() {
+  // Collect the test names and iterate through them serially
   for (var testMethod in tests) {
-    alert(testMethod);
-    tests[testMethod]();
+    testFunctions.push(testMethod);
   }
+  runOneTest();
 }
 
 gadgets.util.registerOnLoadHandler(executeTest);