summaryrefslogtreecommitdiffstats
path: root/test/uscxml
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-12-07 14:31:09 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-12-07 14:31:09 (GMT)
commit9608216597fd17021d38e80689644beb3c85abb9 (patch)
tree1e3375c8beecd160be1f66750c201167c1b8c6a0 /test/uscxml
parent93f8cb376e6e496f0194d1e0657081354434da96 (diff)
downloaduscxml-9608216597fd17021d38e80689644beb3c85abb9.zip
uscxml-9608216597fd17021d38e80689644beb3c85abb9.tar.gz
uscxml-9608216597fd17021d38e80689644beb3c85abb9.tar.bz2
More complete xinclude implementation and tests
Diffstat (limited to 'test/uscxml')
-rw-r--r--test/uscxml/xinclude/test-fail-namespace1.include3
-rw-r--r--test/uscxml/xinclude/test-fail-namespace1.scxml16
-rw-r--r--test/uscxml/xinclude/test-fail-namespace2.include3
-rw-r--r--test/uscxml/xinclude/test-fail-namespace2.scxml16
-rw-r--r--test/uscxml/xinclude/test-fail-namespace3.include (renamed from test/uscxml/xinclude/included.scxml)2
-rw-r--r--test/uscxml/xinclude/test-fail-namespace3.scxml16
-rw-r--r--test/uscxml/xinclude/test-fail-namespace4.include3
-rw-r--r--test/uscxml/xinclude/test-fail-namespace4.scxml15
-rw-r--r--test/uscxml/xinclude/test-recursive-include.include5
-rw-r--r--test/uscxml/xinclude/test-recursive-include.scxml15
-rw-r--r--test/uscxml/xinclude/test-xinclude-simple.scxml25
-rw-r--r--test/uscxml/xinclude/test-xinclude.scxml9
-rw-r--r--test/uscxml/xinclude/text-xinclude-simple.included3
13 files changed, 121 insertions, 10 deletions
diff --git a/test/uscxml/xinclude/test-fail-namespace1.include b/test/uscxml/xinclude/test-fail-namespace1.include
new file mode 100644
index 0000000..28f0cc6
--- /dev/null
+++ b/test/uscxml/xinclude/test-fail-namespace1.include
@@ -0,0 +1,3 @@
+<state id="start" xmlns:bar="http://www.w3.org/2001/Foo">
+ <transition target="pass" />
+</state>
diff --git a/test/uscxml/xinclude/test-fail-namespace1.scxml b/test/uscxml/xinclude/test-fail-namespace1.scxml
new file mode 100644
index 0000000..dea45c6
--- /dev/null
+++ b/test/uscxml/xinclude/test-fail-namespace1.scxml
@@ -0,0 +1,16 @@
+<!-- Namespace http://www.w3.org/2001/Foo is mapped from prefix foo and bar -> error -->
+<scxml
+ xmlns:xi="http://www.w3.org/2001/XInclude"
+ xmlns:foo="http://www.w3.org/2001/Foo">
+ <!-- include from file -->
+ <xi:include href="test-fail-namespace1.include" />
+ <state id="s0">
+ <transition target="fail" />
+ </state>
+ <final id="fail">
+ <onentry><log expr="FAIL!" /></onentry>
+ </final>
+ <final id="pass">
+ <onentry><log expr="PASS!" /></onentry>
+ </final>
+</scxml>
diff --git a/test/uscxml/xinclude/test-fail-namespace2.include b/test/uscxml/xinclude/test-fail-namespace2.include
new file mode 100644
index 0000000..5a69573
--- /dev/null
+++ b/test/uscxml/xinclude/test-fail-namespace2.include
@@ -0,0 +1,3 @@
+<state id="start" xmlns:foo="http://www.w3.org/2001/Bar">
+ <transition target="pass" />
+</state>
diff --git a/test/uscxml/xinclude/test-fail-namespace2.scxml b/test/uscxml/xinclude/test-fail-namespace2.scxml
new file mode 100644
index 0000000..f256e54
--- /dev/null
+++ b/test/uscxml/xinclude/test-fail-namespace2.scxml
@@ -0,0 +1,16 @@
+<!-- Prefix foo is pointing to http://www.w3.org/2001/Foo and http://www.w3.org/2001/Bar -> error -->
+<scxml
+ xmlns:xi="http://www.w3.org/2001/XInclude"
+ xmlns:foo="http://www.w3.org/2001/Foo">
+ <!-- include from file -->
+ <xi:include href="test-fail-namespace2.include" />
+ <state id="s0">
+ <transition target="fail" />
+ </state>
+ <final id="fail">
+ <onentry><log expr="FAIL!" /></onentry>
+ </final>
+ <final id="pass">
+ <onentry><log expr="PASS!" /></onentry>
+ </final>
+</scxml>
diff --git a/test/uscxml/xinclude/included.scxml b/test/uscxml/xinclude/test-fail-namespace3.include
index 4d8c8f5..d6b2fc7 100644
--- a/test/uscxml/xinclude/included.scxml
+++ b/test/uscxml/xinclude/test-fail-namespace3.include
@@ -1,3 +1,3 @@
<state id="start">
<transition target="pass" />
-</state> \ No newline at end of file
+</state>
diff --git a/test/uscxml/xinclude/test-fail-namespace3.scxml b/test/uscxml/xinclude/test-fail-namespace3.scxml
new file mode 100644
index 0000000..f7c6dd1
--- /dev/null
+++ b/test/uscxml/xinclude/test-fail-namespace3.scxml
@@ -0,0 +1,16 @@
+<!-- Qualified SCXML Namespace includes unqualified -> warning -->
+<scxml:scxml
+ xmlns:xi="http://www.w3.org/2001/XInclude"
+ xmlns:scxml="http://www.w3.org/2005/07/scxml">
+ <!-- include from file -->
+ <xi:include href="test-fail-namespace3.include" />
+ <scxml:state id="s0">
+ <scxml:transition target="fail" />
+ </scxml:state>
+ <scxml:final id="fail">
+ <scxml:onentry><scxml:log expr="FAIL!" /></scxml:onentry>
+ </scxml:final>
+ <scxml:final id="pass">
+ <scxml:onentry><scxml:log expr="PASS!" /></scxml:onentry>
+ </scxml:final>
+</scxml:scxml>
diff --git a/test/uscxml/xinclude/test-fail-namespace4.include b/test/uscxml/xinclude/test-fail-namespace4.include
new file mode 100644
index 0000000..279b53e
--- /dev/null
+++ b/test/uscxml/xinclude/test-fail-namespace4.include
@@ -0,0 +1,3 @@
+<scxml:state id="start" xmlns:scxml="http://www.w3.org/2005/07/scxml">
+ <scxml:transition target="pass" />
+</scxml:state>
diff --git a/test/uscxml/xinclude/test-fail-namespace4.scxml b/test/uscxml/xinclude/test-fail-namespace4.scxml
new file mode 100644
index 0000000..f5d4af7
--- /dev/null
+++ b/test/uscxml/xinclude/test-fail-namespace4.scxml
@@ -0,0 +1,15 @@
+<!-- Unqualified SCXML Namespace includes qualified -> error -->
+<scxml
+ xmlns:xi="http://www.w3.org/2001/XInclude">
+ <!-- include from file -->
+ <xi:include href="test-fail-namespace4.include" />
+ <state id="s0">
+ <transition target="fail" />
+ </state>
+ <final id="fail">
+ <onentry><log expr="FAIL!" /></onentry>
+ </final>
+ <final id="pass">
+ <onentry><log expr="PASS!" /></onentry>
+ </final>
+</scxml>
diff --git a/test/uscxml/xinclude/test-recursive-include.include b/test/uscxml/xinclude/test-recursive-include.include
new file mode 100644
index 0000000..a46b928
--- /dev/null
+++ b/test/uscxml/xinclude/test-recursive-include.include
@@ -0,0 +1,5 @@
+<state id="foo"
+ xmlns:xi="http://www.w3.org/2001/XInclude" >
+ <!-- include from file -->
+ <xi:include href="test-recursive-include.include" />
+</state>
diff --git a/test/uscxml/xinclude/test-recursive-include.scxml b/test/uscxml/xinclude/test-recursive-include.scxml
new file mode 100644
index 0000000..62618a1
--- /dev/null
+++ b/test/uscxml/xinclude/test-recursive-include.scxml
@@ -0,0 +1,15 @@
+<!-- include is recursive -> error -->
+<scxml
+ xmlns:xi="http://www.w3.org/2001/XInclude">
+ <!-- include from file -->
+ <xi:include href="test-recursive-include.include" />
+ <state id="s0">
+ <transition target="fail" />
+ </state>
+ <final id="fail">
+ <onentry><log expr="FAIL!" /></onentry>
+ </final>
+ <final id="pass">
+ <onentry><log expr="PASS!" /></onentry>
+ </final>
+</scxml>
diff --git a/test/uscxml/xinclude/test-xinclude-simple.scxml b/test/uscxml/xinclude/test-xinclude-simple.scxml
new file mode 100644
index 0000000..72127cd
--- /dev/null
+++ b/test/uscxml/xinclude/test-xinclude-simple.scxml
@@ -0,0 +1,25 @@
+<scxml xmlns:xi="http://www.w3.org/2001/XInclude">
+ <!-- include from file -->
+ <xi:include href="text-xinclude-simple.included" />
+ <state id="s0">
+ <transition target="fail" />
+ </state>
+ <state id="s1">
+ <!-- force fallback via invalid url -->
+ <xi:include href="included.invalid">
+ <xi:fallback>
+ <transition target="s2" />
+ </xi:fallback>
+ </xi:include>
+ <transition target="fail" />
+ </state>
+ <state id="s2">
+ <transition target="pass" />
+ </state>
+ <final id="fail">
+ <onentry><log expr="FAIL!" /></onentry>
+ </final>
+ <final id="pass">
+ <onentry><log expr="PASS!" /></onentry>
+ </final>
+</scxml> \ No newline at end of file
diff --git a/test/uscxml/xinclude/test-xinclude.scxml b/test/uscxml/xinclude/test-xinclude.scxml
deleted file mode 100644
index a07c087..0000000
--- a/test/uscxml/xinclude/test-xinclude.scxml
+++ /dev/null
@@ -1,9 +0,0 @@
-<scxml xmlns:xi="http://www.w3.org/2001/XInclude">
- <xi:include href="included.scxml" />
- <final id="fail">
- <onentry><log expr="FAIL!" /></onentry>
- </final>
- <final id="pass">
- <onentry><log expr="PASS!" /></onentry>
- </final>
-</scxml> \ No newline at end of file
diff --git a/test/uscxml/xinclude/text-xinclude-simple.included b/test/uscxml/xinclude/text-xinclude-simple.included
new file mode 100644
index 0000000..4ff416f
--- /dev/null
+++ b/test/uscxml/xinclude/text-xinclude-simple.included
@@ -0,0 +1,3 @@
+<state id="start">
+ <transition target="s1" />
+</state> \ No newline at end of file