You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by jb...@apache.org on 2010/06/12 21:41:56 UTC

svn commit: r954115 - in /commons/sandbox/gsoc/2010/scxml-js/trunk/test: kitchen_sink/scripts/unitTest.js xslt/AbstractEnumeratedStatechartGenerator.xsl

Author: jbeard
Date: Sat Jun 12 19:41:56 2010
New Revision: 954115

URL: http://svn.apache.org/viewvc?rev=954115&view=rev
Log:
Fixed bug involving send not being generated for Enumerated statecharts.

Modified:
    commons/sandbox/gsoc/2010/scxml-js/trunk/test/kitchen_sink/scripts/unitTest.js
    commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/AbstractEnumeratedStatechartGenerator.xsl

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/test/kitchen_sink/scripts/unitTest.js
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/test/kitchen_sink/scripts/unitTest.js?rev=954115&r1=954114&r2=954115&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/test/kitchen_sink/scripts/unitTest.js (original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/test/kitchen_sink/scripts/unitTest.js Sat Jun 12 19:41:56 2010
@@ -31,58 +31,60 @@ dojo.require("doh.runner");
 					sc.initialize();
 				},
 				runTest:function(){
+					var $ = function(conf){return conf.map(function(s){return s.toString()})};
+
 					var conf0 = sc.getCurrentConfiguration();
-					console.log(conf0);
+					console.log($(conf0));
 					doh.assertTrue(setwiseEqual(conf0,[sc._states.Basic1]));
 
 					console.info("sending event t1")
 					sc.t1()
 					var conf1 = sc.getCurrentConfiguration();
-					console.log(conf1);
+					console.log($(conf1));
 					doh.assertTrue(setwiseEqual(conf1,[sc._states.Basic2]));
 
 
 					console.info("sending event t2_7")
 					sc.t2_7()
 					var conf2 = sc.getCurrentConfiguration();
-					console.log(conf2);
+					console.log($(conf2));
 					doh.assertTrue(setwiseEqual(conf2,[sc._states.Basic4,sc._states.Basic6]));
 
 
 					console.info("sending event t3")
 					sc.t3()
 					var conf3 = sc.getCurrentConfiguration();
-					console.log(conf3);
+					console.log($(conf3));
 					doh.assertTrue(setwiseEqual(conf3,[sc._states.Basic5,sc._states.Basic7]));
 
 					console.info("sending event t4_9")
 					sc.t4_9()
 					var conf4 = sc.getCurrentConfiguration();
-					console.log(conf4);
+					console.log($(conf4));
 					doh.assertTrue(setwiseEqual(conf4,[sc._states.Basic2]));
 
 					console.info("sending event t5")
 					sc.t5()
 					var conf5 = sc.getCurrentConfiguration();
-					console.log(conf5);
+					console.log($(conf5));
 					doh.assertTrue(setwiseEqual(conf5,[sc._states.Basic1]));
 
 					console.info("sending event t2_7")
 					sc.t2_7()
 					var conf6 = sc.getCurrentConfiguration();
-					console.log(conf6);
+					console.log($(conf6));
 					doh.assertTrue(setwiseEqual(conf6,[sc._states.Basic5,sc._states.Basic7]));
 
 					console.info("sending event t8")
 					sc.t8()
 					var conf7 = sc.getCurrentConfiguration();
-					console.log(conf7);
+					console.log($(conf7));
 					doh.assertTrue(setwiseEqual(conf7,[sc._states.Basic4,sc._states.Basic7]));
 
 					console.info("sending event t4_9")
 					sc.t4_9()
 					var conf8 = sc.getCurrentConfiguration();
-					console.log(conf8);
+					console.log($(conf8));
 					doh.assertTrue(setwiseEqual(conf8,[sc._states.Basic3]));
 
 					//TODO: hook this up with doh.Deferred...
@@ -90,7 +92,7 @@ dojo.require("doh.runner");
 					var deferred = new doh.Deferred();
 					window.setTimeout(function(){
 						var conf9 = sc.getCurrentConfiguration();
-						console.log(conf9);
+						console.log($(conf9));
 						deferred.callback(setwiseEqual(conf9,[sc._states.FinalState]));
 					},1500);
 					return deferred;

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/AbstractEnumeratedStatechartGenerator.xsl
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/AbstractEnumeratedStatechartGenerator.xsl?rev=954115&r1=954114&r2=954115&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/AbstractEnumeratedStatechartGenerator.xsl (original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/AbstractEnumeratedStatechartGenerator.xsl Sat Jun 12 19:41:56 2010
@@ -150,26 +150,22 @@
 		}
 	</template>
 
-	<template name="genSend">
-		<param name="send"/>
-
-		<if test="send">
-			<variable name="sendEvent" select="$send/@event"/>
-			<variable name="sendDelay" select="number($send/@delay)"/>
-
-			<choose>
-				<when test="$sendDelay">
-					//set timeout
-					toReturn = window.setTimeout(function(){
-						self.GEN(<value-of select="$sendEvent"/>);
-					}, <value-of select="$sendDelay*1000"/>);
-				</when>
-				<otherwise>
-					//just add the event to the outer queue
-					toReturn = innerEventQueue.push(<value-of select="$sendEvent"/>);
-				</otherwise>
-			</choose>
-		</if>
+	<template match="s:send">
+		<variable name="sendEvent" select="@event"/>
+		<variable name="sendDelay" select="number(@delay)"/>
+
+		<choose>
+			<when test="$sendDelay">
+				//set timeout
+				toReturn = window.setTimeout(function(){
+					self.GEN(<value-of select="$sendEvent"/>);
+				}, <value-of select="$sendDelay*1000"/>);
+			</when>
+			<otherwise>
+				//just add the event to the outer queue
+				toReturn = innerEventQueue.push(<value-of select="$sendEvent"/>);
+			</otherwise>
+		</choose>
 	</template>
 
 	<template name="genHistoryTriggerDispatcherHistoryStateReference">