summaryrefslogtreecommitdiffstats
path: root/test/samples
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-01-14 16:15:09 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-01-14 16:15:09 (GMT)
commit836927aa902696297febc95132e2c82147c08c03 (patch)
tree64bcbaa67c6f70acdb5f4cc9184f600fad46b826 /test/samples
parentf7ca1ebaa5a527f817892bc3794452df1a6c20c6 (diff)
downloaduscxml-836927aa902696297febc95132e2c82147c08c03.zip
uscxml-836927aa902696297febc95132e2c82147c08c03.tar.gz
uscxml-836927aa902696297febc95132e2c82147c08c03.tar.bz2
Expect Invoker and Fedora build fixes
Diffstat (limited to 'test/samples')
-rw-r--r--test/samples/uscxml/test-expect.scxml64
1 files changed, 64 insertions, 0 deletions
diff --git a/test/samples/uscxml/test-expect.scxml b/test/samples/uscxml/test-expect.scxml
new file mode 100644
index 0000000..abd2a58
--- /dev/null
+++ b/test/samples/uscxml/test-expect.scxml
@@ -0,0 +1,64 @@
+<scxml datamodel="ecmascript">
+ <script src="http://uscxml.tk.informatik.tu-darmstadt.de/scripts/dump.js" />
+ <state id="start">
+ <state id="spawn">
+ <invoke type="expect" id="telnet">
+ <param name="debug" expr="false" />
+ <param name="timeout" expr="3" />
+ <param name="loguser" expr="false" />
+ <param name="spawn" expr="'/usr/bin/telnet'" />
+ <param name="argument" expr="_ioprocessors.basichttp.host" />
+ <param name="argument" expr="_ioprocessors.basichttp.port" />
+ <!-- <param name="argument" expr="80" /> -->
+ <finalize><script>//print('------------'); dump(_event);</script></finalize>
+ </invoke>
+
+ <state id="idle">
+ <onentry><log expr="'Waiting'"/></onentry>
+ <transition event="spawn.success" target="spawned" />
+ <transition event="spawn.failed" target="exit">
+ <script>print('FAIL: '); dump(_event);</script>
+ </transition>
+ </state>
+
+ <state id="spawned">
+ <onentry>
+ <log expr="'Spawned'"/>
+ <send target="#_telnet" event="expect.match">
+ <param name="exact:refused" expr="'Connection refused'" />
+ <!-- last line of a telnet connect -->
+ <param name="exact:connected" expr="'Escape character is \'^]\'.'" />
+ </send>
+ </onentry>
+ <transition event="expect.match.connected" target="established" />
+ </state>
+
+ <state id="established">
+ <onentry>
+ <log expr="'Established'"/>
+ <send target="#_telnet" event="expect.send">
+ <content>GET /${_name} HTTP/1.1\n\n</content>
+ </send>
+ <send target="#_telnet" event="expect.match">
+ <param name="exact:answered" expr="'Some arbitrary content'" />
+ </send>
+ </onentry>
+
+ <!-- Answer the telnet request -->
+ <transition event="http.get" type="internal">
+ <respond to="_event.origin">
+ <header name="Content-Type" value="text/plain" />
+ <content>Some arbitrary content</content>
+ </respond>
+ </transition>
+
+ <transition event="expect.match.answered" target="start" type="external" />
+
+ </state>
+
+ </state>
+ </state>
+
+
+ <final id="exit" />
+</scxml> \ No newline at end of file