diff options
Diffstat (limited to 'test/samples/w3c/ecma')
-rw-r--r-- | test/samples/w3c/ecma/test159.scxml | 4 | ||||
-rw-r--r-- | test/samples/w3c/ecma/test191.scxml | 2 | ||||
-rw-r--r-- | test/samples/w3c/ecma/test354.scxml | 52 | ||||
-rw-r--r-- | test/samples/w3c/ecma/test415.scxml | 12 | ||||
-rw-r--r-- | test/samples/w3c/ecma/test483.scxml | 27 | ||||
-rw-r--r-- | test/samples/w3c/ecma/test513.scxml | 50 | ||||
-rw-r--r-- | test/samples/w3c/ecma/test528.scxml | 3 |
7 files changed, 145 insertions, 5 deletions
diff --git a/test/samples/w3c/ecma/test159.scxml b/test/samples/w3c/ecma/test159.scxml index d144855..d7b7821 100644 --- a/test/samples/w3c/ecma/test159.scxml +++ b/test/samples/w3c/ecma/test159.scxml @@ -6,8 +6,8 @@ The send tag will raise an error so var1 should not be incremented. If it is fa <state id="s0"> <onentry> - <send event="thisWillFail" conf:illegaltarget=""/> - <conf:incrementId id="1"/> + <send event="thisWillFail" target="baz"/> + <assign location="Var1" expr="Var1 + 1"/> </onentry> <transition cond="Var1==1" target="fail"/> <transition target="pass"/> diff --git a/test/samples/w3c/ecma/test191.scxml b/test/samples/w3c/ecma/test191.scxml index a44856b..6e82274 100644 --- a/test/samples/w3c/ecma/test191.scxml +++ b/test/samples/w3c/ecma/test191.scxml @@ -22,7 +22,7 @@ pass, otherwise we fail. The timer insures that some event is generated and tha </content> </invoke> <transition event="childToParent" target="pass"/> - <transition event="*" target="pass"/> + <transition event="*" target="fail"/> </state> <final id="pass"><onentry><log label="Outcome" expr="'pass'"/></onentry></final> diff --git a/test/samples/w3c/ecma/test354.scxml b/test/samples/w3c/ecma/test354.scxml new file mode 100644 index 0000000..3a3c33b --- /dev/null +++ b/test/samples/w3c/ecma/test354.scxml @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="UTF-8"?><!-- test that event.data can be populated using both namelist, param and <content> +and that correct values are used --><scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" version="1.0" datamodel="ecmascript"> +<datamodel> + <data id="Var1" expr="1"/> + <data id="Var2"/> + <data id="Var3"/> + </datamodel> + +<state id="s0"> + <onentry> + <send delay="5s" event="timeout"/> + <send event="event1" type="http://www.w3.org/TR/scxml/#SCXMLEventProcessor" namelist="Var1"> + <param name="param1" expr="2"/> + </send> + </onentry> + <transition event="event1" target="s1"> + <assign location="Var2" expr="_event.data.Var1"/> + <assign location="Var3" expr="_event.data.param1"/> + </transition> + <transition event="*" target="fail"> + </transition> + +</state> + +<state id="s1"> + + <transition cond="Var2==1" target="s2"/> + <transition target="fail"/> + </state> + +<state id="s2"> + <transition cond="Var3==2" target="s3"/> + <transition target="fail"/> + </state> + +<state id="s3"> + <onentry> + <send delay="5s" event="timeout"/> + <send event="event2"> + <content>foo</content> + </send> + </onentry> + <transition event="event2" cond="_event.data === 'foo'" target="pass"/> + <transition event="*" target="fail"/> + +</state> + + + <final id="pass"><onentry><log label="Outcome" expr="'pass'"/></onentry></final> + <final id="fail"><onentry><log label="Outcome" expr="'fail'"/></onentry></final> + +</scxml>
\ No newline at end of file diff --git a/test/samples/w3c/ecma/test415.scxml b/test/samples/w3c/ecma/test415.scxml new file mode 100644 index 0000000..159218b --- /dev/null +++ b/test/samples/w3c/ecma/test415.scxml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?><!-- Test that the state machine halts when it enters a top-level final state. Since + the initial state is a final state, this machine should halt immediately without + processing "event1" which is raised in the final state's on-entry handler. This + is a manual test since there is no platform-independent way to test that event1 + is not processed --><scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="final" version="1.0" datamodel="ecmascript"> + <final id="final"> + <onentry> + <raise event="event1"/> + </onentry> + </final> + +</scxml>
\ No newline at end of file diff --git a/test/samples/w3c/ecma/test483.scxml b/test/samples/w3c/ecma/test483.scxml new file mode 100644 index 0000000..0a1b236 --- /dev/null +++ b/test/samples/w3c/ecma/test483.scxml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?><!-- test that foreach works correctly, iterating over node set in document order. + This tests assertions 483-485 --><scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" name="scxmltest" initial="s0" version="1.0" datamodel="xpath"> + <datamodel> + <data id="var1"> + <nodes xmlns=""> + <node/> + <node/> + <node/> + </nodes> + </data> + </datamodel> + +<state id="s0"> + <onentry> + <foreach array="$var1/nodes/node" item="item" index="pos"> + <assign location="$item" type="addattribute" attr="position" expr="$pos"/> + </foreach> + </onentry> + + <transition cond="$var1/nodes/node[1]/@position = 1 and $var1/nodes/node[2]/@position = 2 and $var1/nodes/node[3]/@position = 3" target="pass"/> + <transition target="fail"/> + </state> + +<final id="pass"><onentry><log label="Outcome" expr="'pass'"/></onentry></final> +<final id="fail"><onentry><log label="Outcome" expr="'fail'"/></onentry></final> + +</scxml>
\ No newline at end of file diff --git a/test/samples/w3c/ecma/test513.scxml b/test/samples/w3c/ecma/test513.scxml new file mode 100644 index 0000000..c26d498 --- /dev/null +++ b/test/samples/w3c/ecma/test513.scxml @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="UTF-8"?><!-- test that we get an HTTP success code back on successful delivery. To run this test, implementations +must support an extension to send: if the parameter httpResponse is present with value 'true', then when +the processor gets an http response code back, it must raise an event 'http.n1.nrest' where 'ni' is +the first digit of the response code and 'nrest' are the remaining digits--><scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" initial="s0" datamodel="ecmascript" version="1.0"> + +<state id="s0" initial="s01"> + <datamodel> + <data id="Var1"/> + </datamodel> + + <onentry> + <send event="timeout" delay="30s"/> + </onentry> + <invoke type="http://www.w3.org/TR/scxml/"> + <content> + <!-- child script. Once we're running send childRunning to parent and include basicHTTPAccess URI --> + <scxml initial="child0" datamodel="ecmascript" version="1.0"> + <state id="child0"> + <onentry> + <send target="#_parent" event="childRunning"> + <param name="uri" expr="_ioprocessors['basichttp']['location']"/> + </send> + </onentry> + </state> + </scxml> + </content> + </invoke> + + <transition event="*" target="fail"/> + + <state id="s01"> + <!-- when we get the event from the child, extract the access uri and use + the basicHTTP event i/o processor to send it an event --> + <transition event="childRunning" target="s02"> + <assign location="Var1" expr="_event.data.uri"/> + <send event="test" targetexpr="Var1" httpResponse="true" type="http://www.w3.org/TR/scxml/#BasicHTTPEventProcessor"/> + </transition> + </state> + + <state id="s02"> + <!-- the child should send this back automatically. It does not need to take + any transition on the event --> + <transition event="HTTP.2" target="pass"/> + </state> + </state> + + <final id="pass"><onentry><log label="Outcome" expr="'pass'"/></onentry></final> + <final id="fail"><onentry><log label="Outcome" expr="'fail'"/></onentry></final> + +</scxml>
\ No newline at end of file diff --git a/test/samples/w3c/ecma/test528.scxml b/test/samples/w3c/ecma/test528.scxml index edeb367..f0e8911 100644 --- a/test/samples/w3c/ecma/test528.scxml +++ b/test/samples/w3c/ecma/test528.scxml @@ -6,8 +6,7 @@ <transition event="error.execution" target="s1"/> <transition event="done.state.s0" target="fail"/> - <transition event="done.state.s0" target="fail"> - </transition> + <transition event="done.state.s0" target="fail"/> <state id="s01"> <transition target="s02"/> |